Re: Anyone working on pg_dump dependency ordering?

Поиск
Список
Период
Сортировка
От prinsarian@zonnet.nl (Arian Prins)
Тема Re: Anyone working on pg_dump dependency ordering?
Дата
Msg-id 254336a1.0311250039.4ae8803a@posting.google.com
обсуждение исходный текст
Ответ на Anyone working on pg_dump dependency ordering?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
chriskl@familyhealth.com.au (Christopher Kings-Lynne) wrote in message news:<3FBEC8D3.3040807@familyhealth.com.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.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: ALTER COLUMN/logical column position
Следующее
От: "Tom Hebbron"
Дата:
Сообщение: Re: Handy user/group hack