Re: Can you help me with this query?
От | mike.griffin@mygenerationsoftware.com |
---|---|
Тема | Re: Can you help me with this query? |
Дата | |
Msg-id | 3452.4.160.99.214.1087522382.squirrel@4.160.99.214 обсуждение исходный текст |
Ответ на | Re: Can you help me with this query? ("Nick Barr" <nicky@chuckie.co.uk>) |
Список | pgsql-general |
That doesn't complile, I don't think you can use a nested select where a column goes? I get an error yelping about one of the select statements, did you test it out? I'm using pgAdmin and don't think that it is the problem? > How about: > > SELECT cl.relname as TABLE_NAME, > cr.relname as FK_TABLE_NAME, > (select array(select attname from pg_attribute > where attrelid = ct.conrelid > and attnum = any (ct.conkey))) AS TBL_ATTS, > (select array(select attname from pg_attribute > where attrelid = ct.confrelid > and attnum = any (ct.confkey))) AS FK_TBL_ATTS > FROM pg_constraint ct > JOIN pg_class cl ON cl.oid=conrelid > JOIN pg_namespace nl ON nl.oid=cl.relnamespace > JOIN pg_class cr ON cr.oid=confrelid > JOIN pg_namespace nr ON nr.oid=cr.relnamespace > LEFT OUTER JOIN pg_description des ON des.objoid=ct.oid > WHERE contype='f'; > > Note the function is no longer there ;-) > > Nick > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match >
В списке pgsql-general по дате отправления: