Re: how do i store \0 inside a text attribute?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul A Vixie <vixie(at)mfnx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: how do i store \0 inside a text attribute?
Date: 2000-12-29 23:59:49
Message-ID: 10209.978134389@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Paul A Vixie <vixie(at)mfnx(dot)net> writes:
> this is not what i was hoping for at ALL. evidently the implementation of
> text assumes NUL-termination in other places than the parser.

Yes. The entire datatype I/O system is based on null-terminated
strings, so there's no easy way to fix this. If it were just an
internal problem then maybe we'd bite the bullet and do it, but
breaking every user-defined datatype in existence seems too high
a price to pay for this problem.

> ultimately
> this means that pgsql will need a "blob" type whose presentation format is
> uuencode or some such.

See bytea, though its presentation format leaves something to be desired
IMHO.

> how would someone be expected to store, say, a GIF image in a TOAST text?

One would not. A TOASTed bytea is the appropriate column type.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-12-30 00:08:18 Re: GNU readline and BSD license
Previous Message Alfred Perlstein 2000-12-29 23:51:41 Re: GNU readline and BSD license