Re: Using TEXT columns for binary content

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Mircea Sarbu <msarbu(at)agora(dot)ro>, pgsql-general(at)postgresql(dot)org
Subject: Re: Using TEXT columns for binary content
Date: 2003-04-21 16:23:47
Message-ID: 774.1050942227@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Conway <mail(at)joeconway(dot)com> writes:
> 1) You have to encode to base64 on the way in (bytea has to be escaped
> on INSERT/UPDATE too)
> 2) You have to decode to binary on the way out (depending on your
> middleware, you can use a binary cursor for bytea and avoid the
> decode on SELECT)

Note that the 7.4 protocol should make it a lot easier to use bytea for
binary data without any escaping ... although some amount of client
reprogramming would be needed ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-04-21 16:34:15 Re: Using TEXT columns for binary content
Previous Message Tom Lane 2003-04-21 16:21:10 Re: stddev returns 0 when there is one row