Re: db encoding

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: db encoding
Date: 2003-10-06 19:42:27
Message-ID: 1065469347.4455.171.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

On Mon, 2003-10-06 at 19:30, Peter Eisentraut wrote:

> About pg_encoding. There is currently no way to tell whether an encoding
> exists. Normally you would put this kind of thing into a system table,
> but doing that is a bit tricky with the encodings. I would like to see
> pg_encoding go, so let's hear what information people need and give them a
> direct way to access it.

I currently use pg_encoding in Debian's automatic upgrade script to
extract the existing default encoding from pg_database, thus:

$ psql -q -t -d template1 -c "select encoding from pg_database where
datname = 'template1'"
0

and then I use it to translate that number into an encoding name that
can be fed to initdb.

However, on looking at this, I can see that I don't need it, since I can
just as well do

$ psql -l | grep template1 | awk '{print $5}'
SQL_ASCII

so as to achieve the same result with only a single command.

Therefore, you don't need to keep pg_encoding for my (the Debian
package's) sake.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Blessed is the man that walketh not in the counsel of
the ungodly, nor standeth in the way of sinners, nor
sitteth in the seat of the scornful. But his delight
is in the law of the LORD; and in his law doth he
meditate day and night." Psalms 1:1,2

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-10-06 19:51:59 Re: db encoding
Previous Message Gaetano Mendola 2003-10-06 19:17:18 Re: Open 7.4 items

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Andrew Dunstan 2003-10-06 19:51:59 Re: db encoding
Previous Message Andrew Dunstan 2003-10-06 19:05:53 Re: db encoding