Re: Change server encoding after the fact - Mailing list pgsql-general

From Tom Lane
Subject Re: Change server encoding after the fact
Date
Msg-id 11616.1317411203@sss.pgh.pa.us
Whole thread Raw
In response to Re: Change server encoding after the fact  (Cody Caughlan <toolbag@gmail.com>)
List pgsql-general
Cody Caughlan <toolbag@gmail.com> writes:
> Ok, I see what you mean. This would create a new DB with the proper
> encoding. Which is "fine", and probably what I will do. I guess I see an
> ideal scenario being one where we permanently convert the template encoding
> to UTF8 so going forward I dont have to worry about forgetting to adding the
> encoding= 'UTF8' for every new DB I create.

Well, if you're feeling brave you can mark template0 as having utf8
encoding via a manual update to pg_database.  In theory that should
be safe enough.  If you know template1 doesn't, and never has, contained
any non-ASCII data, you could do the same to it ... but it would be a
lot safer to drop it and recreate from template0.  See
http://wiki.postgresql.org/wiki/Adventures_in_PostgreSQL,_Episode_1
for some context.

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Change server encoding after the fact
Next
From: Cody Caughlan
Date:
Subject: Re: Change server encoding after the fact