Database copy - Mailing list pgsql-novice

From Kim Heckler
Subject Database copy
Date
Msg-id CH2PR07MB72696EB34DE5AD6EA3B1041D863C9@CH2PR07MB7269.namprd07.prod.outlook.com
Whole thread Raw
Responses Re: Database copy  (Bruce Momjian <bruce@momjian.us>)
List pgsql-novice

All,

 

I have read in the CREATE DATABASE documentation:

 

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 22.3 for more information.

 

Can I safely use this on a regular basis to copy a database within the same instance/server?  If not, I’ll use pg_dump and pg_restore to complete the ask.

 

Thank you.

 

 

pgsql-novice by date:

Previous
From: Pól Ua Laoínecháin
Date:
Subject: Re: Scripting with subdirectories - how to specify script locations.
Next
From: Bruce Momjian
Date:
Subject: Re: Database copy