Re: psycopg2+postgres check default charset of db or table - Mailing list psycopg

From Joe Abbate
Subject Re: psycopg2+postgres check default charset of db or table
Date
Msg-id 4F8F5C8D.3050303@freedomcircle.com
Whole thread Raw
In response to psycopg2+postgres check default charset of db or table  (Peter Irbizon <peterirbizon@gmail.com>)
List psycopg
On 04/18/2012 08:12 PM, Peter Irbizon wrote:
> I am using python 2.7 and psycopg2. How could I find out default charset
> used by database? I would like to check it and then according to used
> charset decode returned strings.
>
> I tried "select rdb$character_set_name from rdb$database" but it
> seems it doesn't work for postgres. thank you

"SHOW server_encoding" will show the character encoding after you
connect.  "SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE
datname = %(dbname)s" can be used to find out the encoding before
connecting (connecting to the postgres db instead).

Joe

psycopg by date:

Previous
From: Peter Irbizon
Date:
Subject: psycopg2+postgres check default charset of db or table
Next
From: Russ Neufeld
Date:
Subject: Strange slowness