Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: DBI:to sort tables according to their dependencies

by wrog (Friar)
on Dec 26, 2011 at 18:39 UTC ( #945120=note: print w/replies, xml ) Need Help??


in reply to Re: DBI:to sort tables according to their dependencies
in thread DBI:to sort tables according to their dependencies

As I understand it, pg_depend contains all links between all database objects (tables, columns, sequences, indexes, blobs, etc...); it gets used by the server to decide what all goes away when you do DROP TABLE/whatever. There may be Rather a Lot of Filtering to do to get it down to just foreign-key links between tables.

An alternative would be to start from the list of constraints in pg_constraint (link is for version 8.4; adjust accordingly if you're using some other version of postgresql)

  • Comment on Re^2: DBI:to sort tables according to their dependencies

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://945120]
help
Chatterbox?
[Discipulus]: uh uh.. scent of gods..
[Discipulus]: finally authors of Python to Perl answers will be borged, banned, fried and eaten .. ;=)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2018-06-22 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (122 votes). Check out past polls.

    Notices?