Re: [GENERAL] View parsing

2012-07-04 Thread Bartosz Dmytrak
Hi, how about this one? SELECT n.nspname, c.relname, a.attname FROM pg_depend d INNER JOIN pg_class c ON (c.oid = refobjid) INNER JOIN pg_attribute a ON (c.oid = a.attrelid AND d.refobjsubid = a.attnum) INNER JOIN pg_namespace n ON (c.relnamespace = n.oid) INNER JOIN pg_rewrite rw ON

[GENERAL] View parsing

2012-06-20 Thread Dr. F. Lee
Hi all, I would like to be able to determine which tables each field of a view comes from. I have a view definition like SELECT tbl_a.fld_a, tbl_b.fld_b AS fld_e, function(c,d,f) as fld_c, (SELECT fld_d FROM tbl_d WHERE tbl_d.fld_e=tbl_a.fld_a) as fld_d FROM tbl_a inner join tbl_b on tbl_a.