Re: Unhappy thoughts about pg_dump and objects inherited from template1 - Mailing list pgsql-hackers

From selkovjr@mcs.anl.gov
Subject Re: Unhappy thoughts about pg_dump and objects inherited from template1
Date
Msg-id 200011100459.WAA16948@selkovjr.xnet.com
Whole thread Raw
In response to Re: Unhappy thoughts about pg_dump and objects inherited from template1  (Jan Wieck <janwieck@Yahoo.com>)
List pgsql-hackers
Jan Wieck wrote:
> Tom Lane wrote:
> > Philip Warner <pjw@rhyme.com.au> writes:
> > > Where would you store the value if not in pg_database?
> >
> > No other ideas at the moment.  I was just wondering whether there was any
> > way to delete it entirely, but seems like we want to have the value for
> > template0 available.  The old way of hardwiring knowledge into pg_dump
> > was definitely not as good.
> 
>     To  make  pg_dump  failsafe,  we'd  IMHO  need  to freeze all
>     objects that come with template0 copying.

Here's another (somewhat) unhappy thought: what if there are objects
in template1 or other databases that one doesn't want to dump or
restore?

This is very much the case for user-defined types that usually consist
of multiple dozens of components. Currently, pg_dump picks them up
based on their oid, whether or not they are sitting in template1, and
dumps them in a non-restorable and non-portable manner along with the
user data. Consequently, I have to write filters to pluck the type
code out from the dump. The filters are ugly, unreliable and have to
be maintained in sync with the types. 

Picture this, though: if int and float where user-defined types --
would anyone be happy seeing them in every dump? Or, even worse,
responding to "object already exists" kind of problems during restore?

Not that I couldn't get by like this; but since everybody seems
unhappy too, maybe it's a good moment to consider a special 'dump'
attribute for every object in the schema? The attribute could be
looked at by dump and restore tools and set by whatever rules one may
find appropriate.

--Gene


pgsql-hackers by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: 7.0.2 dies when connection dropped mid-transaction
Next
From: selkovjr@mcs.anl.gov
Date:
Subject: Re: Unhappy thoughts about pg_dump and objects inherited from template1