Re: Database copy

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Database copy
Дата
Msg-id 20210603173202.GB22019@momjian.us
обсуждение исходный текст
Ответ на Database copy  (Kim Heckler <kim.heckler@nationwide.com>)
Список pgsql-novice
On Thu, Jun  3, 2021 at 05:01:16PM +0000, Kim Heckler wrote:
> 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.

Yes, you can use it as long as you accept its limitations of locking. 
It is used all the time.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.




В списке pgsql-novice по дате отправления:

Предыдущее
От: Kim Heckler
Дата:
Сообщение: Database copy
Следующее
От: Jonas Gassenmeyer
Дата:
Сообщение: NOW() function in combination with SET timezone