Re: ALTER TYPE RENAME

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Petr Jelinek <pjmodos(at)pjmodos(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: ALTER TYPE RENAME
Date: 2007-09-30 04:34:37
Message-ID: 25713.1191126877@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Petr Jelinek <pjmodos(at)pjmodos(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Petr Jelinek 2007-09-30 05:00:05 Re: ALTER TYPE RENAME
Previous Message Zdenek Kotala 2007-09-30 01:20:33 Re: pgcrypto: fix for broken solaris openssl, v03