Re: Identity columns should own only one sequence - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: Identity columns should own only one sequence
Date
Msg-id a27c42222ce3bcda2f17eeb3133ed475c6fb54ba.camel@cybertec.at
Whole thread Raw
In response to Identity columns should own only one sequence  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Identity columns should own only one sequence
List 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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: hyrax vs. RelationBuildPartitionDesc
Next
From: Floris Van Nee
Date:
Subject: partitioning performance tests after recent patches