Re: Does RENAME TABLE rename associated identity sequence?

From: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Jason Song <pidaoh(at)g(dot)skku(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Does RENAME TABLE rename associated identity sequence?
Date: 2025-04-24 17:30:41
Message-ID: CAMsGm5e4gT3HNaRZDRbdzC3gg=kp6YKQVq48prMwEUAfh9zOFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 24 Apr 2025 at 05:53, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
wrote:

> If there's any problem, IMO, ALTER TABLE ... RENAME ... should rename the
> sequence too since the identity sequences are created implicitly when the
> table is created, so they should be renamed implicitly. We should not
> require WITH SEQUENCE clause.
>

My concern would be what happens if the new sequence name is not available.
I suppose the simplest behaviour might be to skip renaming the sequence in
that case, perhaps raising a warning.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-04-24 17:40:05 Re: Does RENAME TABLE rename associated identity sequence?
Previous Message Jacob Champion 2025-04-24 17:02:25 Re: [PoC] Federated Authn/z with OAUTHBEARER