missing rename support

Started by Peter Eisentrautabout 14 years ago3 messages
#1Peter Eisentraut
peter_e@gmx.net

I noticed the following object types don't have support for an ALTER ...
RENAME command:

DOMAIN (but ALTER TYPE works)
FOREIGN DATA WRAPPER
OPERATOR
RULE
SERVER

Are there any restrictions why these couldn't be added?

(I stumbled upon this while trying to rename a foreign server, but we
might as well make everything consistent.)

#2Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#1)
Re: missing rename support

On Sat, Dec 3, 2011 at 4:46 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

I noticed the following object types don't have support for an ALTER ...
RENAME command:

DOMAIN (but ALTER TYPE works)
FOREIGN DATA WRAPPER
OPERATOR
RULE
SERVER

Are there any restrictions why these couldn't be added?

I don't think so. There's no ALTER RULE command; should we add one
(matching ALTER TRIGGER) or make this part of ALTER TABLE? I don't
think constraints can be renamed either, which should probably be
addressed along with rules.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#2)
Re: missing rename support

Robert Haas <robertmhaas@gmail.com> writes:

I don't think so. There's no ALTER RULE command; should we add one
(matching ALTER TRIGGER) or make this part of ALTER TABLE? I don't
think constraints can be renamed either, which should probably be
addressed along with rules.

Note that renaming an index-based constraint should also rename the
index. I believe the other direction works already.

regards, tom lane