Re: pg_dump, pg_restore and template relationships

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark S <mark(at)gravitycollege(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_dump, pg_restore and template relationships
Date: 2008-02-18 01:35:17
Message-ID: 5107.1203298517@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Mark S <mark(at)gravitycollege(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2008-02-18 01:42:30 Re: Query Planner Issue - View and regexp_replace?
Previous Message Brandon Kane 2008-02-18 01:12:19 Re: Query Planner Issue - View and regexp_replace?