What is the encoding of the database names in pg_database???

I wish to display the names of all available database on a webpage, but
since each database name is encoded differently, it's not possible.  Is the
solution to go 'set client_encoding to 'utf8' and then do the SELECT?  Is
that smart enough to individually convert each name from each different
encoding?

Thanks,

Chris


Wed, 16 Apr 2003 09:33:36 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
encoding question
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> What is the encoding of the database names in pg_database???

I suspect we do not have a consistent answer to that :-( ... it
probably depends on which database you did CREATE DATABASE from ...

			regards, tom lane


Wed, 16 Apr 2003 02:11:17 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: encoding question 
Christopher Kings-Lynne writes:

> What is the encoding of the database names in pg_database???

If you think about this question too hard, the universe will collapse.

-- 
Peter Eisentraut   peter_e@gmx.net


Wed, 16 Apr 2003 19:41:08 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: encoding question
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > What is the encoding of the database names in pg_database???
> 
> I suspect we do not have a consistent answer to that :-( ... it
> probably depends on which database you did CREATE DATABASE from ...

Right. Usually encodings for global tables such as pg_database are
same as template1 unless you explicitly specify the template
database. Since PostgreSQL does not allow tables where each row is
encoded differently(even the standard does allow that), you should use
characters that are common among all possible encodings for such
global tables. This means you could only use ASCII for database
names. Same thing can be said for user names.
--
Tatsuo Ishii


Thu, 17 Apr 2003 10:20:48 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: encoding question 