Re: Rename or Re-Create Constraints?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rename or Re-Create Constraints?
Дата
Msg-id 4167.1302368329@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Rename or Re-Create Constraints?  (Carlos Mennens <carlos.mennens@gmail.com>)
Ответы Re: Rename or Re-Create Constraints?
Список pgsql-general
Carlos Mennens <carlos.mennens@gmail.com> writes:
> 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.)

> 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 INDEX accounts_pkey RENAME TO whatever

On very old versions of PG you may have to spell that "ALTER TABLE"
instead of "ALTER INDEX", but it's the same thing either way.

            regards, tom lane

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

Предыдущее
От: Carlos Mennens
Дата:
Сообщение: Re: Rename or Re-Create Constraints?
Следующее
От: Carlos Mennens
Дата:
Сообщение: Re: Rename or Re-Create Constraints?