Joins between int and int[]

From: "Rodrigo Sakai" <rodrigo(dot)sakai(at)zanthus(dot)com(dot)br>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Joins between int and int[]
Date: 2006-06-27 14:02:06
Message-ID: 000a01c699f2$4796d340$4700a8c0@TREEZANTHUS
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I want to use the system catalog tables/views to query some things, and
one of the queries I have to do is joining pg_attribute and pg_constraint to
know what constraint belongs to which table.attribute. My question is how
can I write the join clause between a int (pg_attribute.attnum) and int[ ]
(pg_constraint.conkey).

The query is:

select relname, attname, attnotnull, atthasdef

from pg_class as pc

inner join pg_attribute as pa

on pc.oid=pa.attrelid

inner join pg_constraint pcons

on pc.oid=pcons.conrelid

and pa.attnum = pcons.conkey -------> the problem

Thanks!!!

Browse pgsql-sql by date

  From Date Subject
Next Message Kyle Bateman 2006-06-27 15:22:15 Schema management tool
Previous Message Joe 2006-06-27 12:14:34 Re: Fwd: Start up question about triggers