Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-31 Thread Gavin Flower
On 31/07/11 21:36, Alban Hertroys wrote: On 30 Jul 2011, at 13:49, Gavin Flower wrote: On 30/07/11 10:45, bricklen wrote: [...] CREATE OR REPLACE VIEW table_dependencies AS ( WITH RECURSIVE t AS ( SELECT c.oid AS origin_id, c.oid::regclass::text AS origin_table,

Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-31 Thread Gavin Flower
On 31/07/11 21:42, Alban Hertroys wrote: On 30 Jul 2011, at 12:17, Gavin Flower wrote: CREATE OR REPLACE VIEW table_dependencies AS ( WITH RECURSIVE t AS ( SELECT c.oid AS origin_id, c.oid::regclass::text AS origin_table, c.oid AS referencing_id, c.oid::

Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-31 Thread Alban Hertroys
On 30 Jul 2011, at 12:17, Gavin Flower wrote: >> CREATE OR REPLACE VIEW table_dependencies AS ( >> WITH RECURSIVE t AS ( >> SELECT >> c.oid AS origin_id, >> c.oid::regclass::text AS origin_table, >> c.oid AS referencing_id, >> c.oid::regclass::text AS referencin

Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-31 Thread Alban Hertroys
On 30 Jul 2011, at 13:49, Gavin Flower wrote: > On 30/07/11 10:45, bricklen wrote: >> [...] >> CREATE OR REPLACE VIEW table_dependencies AS ( >> WITH RECURSIVE t AS ( >> SELECT >> c.oid AS origin_id, >> c.oid::regclass::text AS origin_table, >> c.oid AS referencing_id,

Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-30 Thread Gavin Flower
On 30/07/11 10:45, bricklen wrote: A coworker of mine* was looking for a way to quickly and easily be able to tell which tables were referencing particular table(s) she wanted to load (for unit testing). Using the examples from David Fetter**, she submitted a revised version that seems to work qu

Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-30 Thread Gavin Flower
On 30/07/11 10:45, bricklen wrote: A coworker of mine* was looking for a way to quickly and easily be able to tell which tables were referencing particular table(s) she wanted to load (for unit testing). Using the examples from David Fetter**, she submitted a revised version that seems to work qu

Re: [GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-30 Thread Gavin Flower
On 30/07/11 10:45, bricklen wrote: [...] CREATE OR REPLACE VIEW table_dependencies AS ( WITH RECURSIVE t AS ( SELECT c.oid AS origin_id, c.oid::regclass::text AS origin_table, c.oid AS referencing_id, c.oid::regclass::text AS referencing_table, c2

[GENERAL] Finding referecing and referenced tables, adaptation from David Fetter's solution

2011-07-29 Thread bricklen
A coworker of mine* was looking for a way to quickly and easily be able to tell which tables were referencing particular table(s) she wanted to load (for unit testing). Using the examples from David Fetter**, she submitted a revised version that seems to work quite well. With her permission, I have