public inbox for [email protected]  
help / color / mirror / Atom feed
From: Kim Heckler <[email protected]>
To: [email protected] <[email protected]>
Subject: Database copy
Date: Thu, 3 Jun 2021 17:01:16 +0000
Message-ID: <CH2PR07MB72696EB34DE5AD6EA3B1041D863C9@CH2PR07MB7269.namprd07.prod.outlook.com> (raw)

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<https://www.postgresql.org/docs/12/manage-ag-templatedbs.html; 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.




view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Database copy
  In-Reply-To: <CH2PR07MB72696EB34DE5AD6EA3B1041D863C9@CH2PR07MB7269.namprd07.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox