pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedVariable Length Binary String (not large)
3+ messages / 3 participants
[nested] [flat]
* Variable Length Binary String (not large)
@ 2001-12-07 21:14 Jonathan Nichols <jnichols@traxsis.com>
0 siblings, 1 reply; 3+ messages in thread
From: jnichols@traxsis.com @ 2001-12-07 21:14 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Variable Length Binary String (not large)
@ 2001-12-12 11:53 Haller Christoph <ch@rodos.fzk.de>
parent: Jonathan Nichols <jnichols@traxsis.com>
0 siblings, 1 reply; 3+ messages in thread
From: Haller Christoph @ 2001-12-12 11:53 UTC (permalink / raw)
To: jnichols@traxsis.com; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Variable Length Binary String (not large)
@ 2001-12-12 17:40 Jason Earl <jason.earl@simplot.com>
parent: Haller Christoph <ch@rodos.fzk.de>
0 siblings, 0 replies; 3+ messages in thread
From: Jason Earl @ 2001-12-12 17:40 UTC (permalink / raw)
To: Haller Christoph <ch@rodos.fzk.de>; +Cc: jnichols@traxsis.com; pgsql-sql
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 <ch@rodos.fzk.de> 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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-12-12 17:40 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-12-07 21:14 Variable Length Binary String (not large) Jonathan Nichols <jnichols@traxsis.com>
2001-12-12 11:53 ` Haller Christoph <ch@rodos.fzk.de>
2001-12-12 17:40 ` Jason Earl <jason.earl@simplot.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox