unescaped output of bytea

From: sad <sad(at)bankir(dot)ru>
To: "psql" <pgsql-sql(at)postgresql(dot)org>
Subject: unescaped output of bytea
Date: 2003-10-30 09:31:54
Message-ID: 200310300931.54585.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Good day Guru

I thought on output to input relation in general.

Manual says about scalar types that input and output functions should be
inverse to each other, because of dump problems (if output function prints
a value not in a format that input function waiting for)

That's the geat problem i thought. If so then an external representation
could not be deffer of SQL-constant representation (clear?)
Very common problem it is.
Most fields in this case should be manually (application level) transformed
both directions.

Then I try the experiment with text constant and text field dump:

INSERT INTO ttt values ('a\\b\'c''');
SELECT * FROM ttt;
fff
--------
a\b'c'

I see the output not inverse to the input.
then I DUMP the table ttt and see into the dump file:

INSERT INTO ttt VALUES ('a\\b\'c''');

THAT'S IT !!! Dump DIFFERS to plain output !
the same result with escaping apostroph we could see in bytea type.

this GOOD, VERY GOOD fact allows us to have unescaped output of bytea
without problems with a dump.

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2003-10-30 10:26:17 Re: Using UNION inside a cursor
Previous Message Kumar 2003-10-30 08:53:48 Using UNION inside a cursor