Disallow unique index on system columns

Поиск
Список
Период
Сортировка
От David Rowley
Тема Disallow unique index on system columns
Дата
Msg-id CAKJS1f8TQYgTRDyF1_u9PVCKWRWz+DkieH=U7954HeHVPJKaKg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Disallow unique index on system columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

Over in [1], while I was aiming to fix some incorrect formatting in an
error message, Tom noticed that the code in that area was much more
broken than I had thought.

Basically, if you do;

postgres=# create table t (a int) with oids;
CREATE TABLE
postgres=# create unique index t_oid_idx on t(oid);
CREATE INDEX
postgres=# alter table t replica identity using index t_oid_idx;

You get;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

I proposed a fix over there, but it didn't go anywhere, probably
because Tom and Andres discussed just disallowing unique indexes on
system columns altogether. So, the attached patch does just that, and
also fixes up the replica identity bugs too, as it's still possible
that someone could create a unique index on a system column with an
old version, upgrade, then try to set the replica identity to that
index. We'd need to handle that correctly, so I fixed that too.

I hope there's still time to get this backpacked before the releases.

[1] http://www.postgresql.org/message-id/26659.1459485031@sss.pgh.pa.us

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Draft release notes for next week's releases
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Disallow unique index on system columns