missing rename support

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: missing rename support
Date: 2011-12-03 21:46:21
Message-ID: 1322948781.26266.9.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.)


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing rename support
Date: 2011-12-05 15:44:39
Message-ID: CA+TgmoZ12OYdYkH-jn_oC-Mzh9FQbBQHg=ENsUWp4aPjpD1E_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Dec 3, 2011 at 4:46 PM, Peter Eisentraut <peter_e(at)gmx(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing rename support
Date: 2011-12-05 15:54:31
Message-ID: 28134.1323100471@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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