BYTEA - Mailing list pgsql-general

From Timur V. Irmatov
Subject BYTEA
Date
Msg-id 778489427.20020920125707@sdf.lonestar.org
Whole thread Raw
Responses Re: BYTEA  (Jeff Davis <list-pgsql-general@empires.org>)
Re: BYTEA  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi, people!

I've used PostgreSQL for few months and it fully satisfies my needs.

Now I'm starting to explore BYTEA type (for storing small 1-5 Kb png
images) and found it very cumbersome.

I'd like to hear background explanation of why strings used as bytea
literals pass two phases of parsing? it seems very odd to me to escape
backslash two times (like that: '\\\\' ) just to insert it into
string.. It adds more complexity to apps, forcing it encode/decode
those literals..

I think it would be enough to quote it like any other string, just for
parser to understand it correctly, and insert into table. Bytea is
binary data by it's nature, why to quote it when I perform selects?
I'm not going to show it to humans, it is just data for my
application.

And if bytea really is displayed to a human then translating value into
readable form (quote non-printable characters etc.) is a task of the
application (psql, my app ..) but not PostgreSQL backend's.

Any comments?

Timur.


pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: missed features and unhappy changes when pg 7.1->7.2
Next
From: Jeff Davis
Date:
Subject: Re: BYTEA