Re: Anyone working on pg_dump dependency ordering?

From: prinsarian(at)zonnet(dot)nl (Arian Prins)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Anyone working on pg_dump dependency ordering?
Date: 2003-11-25 08:39:10
Message-ID: 254336a1.0311250039.4ae8803a@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

chriskl(at)familyhealth(dot)com(dot)au (Christopher Kings-Lynne) wrote in message news:<3FBEC8D3(dot)3040807(at)familyhealth(dot)com(dot)au>...
> Lastly, I presume it's possible to create a system of circular
> dependencies (eg create or replace view), which really cannot be solved
> without a system of 'shells', similar to that needed to dump types and
> their i/o functions.
>
> Views seem to be by far the nastiest object. They can be dependent on
> almost everything in the database.

Hello Group,

It might be an idea to keep track of all data-definition changes
during the lifetime of a database. Keep all the
SQL-definition-commands in a seperate systemtable somewhere. Then,
when the schema is dumped you'd have the choice of dumping:
- the most recent schema with database-determined ordering (as is the
case in the current situation)
- "replay" the "recorded" datadefinition of the past, so you know the
data definition is executed in a "sound" sequence.

Of course, data itself would be extracted seperate of the definitions
and there would also be the need to remove constrains while the data
is being loaded. This last thing could be done by parsing the
"recorded" data-definition-commands or by first blindly running the
"recorded" commands, then removing (or disabling) any constraints that
are there and finally replacing (or re-enabling) the constraints.

Negative side of this idea is obviously that you need to make changes
to a lot of internals of the postgresql database. AND you need to make
perfectly sure that the state of the database is always consistent
with the state of the recorded SQL.

Good Luck,
Arian.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2003-11-25 09:21:28 Re: A rough roadmap for internationalization fixes
Previous Message Peter Eisentraut 2003-11-25 06:48:03 Re: Build farm