Re: How to checking the existance of constraints for a table?

Поиск
Список
Период
Сортировка
От bricklen
Тема Re: How to checking the existance of constraints for a table?
Дата
Msg-id AANLkTimh55F3Pin7Uogoijad3cX4=-tR8EX+RE6VQ3+f@mail.gmail.com
обсуждение исходный текст
Ответ на How to checking the existance of constraints for a table?  (creationw <mr.creation.register@gmail.com>)
Список pgsql-sql
On Wed, Feb 2, 2011 at 12:40 PM, creationw
<mr.creation.register@gmail.com> wrote:
>
> Hello,
>
> I have a sample table describe as follows, anyone knows how to checking the
> existence of a constraint?
>
> oviddb=# \d myTable
>
>  Column  |   Type   | Modifiers
> ---------+----------+-----------
>  orderid | smallint | not null
>  modelid | smallint | not null
>
> Indexes:
>    "mytable_orderid_key" UNIQUE, btree (orderid)
>
> For example, how to know that myTable has a constraint with name
> "mytable_orderid_key"?

You could try checking the information_schema.table_constraints view.
Eg. select * from information_schema.table_constraints where
table_name='myTable'


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

Предыдущее
От: Gerardo Herzig
Дата:
Сообщение: Re: using of select (myfunction()).* is so slow
Следующее
От: Vibhor Kumar
Дата:
Сообщение: Re: TABLE PARTITION