| From: | Matthew Chambers <mchambers(at)wetafx(dot)co(dot)nz> |
|---|---|
| To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: copying a large database to change encoding |
| Date: | 2014-10-14 17:43:23 |
| Message-ID: | 543D60BB.6080103@wetafx.co.nz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Thanks,
How long did it take to complete?
On 15/10/14 06:39, Adrian Klaver wrote:
> On 10/14/2014 10:31 AM, Matthew Chambers wrote:
>>
>> Would something like this work best, or is it better to use pgdump?
>>
>> CREATE DATABASE newDatabase TEMPLATE oldDatabase ENCODING 'UTF8'
>
> I actually just did that for a database.
>>
>> Does using a template do a file system copy or just SQL copy everything
>
> The caveats are noted here:
>
> http://www.postgresql.org/docs/9.3/interactive/sql-createdatabase.html
>
> "Although it is possible to copy a database other than template1 by
> specifying its name as the template, this is not (yet) intended as a
> general-purpose "COPY DATABASE" facility. The principal limitation is
> that no other sessions can be connected to the template database while
> it is being copied. CREATE DATABASE will fail if any other connection
> exists when it starts; otherwise, new connections to the template
> database are locked out until CREATE DATABASE completes. See Section
> 21.3 for more information
>
>> over?
>>
>> -Matt
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adrian Klaver | 2014-10-14 17:58:13 | Re: copying a large database to change encoding |
| Previous Message | Adrian Klaver | 2014-10-14 17:39:41 | Re: copying a large database to change encoding |