Re: Identity columns should own only one sequence

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: 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-04-29 16:28:39
Message-ID: 3875606fd9fa6b2d0239f4fb6c3a43378b283b37.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 2019-04-27 at 14:16 +0200, Peter Eisentraut wrote:
> On 2019-04-26 15:37, Laurenz Albe wrote:
> > What do you think of the patch I just posted on this thread to
> > remove ownership automatically when the default is dropped, as Michael
> > suggested? I think that would make things much more intuitive from
> > the user's perspective.
>
> I think that adds more nonstandard behavior on top of an already
> confusing and obsolescent feature, so I can't get too excited about it.
>
> A more forward-looking fix would be your other idea of having
> getOwnedSequence() only deal with identity sequences (not serial
> sequences). See attached patch for a draft.

That looks good to me.

I agree that slapping on black magic that appropriates a pre-existing
owned sequence seems out of proportion.

I still think thatthat there is merit to Michael's idea of removing
sequence "ownership" (which is just a dependency) when the DEFAULT
on the column is dropped, but this approach is possibly cleaner.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-04-29 16:35:11 Re: Race conditions with checkpointer and shutdown
Previous Message Tom Lane 2019-04-29 15:23:13 Re: Race conditions with checkpointer and shutdown