Re: ALTER TABLE .. ADD PRIMARY KEY .. USING INDEX has dump-restore hazard

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: ALTER TABLE .. ADD PRIMARY KEY .. USING INDEX has dump-restore hazard
Дата
Msg-id CAB7nPqT8BM7Fep2jJM_6Z5Xug-psv77+adYVWjHSW4NB3EEYpg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE .. ADD PRIMARY KEY .. USING INDEX has dump-restore hazard  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Wed, Jul 22, 2015 at 9:34 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Wed, Jul 22, 2015 at 1:23 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>> Notice that the collation specifier is gone.  Oops.
>
> As it is not possible to specify directly a constraint for a PRIMARY
> KEY expression, what about switching dumpConstraint to have it use
> first a CREATE INDEX query with the collation and then use ALTER TABLE
> to attach the constraint to it? I am noticing that we already fetch
> the index definition in indxinfo via pg_get_indexdef. Thoughts?

And poking at that I have finished with the attached that adds a
CREATE INDEX query before ALTER TABLE ADD CONSTRAINT, to which a USING
INDEX is appended. Storage options as well as building the column list
becomes unnecessary because indexdef already provides everything what
is needed, so this patch makes dump rely more on what is on
backend-side.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: "make check" changes have caused buildfarm deterioration.
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Alpha2/Beta1