Quick notes about PostgreSQL; tags=Programmieren, DBs, PostgreSQL
Imagine you have a old postgresql database. Further imagine it has it's encoding set to something like LATIN-1 but some PHP web application has put in UTF-8 strings. Now what would you do if you have some python application actually respecting the encoding and recoding the db content from latin-1 to UTF-8 giving you garbage. Seems you can easily trick postgresql to now believe it is UTF-8:
UPDATE pg_database SET encoding = 6 WHERE datname = 'foo';
For a summary of these magic numbers the PostgreSQL Manual is usefull.
-- Christoph Egger <firstname.lastname@example.org> Tue, 17 May 2011 10:30:22 +0200