Re: Identity columns should own only one sequence
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-hackers@lists.postgresql.org
Date: 2019-04-14T18:15:09Z
Lists: pgsql-hackers
I wrote: > Identity columns don't work if they own more than one sequence. > [...] > test=> INSERT INTO ser (id) VALUES (DEFAULT); > ERROR: more than one owned sequence found > > > I propose that we check if there already is a dependent sequence > before adding an identity column. > > The attached patch does that, and also forbids setting the ownership > of a sequence to an identity column. Alternatively, maybe getOwnedSequence should only consider sequences with an "internal" dependency on the column. That would avoid the problem without forbidding anything, since normal OWNED BY dependencies are "auto". What do you think? Yours, Laurenz Albe
Commits
-
Make identity sequence management more robust
- 19781729f789 13.0 landed