Re: [GENERAL]

Поиск
Список
Период
Сортировка
От Igor Korot
Тема Re: [GENERAL]
Дата
Msg-id CA+FnnTxLvGm-SwG6gdQXF1isPVmJ4rXL4SKnzLjmCN=Rea2=_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL]  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: [GENERAL]
Список pgsql-general
David,

On Sun, May 7, 2017 at 8:57 AM, David Rowley
<david.rowley@2ndquadrant.com> wrote:
> On 8 May 2017 at 00:42, Igor Korot <ikorot01@gmail.com> wrote:
>> Basically what I'd like to see is the definition of each column and
>> whether this column is
>> part of primary/foreign key or not.
>
> information_schema.table_constraints is of no use to you then. There
> are no details about which column(s) the constraint applies to.
>
> Likely you'll want to look at pg_constraint for contype in('p','f')
> and unnest(conkey) and join that to information_schema.columns. You
> may also need to think about pg_constraint.confkey, depending on if
> you want to know if the column is referencing or referenced in a
> foreign key constraint.

I checked pg_constraint view, but I didn't see anything to join to.
I do see a table name, but no schema or column name.

Any idea on the query syntax?

Thank you.

>
>
>
> --
>  David Rowley                   http://www.2ndQuadrant.com/
>  PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Igor Korot
Дата:
Сообщение: Re: [GENERAL] Sample in documentation
Следующее
От: Steve Atkins
Дата:
Сообщение: Re: [GENERAL] Caching and Blobs in PG? Was: Can PG replace redis,amqp, s3 in the future?