Received: from charon.simplot.com (jrsmailhub.simplot.com [12.18.144.212]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBCHecm65403 for ; Wed, 12 Dec 2001 12:40:38 -0500 (EST) (envelope-from earlj@xanadu.simplot.com) Received: from xanadu.simplot.COM (151.113.0.132) by charon.simplot.com (MX V5.1-A AnGp) with SMTP; Wed, 12 Dec 2001 10:40:42 -0700 Received: from npa01zz001.simplot.com by xanadu.simplot.COM; (5.65v4.0/1.1.8.2/20Aug97-1116AM) id AA21413; Wed, 12 Dec 2001 10:40:41 -0700 Received: from earlj by npa01zz001.simplot.com with local (Exim 3.33 #1 (Debian)) id 16EDN1-0000bJ-00; Wed, 12 Dec 2001 10:40:40 -0700 To: Haller Christoph CC: jnichols@traxsis.com (Jonathan Nichols), pgsql-sql@postgresql.org Subject: Re: Variable Length Binary String (not large) References: <200112121053.LAA28581@rodos> From: Jason Earl Date: 12 Dec 2001 10:40:39 -0700 In-Reply-To: <200112121053.LAA28581@rodos> Message-ID: <877krsnxpk.fsf@npa01zz001.simplot.com> Lines: 43 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200112/124 X-Sequence-Number: 5947 Another option is to base64 encode your data and then insert into into a plain text field. I found that this was actually faster in Python than trying to use bytea and escaping the two or three characters that give bytea fits. On the other hand, if you are still in the development stages it probably is a good idea to be working with the 7.2 betas anyhow. The newer bytea solution is almost certainly better than my base64 kludge. Jason Haller Christoph writes: > Hi Jonathan, > The data type you're looking for is called 'bytea'. > It's poorly documented in 7.1x. > Also the set of functions supporting this type is small. > I've searched the mailing list for 'binary string' and found > it's planned to bring up a complete set of functions for > 'bytea' including the possibility to deal with '\000' bytes. > I'm afraid you'll have to wait until 7.2 is available. > Regards, Christoph > > > Hello, > > > > Can anyone recommend to me the best way to store a variable length > > binary string, that isn't larger than the 8192 byte limit for > > non-large objects?? It seems to me that using BLOBs might be overkill > > with too much complexity. However, there doesn't seem to be a binary > > string type in postgres that is meant for small binary strings. I > > have tried to use normal character strings, but it gets screwed up > > because of non-printable characters. Any suggestions?? > > > > thanks, > > > > jon > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly