Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fA1GMtP55211 for ; Thu, 1 Nov 2001 11:22:55 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id DE55AD5D9; Thu, 1 Nov 2001 08:22:51 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id D3FAE5BD9; Thu, 1 Nov 2001 08:22:51 -0800 (PST) Date: Thu, 1 Nov 2001 08:22:51 -0800 (PST) From: Stephan Szabo To: Radu-Adrian Popescu Cc: , Subject: Re: How to use BYTEA type? In-Reply-To: <3BE120D1.3060406@www.aldratech.com> Message-ID: <20011101081044.G22509-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200111/14 X-Sequence-Number: 5400 On Thu, 1 Nov 2001, Radu-Adrian Popescu wrote: > Doing > > template1=> SELECT proname from pg_proc ; > proname > ------------------------ > boolin > boolout > byteain > byteaout > > you can see there is a byteaout function also. However, these are > undocumented in the interactive docs, which is a shame indeed. I only > learned of byteain/out after reading your email. > > If some of the postgresql guys could point the location of the > documentation of undocumented functions :-) that'd be great. AFAIK, the in and out functions are *not* meant to be called by users. They're used by the system and I think they technically take pointer values. To use bytea correctly, I believe you are supposed to do some escaping and place the value into the insert statement. insert into table values ('\011\005\\000afkajdd\011'); (note the double backslash on the null byte). And you should get the value back from a straight select on the column I believe.