Re: Fix propagation of persistence to sequences in ALTER TABLE / ADD COLUMN
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-02-09T07:19:55Z
Lists: pgsql-hackers
On 08.02.24 07:04, Ashutosh Bapat wrote: > The patch looks ok. > > + seqstmt->sequence->relpersistence = cxt->rel ? > cxt->rel->rd_rel->relpersistence : cxt->relation->relpersistence; > + > > This condition looks consistent with the other places in the code > around line 435, 498. Ah good, that pattern already existed. > But I was worried that cxt->rel may not get > latest relpersistence if the ALTER TABLE changes persistence as well. > Added a test (0002) which shows that ctx->rel has up-to-date > relpersistence. Also added a few other tests. Feel free to > include/reject them while committing. Yes, this additional coverage seems good. Committed with your additions.
Commits
-
Fix propagation of persistence to sequences in ALTER TABLE / ADD COLUMN
- d17a3a4c6a34 15.7 landed
- 86d2b434c9a3 16.3 landed
- 6743c5ae64e3 17.0 landed
-
Unlogged sequences
- 344d62fb9a97 15.0 cited