From c1fbf06654aca97a109a2346d182158e8f14ab01 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 14 Sep 2001 17:46:40 +0000 Subject: > Here's a revised patch. Changes: > > 1. Now outputs '\\' instead of '\134' when using encode(bytea, 'escape') > Note that I ended up leaving \0 as \000 so that there are no ambiguities > when decoding something like, for example, \0123. > > 2. Fixed bug in byteain which allowed input values which were not valid > octals (e.g. \789), to be parsed as if they were octals. > > Joe > Here's rev 2 of the bytea string support patch. Changes: 1. Added missing declaration for MatchBytea function 2. Added PQescapeBytea to fe-exec.c 3. Applies cleanly on cvs tip from this afternoon I'm hoping that someone can review/approve/apply this before beta starts, so I guess I'd vote (not that it counts for much) to delay beta a few days :-) Joe Conway --- src/backend/utils/adt/selfuncs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/adt/selfuncs.c') diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 406916c8873..f92f3c20f1e 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.96 2001/08/13 18:45:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.97 2001/09/14 17:46:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2992,6 +2992,11 @@ string_lessthan(const char *str1, const char *str2, Oid datatype) datum1, datum2)); break; + case BYTEAOID: + result = DatumGetBool(DirectFunctionCall2(bytealt, + datum1, datum2)); + break; + default: elog(ERROR, "string_lessthan: unexpected datatype %u", datatype); result = false; -- cgit v1.2.3