Re: ALTER TYPE RENAME - Mailing list pgsql-patches

From Tom Lane
Subject Re: ALTER TYPE RENAME
Date
Msg-id 25713.1191126877@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TYPE RENAME  (Petr Jelinek <pjmodos@pjmodos.net>)
Responses Re: ALTER TYPE RENAME
List pgsql-patches
Petr Jelinek <pjmodos@pjmodos.net> writes:
> Tom Lane wrote:
>> Currently, since there's no ALTER TYPE RENAME command, this is useful
>> functionality and I wouldn't want to forbid it.  But if we provide
>> ALTER TYPE RENAME then consistency would suggest requiring people to
>> use that for composite types.
>>
> I assume ALTER TYPE RENAME should rename associated relation too, then.

Hm, I'm not entirely sure if you got the point or not.  For either
relations or composite types, there is both a pg_class entry and a
pg_type entry, and their names *must* stay in sync.  We could allow
people to rename both entries using either ALTER TABLE or ALTER TYPE,
but the general consensus seems to be that ALTER TYPE should be used
for composite types and ALTER TABLE for tables/views/etc.  The fact
that there's a pg_class entry for a composite type is really an
implementation detail that would best not be exposed to users, so
enforcing the use of the appropriate command seems reasonable to me.

            regards, tom lane

pgsql-patches by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: pgcrypto: fix for broken solaris openssl, v03
Next
From: Petr Jelinek
Date:
Subject: Re: ALTER TYPE RENAME