Re: updated WIP: arrays of composites

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, David Fetter <david(at)fetter(dot)org>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: updated WIP: arrays of composites
Date: 2007-05-11 20:45:58
Message-ID: 3133.1178916358@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Gregory Stark wrote:
>> BTW, why exactly do we need array types to have names at all?

Because typname is part of the primary key for pg_type ...

>> The only
>> user-visible way to refer to these types is always by foo[] isn't it?

> I think you can use the _foo name, but it would certainly be an odd
> thing to do.

There is *tons* of legacy code that uses _foo, mainly because there was
a time when we didn't support the [] notation in a lot of places where
types can be named. There still are some places, in fact:

regression=# alter type widget[] set schema public;
ERROR: syntax error at or near "["
LINE 1: alter type widget[] set schema public;
^
regression=# alter type _widget set schema public;
ERROR: cannot alter array type widget[]
HINT: You can alter type widget, which will alter the array type as well.
regression=#

That particular one may not need fixed (anymore) but the real problem is
the torches-and-pitchforks session that will ensue if we break legacy
code for no reason beyond cosmetics.

IIRC some of the contrib modules still have instances of _foo in
their SQL scripts.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2007-05-11 21:21:13 Re: updated WIP: arrays of composites
Previous Message Andrew Dunstan 2007-05-11 20:34:07 Re: updated WIP: arrays of composites