Re: Can you help me with this query?

From: mike(dot)griffin(at)mygenerationsoftware(dot)com
To: "Nick Barr" <nicky(at)chuckie(dot)co(dot)uk>
Cc: "Brendan Jurd" <blakjak(at)blakjak(dot)sytes(dot)net>, mike(dot)griffin(at)mygenerationsoftware(dot)com, "PostgreSQL-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can you help me with this query?
Date: 2004-06-18 01:33:02
Message-ID: 3452.4.160.99.214.1087522382.squirrel@4.160.99.214
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carl Anderson 2004-06-18 02:01:56 Re: Postgres "invalid page header"
Previous Message Doug McNaught 2004-06-18 01:16:59 Re: 7.4 windows version?