public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD
@ 2024-02-09 07:18  Peter Eisentraut <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2024-02-09 07:18 UTC (permalink / raw)
  To: [email protected]

Fix propagation of persistence to sequences in ALTER TABLE / ADD COLUMN

Fix for 344d62fb9a9: That commit introduced unlogged sequences and
made it so that identity/serial sequences automatically get the
persistence level of their owning table.  But this works only for
CREATE TABLE and not for ALTER TABLE / ADD COLUMN.  The latter would
always create the sequence as logged (default), independent of the
persistence setting of the table.  This is fixed here.

Note: It is allowed to change the persistence of identity sequences
directly using ALTER SEQUENCE.  So mistakes in existing databases can
be fixed manually.

Reviewed-by: Ashutosh Bapat <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/c4b6e2ed-bcdf-4ea7-965f-e49761094827%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6743c5ae64e3c957ef8bd4f8a0daa2ba9959b0b3

Modified Files
--------------
src/backend/parser/parse_utilcmd.c     | 11 +++++-
src/test/regress/expected/identity.out | 72 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/identity.sql      | 18 +++++++++
3 files changed, 100 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD
@ 2024-02-09 07:18  Peter Eisentraut <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2024-02-09 07:18 UTC (permalink / raw)
  To: [email protected]

Fix propagation of persistence to sequences in ALTER TABLE / ADD COLUMN

Fix for 344d62fb9a9: That commit introduced unlogged sequences and
made it so that identity/serial sequences automatically get the
persistence level of their owning table.  But this works only for
CREATE TABLE and not for ALTER TABLE / ADD COLUMN.  The latter would
always create the sequence as logged (default), independent of the
persistence setting of the table.  This is fixed here.

Note: It is allowed to change the persistence of identity sequences
directly using ALTER SEQUENCE.  So mistakes in existing databases can
be fixed manually.

Reviewed-by: Ashutosh Bapat <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/c4b6e2ed-bcdf-4ea7-965f-e49761094827%40eisentraut.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d17a3a4c6a34f61a3d4d9faa7a70c14d8d0c0ffb

Modified Files
--------------
src/backend/parser/parse_utilcmd.c     | 11 +++++-
src/test/regress/expected/identity.out | 72 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/identity.sql      | 18 +++++++++
3 files changed, 100 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD
@ 2024-02-09 07:18  Peter Eisentraut <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2024-02-09 07:18 UTC (permalink / raw)
  To: [email protected]

Fix propagation of persistence to sequences in ALTER TABLE / ADD COLUMN

Fix for 344d62fb9a9: That commit introduced unlogged sequences and
made it so that identity/serial sequences automatically get the
persistence level of their owning table.  But this works only for
CREATE TABLE and not for ALTER TABLE / ADD COLUMN.  The latter would
always create the sequence as logged (default), independent of the
persistence setting of the table.  This is fixed here.

Note: It is allowed to change the persistence of identity sequences
directly using ALTER SEQUENCE.  So mistakes in existing databases can
be fixed manually.

Reviewed-by: Ashutosh Bapat <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/c4b6e2ed-bcdf-4ea7-965f-e49761094827%40eisentraut.org

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/86d2b434c9a3520a10db4feae236b74452d3d157

Modified Files
--------------
src/backend/parser/parse_utilcmd.c     | 11 +++++-
src/test/regress/expected/identity.out | 72 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/identity.sql      | 18 +++++++++
3 files changed, 100 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-02-09 07:18 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 07:18 pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD Peter Eisentraut <[email protected]>
2024-02-09 07:18 pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD Peter Eisentraut <[email protected]>
2024-02-09 07:18 pgsql: Fix propagation of persistence to sequences in ALTER TABLE / ADD Peter Eisentraut <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox