Re: multiset patch review

From: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: multiset patch review
Date: 2011-02-04 18:02:51
Message-ID: AANLkTikc_MnCLtJW0ooB9sDQxrKqZNFkLr8RCFTN0-e0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 5, 2011 at 02:29, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> I am still not in favor of adding this syntax.

I also don't like the syntax, but unfortunately, almost all of
them are in the SQL standard :-(. In addition, Oracle already
uses the same feature with the special syntax, though true multiset
data types are supported in it.

> [It sure is awkward that trim_array has the word
> array second and all of our other array functions have it first - is
> this required by the spec?]

Yes, again, but we could have array_trim() for the alias.

> array_to_set() and array_is_set() seem possibly useful, but I probably
> would have called them array_remove_dups() and array_has_dups().  I
> might be in the minority on that one, though.

array_to_set is the only function we can rename freely.
Another candidates might be array_unique (contrib/intarray uses uniq).

array_is_set() is an internal representation of "IS A SET" operator.
So, the name is not so important (and not documented.)

> I think array_subset(), array_union(), array_intersect(), and
> array_except() are useful, but I think they should just be regular
> functions, without any special syntax.

All of the special syntax are in the spec, except the argument
types should be multisets rather than arrays.

> fusion() and intersection() also seem useful, but maybe it would be
> more consistent to all them array_fusion() and array_intersection().

Both of the names are the standard... We could have array_fusion()
for array types and fusion() for multiset types, but I prefer
overloaded fusion() to have both names.

--
Itagaki Takahiro

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-02-04 18:04:09 Re: more buildfarm breakage
Previous Message PostgreSQL - Hans-Jürgen Schönig 2011-02-04 17:48:23 SELECT ... WHERE fti_query ORDER BY numeric_col LIMIT x - problem