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                                [EMAIL PROTECTED]
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 


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to