Re: [HACKERS] Refactor handling of database attributes betweenpg_dump and pg_dumpall - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Refactor handling of database attributes betweenpg_dump and pg_dumpall
Date
Msg-id 20180121151748.GC10632@momjian.us
Whole thread Raw
In response to Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall
List pgsql-hackers
On Fri, Jan 19, 2018 at 02:54:25PM -0500, Tom Lane wrote:
> Hmm ... so there's a small problem with this idea of dropping and
> recreating template1:
> 
> pg_restore: connecting to database for restore
> pg_restore: dropping DATABASE template1
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 3024; 1262 1 DATABASE template1
>  postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  cannot drop a templ
> ate database
>     Command was: DROP DATABASE "template1";

Uh, the oid of the template1 database is 1, and I assume we would want
to preserve that too.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: WIP: Covering + unique indexes.
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall