Re: XML ouput for psql - Mailing list pgsql-patches

From greg@turnstep.com
Subject Re: XML ouput for psql
Date
Msg-id 46711493226014f089f877e49c2bd438@biglumber.com
Whole thread Raw
In response to Re: XML ouput for psql  (Hannu Krosing <hannu@tm.ee>)
List pgsql-patches
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hannu Krosing wrote:
> I think you should force conversion to something standard, try using
> automatic conversion to some known client encoding.

I've thought about this some more, and the only thing I can think
about doing without being too heavy-handed is to change the encoding
to "US-ASCII" whenever someone enters "XML" mode if the encoding is set
to "SQL-ASCII". Perhaps with a warning.

"The character set most commonly use in the Internet and used especially in
protocol standards is US-ASCII, this is strongly encouraged."
http://www.iana.org/assignments/character-sets

On the other hand, SQLX seems to lean toward a strict unicode encoding
(see my reply to Peter Eisentraut for more on that).

> Run "select oid,typname from pg_type;" first if run in xml mode and
> store the oid/columnname pairs.

I realize that I could run a SQL query against pg_type to grab the info,
but I was hoping there was an internal function similar to PQtype which
would return the information.

> you could also store the result in ~/.psql for faster access
> later on and manually clear it if new types are defined

Not only does pg_type has literally hundreds of entries, but there is no
way to guarantee that these are correct at the time when the query is
run, so I don't think this is viable.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200302280938
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+X3hCvJuQZxSWSsgRArMTAKChouxnFF1ugI1mutXYJf14p1ICGwCfUDG9
yISxrIvqxnYWHfvD0lOWZAQ=
=M6nd
-----END PGP SIGNATURE-----




pgsql-patches by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: improve table dumping
Next
From: greg@turnstep.com
Date:
Subject: Re: XML ouput for psql