Re: MULTISET and additional functions for ARRAY
David Wheeler <david@kineticode.com>
From: "David E. Wheeler" <david@kineticode.com>
To: Itagaki Takahiro <itagaki.takahiro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-11T17:20:18Z
Lists: pgsql-hackers
On Nov 11, 2010, at 7:02 AM, Itagaki Takahiro wrote: > MULTISET supports are more difficult. We have corresponding > type IDs for each array, but we might not want to add additional > IDs for multiset for each type. Any ideas for the issue? Why not? > 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. > > If we have troublesome issues to support multiset data types, > I'm thinking to add multiset functions that receives ARRAY > types instead at time first time, because an ARRAY is a > MULTISET by definition. An array is a superset of MULTISET, I guess? > Some of functions for multisets seems to be useful for arrays, too. > > Comments and suggestions welcome. So are you planning to implement multisets? It's a feature I'd love to see… Best, David