Re: MULTISET and additional functions for ARRAY

From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 16:29:32
Message-ID: 20101112162932.GB18948@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 12, 2010 at 12:53:09AM -0500, Robert Haas wrote:
> On Fri, Nov 12, 2010 at 12:21 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > 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.
>
> And thus you must create a THIRD copy of every entry in pg_type. That
> doesn't qualify as a problem?

Yes, and I've started a separate thread on this along with a page on
the wiki.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2010-11-12 16:34:18 Refactoring the Type System
Previous Message Eric Davies 2010-11-12 16:27:54 Re: SQL/MED estimated time of arrival?