Re: BUG #19013: When creating a table with the "...LIKE...INCLUDING ALL" construct, REPLICA IDENTITY output is wrong

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #19013: When creating a table with the "...LIKE...INCLUDING ALL" construct, REPLICA IDENTITY output is wrong
Дата
Msg-id CAKFQuwYK1OS=vmJgbhyd7h2XD2axCHFeH4MhVEZRa_3B9F8uFg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #19013: When creating a table with the "...LIKE...INCLUDING ALL" construct, REPLICA IDENTITY output is wrong  ("dbman@sqlexec.com" <dbman@sqlexec.com>)
Список pgsql-bugs
On Wed, Aug 6, 2025 at 8:42 AM dbman@sqlexec.com <dbman@sqlexec.com> wrote:

thereby actually changing the state of the REPLICA IDENTITY from FULL or INDEX to DEFAULT.

Nothing is "changed".  The newly created table never existed and as soon as it did the value of replica identity was default.  It was never anything else.

Sure, maybe we should implement a LIKE option to cover replica identity, but given that it doesn't exist the current behavior is valid - assign what the value would be after a normal create table.  I'd add maybe there should be a way to specify replica identity during create table, not just alter table, but that too is a new feature.

  It just seems that something should be done to prevent a change to the REPLICA IDENTIY if one exists that is not DEFAULT in the source table.

If you don't want the default, PK, replica identity on the new table you are compelled to alter the table after you create it to specify what it should be.  Sure, we don't actually say those words, but since there is nothing in create table that deals with replica identity, that is the conclusion one must draw.  We tend to only document affirmatives - I'm not all that convinced this is going to be an exception.

David J.
 

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