Re: MULTISET and additional functions for ARRAY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MULTISET and additional functions for ARRAY
Date: 2010-11-12 05:21:08
Message-ID: 29990.1289539268@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Nov 11, 2010 at 10:02 AM, Itagaki Takahiro
> <itagaki(dot)takahiro(at)gmail(dot)com> wrote:
>> If we reuse type IDs of arrays for multisets, the multisets would
>> have some special typmod. For example, typmod = 0 means multiset,
>> and positive value means array with max cardinality. Note that
>> the SQL standard doesn't mention about multi-dimensional arrays.
>> So, we can use typmod = -1 as a free-size and free-dimensional
>> array for backward compatibility.

> I would really like to see us fix our type system so that it doesn't
> require this type of awful hack. But maybe that's asking too much of
> a patch to implement this feature.

The problem is not with the type system: as long as you give multisets
different type OIDs from arrays, everything will work fine. It will
absolutely not work to try to use typmod to make the behavior vary
like that ... but Itagaki-san knew that already.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-11-12 05:53:09 Re: MULTISET and additional functions for ARRAY
Previous Message Tom Lane 2010-11-12 04:57:09 Re: duplicate connection failure messages