Received: from femail35.sdc1.sfba.home.com (femail35.sdc1.sfba.home.com [24.254.60.25]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fALH4Vm47099 for ; Wed, 21 Nov 2001 12:04:31 -0500 (EST) (envelope-from joseph.conway@home.com) Received: from home.com ([24.0.42.111]) by femail35.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20011121170431.GGAK22926.femail35.sdc1.sfba.home.com@home.com>; Wed, 21 Nov 2001 09:04:31 -0800 Message-ID: <3BFBDEA9.3070703@home.com> Date: Wed, 21 Nov 2001 09:04:41 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6) Gecko/20011116 X-Accept-Language: en-us MIME-Version: 1.0 To: Patrick Welche CC: pgsql-interfaces@postgresql.org Subject: Re: [PATCHES] PQescapeBytea documentation patch References: <3BFABB2C.3020307@home.com> <20011121122555.B21102@quartz.newn.cam.ac.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200111/53 X-Sequence-Number: 2113 Patrick Welche wrote: > 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)) I thought about that, but did not write it for a couple of reasons: First, there wasn't a strong consensus that this type of function belonged as part of libpq in the first place, so I didn't want to push my luck ;-) Second, at least in my current work, I'm using binary cursors, in which case no unescaping is necessary. I do agree that a standard bytea unescape function should be available in the client library somewhere. Maybe for 7.3 . . . Joe