Re: Rename or Re-Create Constraints?

Поиск
Список
Период
Сортировка
От Carlos Mennens
Тема Re: Rename or Re-Create Constraints?
Дата
Msg-id BANLkTi=V3jaCiCQO7tdtE7H=V2sWhNcSwQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Rename or Re-Create Constraints?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Rename or Re-Create Constraints?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, Apr 8, 2011 at 8:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I believe you can rename the underlying indexes and the constraints will
> follow them.  (This works in HEAD anyway, not sure how far back.)

Below is my table:


inkpress=# \d marketing
          Table "public.marketing"
 Column  |         Type          | Modifiers
---------+-----------------------+-----------
 id      | integer               | not null
 vendor  | character varying(40) | not null
 account | integer               | not null
 email   | character varying(40) | not null
 state   | character(2)          | not null
Indexes:
    "accounts_pkey" PRIMARY KEY, btree (id)
    "accounts_account_key" UNIQUE, btree (account)
    "accounts_email_key" UNIQUE, btree (email)
    "accounts_vendor_key" UNIQUE, btree (vendor)

I renamed the table name from 'accounts' to 'marketing' however all
the constraints listed under 'indexes' are still named 'accounts_*'
and I've tried to rename them but I can't find any information with an
example command to rename the constraints:

ALTER TABLE marketing ...???

I can't find any update / alter SQL commands to correct the constraint
inconsistency.

:(

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

Предыдущее
От: Clemens Eisserer
Дата:
Сообщение: Re: Howto sort the result of UNION (without modifying its type)?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Rename or Re-Create Constraints?