Re: Unhappy thoughts about pg_dump and objects inherited from template1

From: selkovjr(at)mcs(dot)anl(dot)gov
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unhappy thoughts about pg_dump and objects inherited from template1
Date: 2000-11-10 04:59:53
Message-ID: 200011100459.WAA16948@selkovjr.xnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck wrote:
> Tom Lane wrote:
> > Philip Warner <pjw(at)rhyme(dot)com(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message selkovjr 2000-11-10 05:23:38 Re: Unhappy thoughts about pg_dump and objects inherited from template1
Previous Message Alfred Perlstein 2000-11-10 04:54:26 Re: 7.0.2 dies when connection dropped mid-transaction