Re: Identity columns should own only one sequence

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Identity columns should own only one sequence
Date: 2019-05-07 04:06:05
Message-ID: 20190507040605.GM1499@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 03, 2019 at 08:14:35AM +0200, Laurenz Albe wrote:
> On Thu, 2019-05-02 at 22:43 +0200, Peter Eisentraut wrote:
>> I think the proper way to address this would be to create some kind of
>> dependency between the sequence and the default.
>
> That is certainly true. But that's hard to retrofit into existing databases,
> so it would probably be a modification that is not backpatchable.

And this is basically already the dependency which exists between the
sequence and the relation created with the serial column. So what's
the advantage of adding more dependencies if we already have what we
need? I still think that we should be more careful to drop the
dependency between the sequence and the relation's column if dropping
the default using it. If a DDL defines first a sequence, and then a
default expression using nextval() on a column, then no serial-related
dependency exist.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-05-07 04:14:40 Re: jsonpath
Previous Message Michael Paquier 2019-05-07 03:50:17 Re: Naming of pg_checksums