pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad <sad@bankir.ru>
To: psql <pgsql-sql@postgresql.org>
Subject: unescaped output of bytea
Date: Thu, 30 Oct 2003 09:31:54 +0000
Message-ID: <200310300931.54585.sad@bankir.ru> (raw)

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.






Message-ID: <200310300931.54585.sad@bankir.ru>
Permalink:  ../200310300931.54585.sad@bankir.ru/
Also on:    postgresql.org/message-id/200310300931.54585.sad@bankir.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru
  Subject: Re: unescaped output of bytea
  In-Reply-To: <200310300931.54585.sad@bankir.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox