Re: copying a large database to change encoding - Mailing list pgsql-general

From Albe Laurenz
Subject Re: copying a large database to change encoding
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D7469C@ntex2010a.host.magwien.gv.at
Whole thread Raw
In response to copying a large database to change encoding  (Matthew Chambers <mchambers@wetafx.co.nz>)
List pgsql-general
Matthew Chambers wrote:
> Would something like this work best, or is it better to use pgdump?
> 
> CREATE DATABASE newDatabase TEMPLATE oldDatabase ENCODING 'UTF8'
> 
> Does using a template  do a file system copy or just SQL copy everything over?

Using the old database as template will not change the encoding,
so I think that will not work at all.

The documentation says:
  The encoding and locale settings must match those of the template database,
  except when template0 is used as template.

Did you try it?

I think you will have to dump/restore.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Abelard Hoffman
Date:
Subject: Will pg_repack improve this query performance?
Next
From: Alban Hertroys
Date:
Subject: Re: Will pg_repack improve this query performance?