Re: [SQL] Related tables to a view

2006-12-26 Thread Jim Buttafuoco
Try this query select a.relname as base,a.relkind from pg_class a join pg_depend d on (a.oid = d.refobjid) join pg_class c on (d.classid = c.oid) join pg_rewrite r on (objid = r.oid) join pg_class v on (ev_class = v.oid) where a.relkind in('r', 'v') and a.relname <> v.relname and v.relname='YOUR

Re: [SQL] Related tables to a view

2006-12-26 Thread Jan Meyland Andersen
> You could query pg_depend to find out which tables and columns the > view's rewrite rule depends on but that's not as specific as what > you're requesting. I'm not aware of a way to associate a particular > table column with a particular view column short of parsing the view > definition or rule

Re: [SQL] Related tables to a view

2006-12-26 Thread Jan Andersen
> You could query pg_depend to find out which tables and columns the > view's rewrite rule depends on but that's not as specific as what > you're requesting. I'm not aware of a way to associate a particular > table column with a particular view column short of parsing the view > definition or