Re: converting unique index into primary key

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: converting unique index into primary key
Дата
Msg-id 23558.1103773335@sss.pgh.pa.us
обсуждение исходный текст
Ответ на converting unique index into primary key  ("Ed L." <pgsql@bluepolka.net>)
Список pgsql-general
"Ed L." <pgsql@bluepolka.net> writes:
> I need to convert an existing unique index on a very heavily inserted table
> into a primary key.  Alter table works, but locks the table for too long.
> As a hack, can I just set pg_index.indisprimary = 't' and
> pg_constraint.contype = 'p' for the appropriate row in each?  This is for
> 7.4.6 and 8.0beta3...

Don't forget to make the underlying columns notnull, too.

            regards, tom lane

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

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: migrating from mysql
Следующее
От: "Jon Asher"
Дата:
Сообщение: Basic problem installing TSearch2 (full text search)