Joins between int and int[]

Поиск
Список
Период
Сортировка
От Rodrigo Sakai
Тема Joins between int and int[]
Дата
Msg-id 000a01c699f2$4796d340$4700a8c0@TREEZANTHUS
обсуждение исходный текст
Список 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!!! 

 

В списке pgsql-sql по дате отправления:

Предыдущее
От: Joe
Дата:
Сообщение: Re: Fwd: Start up question about triggers
Следующее
От: Kyle Bateman
Дата:
Сообщение: Schema management tool