[EMAIL PROTECTED] (Christopher Kings-Lynne) wrote in message news:<[EMAIL PROTECTED]>... > 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. ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster