Re: [PATCHES] PQescapeBytea documentation patch - Mailing list pgsql-interfaces

From Patrick Welche
Subject Re: [PATCHES] PQescapeBytea documentation patch
Date
Msg-id 20011121122555.B21102@quartz.newn.cam.ac.uk
Whole thread Raw
List pgsql-interfaces
On Tue, Nov 20, 2001 at 12:21:00PM -0800, Joe Conway wrote:
> Here's a patch adding documentation for the PQescapeBytea function to 
> libpq.sgml
...
+    <function>PQescapeBytea</function>
+    Escapes a binary string (bytea type) for use within an SQL query.
+    <synopsis>
+     unsigned char *PQescapeBytea(unsigned char *from,
+                                          size_t from_length,
+                                          size_t *to_length);


This makes me wonder: should libpq contain a function to do the opposite
too? eg.

string=GetValue(from a bytea type column)
PQunescapeBytea(string, some buffer, buffer's size)

- or is there already another way of doing it?

It seems to me that anyone using bytea with libpq will end up having
to reinvent this wheel. (Something worthy of being knocked up in my
Copious Free Time (tm))

Cheers,

Patrick


pgsql-interfaces by date:

Previous
From: Bell John
Date:
Subject: Re: What front end are people using?
Next
From: Joe Conway
Date:
Subject: Re: [PATCHES] PQescapeBytea documentation patch