Bill Moran wrote:
> In response to Tom Lane <tgl@sss.pgh.pa.us>:
>> We should presumably let the encoding be changed when cloning
>> from template0, and probably it's reasonable to trust the user
>> if either source or destination DB encoding is SQL_ASCII.
>> In other cases I'm thinking it should fail.
>
> On a pedantic level, doesn't this remove the ability to have
> databases on a single cluster that are different encodings? I mean,
> if template1 is utf8, and I can't change that using CREATE
> DATABASE, then I'm stuck with utf8 for all databases on that
> cluster ... unless I'm missing something.
You could still use template0 as template for a database with any
encoding, like:
CREATE DATABASE .. TEMPLATE = template0;
We can special case template0 because we know its contents are pure
7-bit ascii which is compatible with any server encoding.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com