Re: pg_dump, pg_restore and template relationships - Mailing list pgsql-novice

From Tom Lane
Subject Re: pg_dump, pg_restore and template relationships
Date
Msg-id 5107.1203298517@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump, pg_restore and template relationships  (Mark S <mark@gravitycollege.com>)
List pgsql-novice
Mark S <mark@gravitycollege.com> writes:
> According to the PostgreSQL docs, changes made
> to a template will be effected on databases created from that
> template. I'm curious how, if at all, this relationship is maintained
> through a pg_dump and pg_restore?

It isn't.  CREATE DATABASE merely copies the source database as it stands
at that instant, there's no persistent relationship.

If you like you can create the target database by hand, using the new
template database, before restoring into it; but what is likely to
happen is that you get a lot of 'duplicate object' errors from objects
that were in the dump due to having been copied from the previous
incarnation of the template.  Sometimes this is okay, but you'll want to
scan through the messages and make sure nothing undesirable happened.

            regards, tom lane

pgsql-novice by date:

Previous
From: Brandon Kane
Date:
Subject: Re: Query Planner Issue - View and regexp_replace?
Next
From: Tom Lane
Date:
Subject: Re: Query Planner Issue - View and regexp_replace?