I noticed in a post recently that it was possible to rename objects other
than tables in pg_class using ALTER TABLE RENAME. I've now implemented this
in pgAdmin II for views, sequences and indexes.

Today I've had cause to dump my test database and found a minor problem:

dumping database "helpdesk"...
pg_dump: query to get data of sequence "cat" returned name "dog"
pg_dump failed on helpdesk, exiting

This can be recreated easily:

helpdesk=# create sequence dog;
CREATE
helpdesk=# alter table dog rename to cat;
ALTER
helpdesk=# select sequence_name from cat;
 sequence_name
---------------
 dog
(1 row)


Regards, Dave.

(now wondering how many responses will say it is a bug and how many will say
a sequence is not a table and I shouldn't be doing that anyway :) )

Tue, 26 Feb 2002 20:37:39 -0000
Dave Page <dpage@vale-housing.co.uk>
Rename sequence  bug/feature
Dave Page <dpage@vale-housing.co.uk> writes:
> I noticed in a post recently that it was possible to rename objects other
> than tables in pg_class using ALTER TABLE RENAME. I've now implemented this
> in pgAdmin II for views, sequences and indexes.

> Today I've had cause to dump my test database and found a minor problem:

> dumping database "helpdesk"...
> pg_dump: query to get data of sequence "cat" returned name "dog"

Well, we could either add code to ALTER RENAME to hack the sequence
name stored in sequences, or we could remove that check from pg_dump.
I kinda lean to the latter myself; it seems pretty useless.

			regards, tom lane

Wed, 27 Feb 2002 00:19:37 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Rename sequence bug/feature 