Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fALCQ3m34112 for ; Wed, 21 Nov 2001 07:26:13 -0500 (EST) (envelope-from prlw1@newn.cam.ac.uk) Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk) by henry.newn.cam.ac.uk with esmtp (Exim 3.13 #1) id 166WRv-0003Jm-00; Wed, 21 Nov 2001 12:25:55 +0000 Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 3.13 #1) id 166WRv-0005VM-00; Wed, 21 Nov 2001 12:25:55 +0000 Date: Wed, 21 Nov 2001 12:25:55 +0000 From: Patrick Welche To: Joe Conway Cc: pgsql-interfaces@postgresql.org Subject: Re: [PATCHES] PQescapeBytea documentation patch Message-ID: <20011121122555.B21102@quartz.newn.cam.ac.uk> References: <3BFABB2C.3020307@home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3BFABB2C.3020307@home.com> User-Agent: Mutt/1.3.19i X-Archive-Number: 200111/52 X-Sequence-Number: 2112 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 ... + PQescapeBytea + Escapes a binary string (bytea type) for use within an SQL query. + + 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