Re: Does RENAME TABLE rename associated identity sequence? - Mailing list pgsql-hackers

From Isaac Morland
Subject Re: Does RENAME TABLE rename associated identity sequence?
Date
Msg-id CAMsGm5e4gT3HNaRZDRbdzC3gg=kp6YKQVq48prMwEUAfh9zOFg@mail.gmail.com
Whole thread Raw
In response to Re: Does RENAME TABLE rename associated identity sequence?  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: Does RENAME TABLE rename associated identity sequence?
List pgsql-hackers
On Thu, 24 Apr 2025 at 05:53, Ashutosh Bapat <ashutosh.bapat.oss@gmail.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. 
 

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Tom Lane
Date:
Subject: Re: Does RENAME TABLE rename associated identity sequence?