Re: Unhappy thoughts about pg_dump and objects inherited from template1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Jan Wieck <janwieck(at)Yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unhappy thoughts about pg_dump and objects inherited from template1
Date: 2000-11-08 16:13:46
Message-ID: 26805.973700026@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> It would be nice to have a 'supported' COPY DATABASE (which is what we're
> talking about, really), so I'd vote for being able to use any DB as a
> template, if possible.

> Can we restrict the command to databases that have only one active backend?

No active backends would be more like it. The problem here is that
there's a race condition much like the one for DROP DATABASE --- there
may be no one connected when you look, but that's no guarantee someone
can't connect right after you look.

We're already overdue for beta, so I really don't want to start
designing/implementing a generalized COPY DATABASE. (We're not
officially in feature freeze yet, but inventing new features off the
top of our heads doesn't seem like the thing to be doing now.)
I'd like to see a proper fix for the inherited-data problem, though,
since that's clearly a bug in an existing feature.

> Or add an 'istemplate' flag set in pg_database? I don't really like relying
> on specific name formats, if we can avoid it.

That's reasonable I guess.

Do we still need the lastsysoid column in pg_database if we do things
this way? Seems like what you really want is to suppress all the
objects that are in template0, so you really only need one lastsysoid
value, namely template0's. The other entries are useless AFAICS.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2000-11-08 16:24:05 Re: Unhappy thoughts about pg_dump and objects inherited from template1
Previous Message Ross J. Reedstrom 2000-11-08 16:11:17 Re: Unhappy thoughts about pg_dump and objects inherited from template1