>
> The only issue I find with your SQL is it relies on "(a.attnum = x.conkey[1] or
> a.attnum = x.conkey[2])" which assumes
there is two columns forming the primary key of a table. Perhaps, I should explain
what I'm trying to achieve with this
SQL.
>
Not exactly. Look at this
CREATE TABLE fil
Thanks alot, you are right with the table and the -E option. It's very useful.
The only issue I find with your SQL is it relies on "(a.attnum = x.conkey[1] or
a.attnum = x.conkey[2])" which assumes there is two columns forming the primary key of
a table. Perhaps, I should explain what I'm tryi
>
> Thanks for the reply but my main problem is I'm trying to find the primary column(s)
> and the data type of these column in a table. pg_constraint's conkey is a int2[]
> field. So if i have a table called 'films' (taken from postgreSQL doc) that has two
> primary keys (composite primary key
>
> Hi,
>
> I need to query each column's constraint and name of a table in
> postgreSQL v7.3.4 with a single SQL query but don't know how. Would
> appreciate any pointers!
>
> Thank you.
>
> Regards,
> Damon
>
select relname,conname
from pg_constraint,pg_class
where pg_class.oid=conrelid ;
Hi,
I need to query each column's constraint and name of a table in
postgreSQL v7.3.4 with a single SQL query but don't know how. Would
appreciate any pointers!
Thank you.
Regards,
Damon
---(end of broadcast)---
TIP 8: explain analyze is your frie