Tom Lane wrote:
... >In fact, I was about to point out that the query you were describing >couldn't possibly give you a reliable
answer,quite independent of >whether the backend is implementing it properly or not.
I think this will do the job; can you please check it out:
select rcname,rcsrc from pg_relcheck, pg_inherits as i where rcrelid = '%s'::oid
and (not exists -- for (select * from
pg_inherits -- non-inherited where inhrel = pg_relcheck.rcrelid) -- tables
or (not exists -- (select * from pg_relcheck as c --
for where c.rcname = pg_relcheck.rcname -- inherited and c.rcrelid =
i.inhparent) -- tables and rcrelid = i.inhrel)); --
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key
ID32B8FAA1 ======================================== "Jesus saith unto him, I am the way, the truth,
andthe life; no man cometh unto the Father, but by me." John 14:6