Hi Guys,

I really need a solution to this one :(

What is the encoding of the database names in the pg_database table?  As far
as I can tell, each row is saved in the encoding of the database from which
it is created?  In my application, the actual names change from gobbledygook
to proper japanese or russian say, as I change the encoding of the page
through each database encoding.

How on earth can I display all the names at once?  Is it even possible?
What if I go:

SET CLIENT_ENCODING TO 'UNICODE';
SELECT * FROM pg_database;

That doesn't really seem to work that well though...

Chris


Mon, 2 Jun 2003 10:11:53 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
pg_database encoding again
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> What is the encoding of the database names in the pg_database table?  As far
> as I can tell, each row is saved in the encoding of the database from which
> it is created?

That sounds about right.  If you're using databases of different
encodings in the same installation, it would probably be wise to
restrict yourself to the intersection of those encodings when choosing
database names.

I agree that this isn't ideal, but I don't see any way to improve it.
If you like, we could put in code to *enforce* a restriction to 7-bit
ASCII in database names (and user and group names too) ... but that
doesn't seem like a big improvement.

			regards, tom lane

Mon, 02 Jun 2003 00:11:31 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: pg_database encoding again 
> That sounds about right.  If you're using databases of different
> encodings in the same installation, it would probably be wise to
> restrict yourself to the intersection of those encodings when choosing
> database names.

Bummer.  So there's no one encoding I can set it to :(  Actually, since the
phpPgAdmin interface only allows the creation of databases via the create
database screen, could we just always set it to the encoding of template1?

How do I get the encoding of the server?  Is that the same as the encoding
of template1?

> I agree that this isn't ideal, but I don't see any way to improve it.
> If you like, we could put in code to *enforce* a restriction to 7-bit
> ASCII in database names (and user and group names too) ... but that
> doesn't seem like a big improvement.

I would suggest force Unicode...

Chris


Mon, 2 Jun 2003 12:33:23 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: pg_database encoding again 
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> How do I get the encoding of the server?

There is none.  The per-database encodings are the only truth.
We aren't likely to institute one in future, either; the trend
seems to be more towards decentralization than the reverse.

> I would suggest force Unicode...

Seems quite unacceptable to those who aren't using Unicode.

			regards, tom lane

Mon, 02 Jun 2003 01:26:53 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: pg_database encoding again 