Re: - Mailing list pgsql-sql

From silly sad
Subject Re:
Date
Msg-id 4C3177B8.3080803@bankir.ru
Whole thread Raw
In response to How to store Byte strings into a table.  (Trinath Somanchi <trinath.somanchi@gmail.com>)
Responses Re:  (Trinath Somanchi <trinath.somanchi@gmail.com>)
List pgsql-sql
On 07/05/10 09:57,  wrote:
> Hi,
>
> How can I store Byte strings into a postgresql database.
> Is there any special command to store it. How will be the sql query.

there is only '\0' byte incapable to input-output.
so u have to have it escaped at all costs _AND NOTHING MORE_.

"escaped" doesn't mean "prefixed with backslash"
("backslash method" cause a zero-byte to pass SQL parser an to be 
actually stored, BUT
the output will be corrupted, because of this zero-byte will be actually 
output)

You may use the BYTEA type
(similar to the TEXT but with different input-output) which effectively 
escapes zero-byte and a lot of other completely harmless bytes as well 
(probably to reach a better overhead)

Or you may introduce a pair of your own escape rules.

Unfortunately there are no way to influence The Pg Developers to get rid 
of the nasty god damned CSTRING off the input/output operations.



pgsql-sql by date:

Previous
From: Trinath Somanchi
Date:
Subject: How to store Byte strings into a table.
Next
From: Trinath Somanchi
Date:
Subject: Re: