Re: [SQL] Looking up table names by REFERENCES

2005-01-25 Thread Michael Fuhr
On Tue, Jan 25, 2005 at 04:09:09AM +1300, Steve Castellotti wrote: > Surely there's a simple way I can trace REFERENCES in a particular > column across tables? The pg_constraint table contains foreign key constraints. Here's an example query that appears to work in trivial tests: SELECT c.c

[SQL] Looking up table names by REFERENCES

2005-01-25 Thread Steve Castellotti
    Hello all. I'm trying to write a recursive procedure to allow me to handle some data backup routines and deal with conflicts when restoring from within the program.     Essentially, what I'd like to be able to do is if a table called "image" has a column called "file_id" which references