Re: Can you help me with this query? - Mailing list pgsql-general

From mike.griffin@mygenerationsoftware.com
Subject Re: Can you help me with this query?
Date
Msg-id 3452.4.160.99.214.1087522382.squirrel@4.160.99.214
Whole thread Raw
In response to Re: Can you help me with this query?  ("Nick Barr" <nicky@chuckie.co.uk>)
List 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 by date:

Previous
From: Doug McNaught
Date:
Subject: Re: 7.4 windows version?
Next
From: Carl Anderson
Date:
Subject: Re: Postgres "invalid page header"