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-12 00:57:41
Message-ID: 11037.1178931461@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:
> There will only be an issue if you use table/type names beginning with
> underscore, right? And I don't think it will matter because nobody has
> been relying on that to date as we haven't had array types for those. We
> should probably document that relying on the array name is both fragile
> and unnecessary.

I added this to the CREATE TYPE reference page, which AFAIR is the only
place that mentions the naming convention at all:

<para>
Before <productname>PostgreSQL</productname> version 8.3, the name of
a generated array type was always exactly the element type's name with one
underscore character (<literal>_</literal>) prepended. (Type names were
therefore restricted in length to one less character than other names.)
While this is still usually the case, the array type name may vary from
this in case of maximum-length names or collisions with user type names
that begin with underscore. Writing code that depends on this convention
is therefore deprecated. Instead, use
<structname>pg_type</>.<structfield>typarray</> to locate the array type
associated with a given type.
</para>

<para>
It may be advisable to avoid using type and table names that begin with
underscore. While the server will change generated array type names to
avoid collisions with user-given names, there is still risk of confusion,
particularly with old client software that may assume that type names
beginning with underscores always represent arrays.
</para>

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tomas Doran 2007-05-12 02:16:03 Re: Implemented current_query
Previous Message Andrew Dunstan 2007-05-11 23:53:30 Re: updated WIP: arrays of composites