public inbox for [email protected]  
help / color / mirror / Atom feed
BUG #19455: ALTER TABLE RENAME will rename a sequence
3+ messages / 3 participants
[nested] [flat]

* BUG #19455: ALTER TABLE RENAME will rename a sequence
@ 2026-04-13 12:48 PG Bug reporting form <[email protected]>
  2026-04-13 14:22 ` Re: BUG #19455: ALTER TABLE RENAME will rename a sequence Tom Lane <[email protected]>
  2026-04-13 14:23 ` Re: BUG #19455: ALTER TABLE RENAME will rename a sequence David G. Johnston <[email protected]>
  0 siblings, 2 replies; 3+ messages in thread

From: PG Bug reporting form @ 2026-04-13 12:48 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following bug has been logged on the website:

Bug reference:      19455
Logged by:          Bob Sislow
Email address:      [email protected]
PostgreSQL version: 15.2
Operating system:   Red Hat Enterprise Linux release 8.7 (Ootpa)
Description:        

Is this expected behavior? ALTER TABLE RENAME will rename a sequence.

postgres=# create sequence test;
CREATE SEQUENCE
postgres=# \ds
           List of relations
  Schema  | Name |   Type   |  Owner
----------+------+----------+----------
 dbaadmin | test | sequence | postgres
(1 row)

postgres=# alter table test rename to test2;
ALTER TABLE
postgres=# \ds
           List of relations
  Schema  | Name  |   Type   |  Owner
----------+-------+----------+----------
 dbaadmin | test2 | sequence | postgres
(1 row)








^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #19455: ALTER TABLE RENAME will rename a sequence
  2026-04-13 12:48 BUG #19455: ALTER TABLE RENAME will rename a sequence PG Bug reporting form <[email protected]>
@ 2026-04-13 14:22 ` Tom Lane <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2026-04-13 14:22 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

PG Bug reporting form <[email protected]> writes:
> Is this expected behavior? ALTER TABLE RENAME will rename a sequence.

Yes, it is.  It'll work on views and (most?) other kinds of relations
too.

To some extent this is a hangover from before we had the more
specialized variants.  But it can be handy to not worry too much
about just what kind of relation you're renaming, and tightening
that up would likely break some applications, so we haven't.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #19455: ALTER TABLE RENAME will rename a sequence
  2026-04-13 12:48 BUG #19455: ALTER TABLE RENAME will rename a sequence PG Bug reporting form <[email protected]>
@ 2026-04-13 14:23 ` David G. Johnston <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: David G. Johnston @ 2026-04-13 14:23 UTC (permalink / raw)
  To: [email protected] <[email protected]>; [email protected] <[email protected]>

On Monday, April 13, 2026, PG Bug reporting form <[email protected]>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      19455
> Logged by:          Bob Sislow
> Email address:      [email protected]
> PostgreSQL version: 15.2
> Operating system:   Red Hat Enterprise Linux release 8.7 (Ootpa)
> Description:
>
> Is this expected behavior? ALTER TABLE RENAME will rename a sequence.


It’s documented:

https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-DESC-RENAME

Arguably it’s better to use alter sequence so the somewhat buried
documentation for this seems ok.

David J.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-04-13 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-13 12:48 BUG #19455: ALTER TABLE RENAME will rename a sequence PG Bug reporting form <[email protected]>
2026-04-13 14:22 ` Tom Lane <[email protected]>
2026-04-13 14:23 ` David G. Johnston <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox