Re: Identity columns should own only one sequence

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Identity columns should own only one sequence
Date: 2019-04-14 18:15:09
Message-ID: a27c42222ce3bcda2f17eeb3133ed475c6fb54ba.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Floris Van Nee 2019-04-14 19:19:41 partitioning performance tests after recent patches
Previous Message Tom Lane 2019-04-14 17:38:56 Re: hyrax vs. RelationBuildPartitionDesc