1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

> 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
This commit is contained in:
Bruce Momjian
2001-09-14 17:46:40 +00:00
parent e8d5b8d290
commit c1fbf06654
11 changed files with 799 additions and 38 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq-fe.h,v 1.74 2001/09/07 22:02:32 momjian Exp $
* $Id: libpq-fe.h,v 1.75 2001/09/14 17:46:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -253,6 +253,7 @@ extern "C"
/* Quoting strings before inclusion in queries. */
extern size_t PQescapeString (char *to, const char *from, size_t length);
extern unsigned char *PQescapeBytea(unsigned char *bintext, size_t binlen, size_t *bytealen);
/* Simple synchronous query */
extern PGresult *PQexec(PGconn *conn, const char *query);