Re: Why do we let CREATE DATABASE reassign encoding?
От | Heikki Linnakangas |
---|---|
Тема | Re: Why do we let CREATE DATABASE reassign encoding? |
Дата | |
Msg-id | 49F0B95C.20005@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: Why do we let CREATE DATABASE reassign encoding? (Bill Moran <wmoran@potentialtech.com>) |
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: