SQL99 ARRAY support proposal

From: Joe Conway <mail(at)joeconway(dot)com>
To: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: SQL99 ARRAY support proposal
Date: 2003-03-09 03:55:04
Message-ID: 3E6ABB18.6080108@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

I'd like to implement SQL99/200x ARRAY support (well, at least the
basics). Does anyone have objections to the following grammar/semantics?

===========================================================
Per SQL200x - examples
===========================================================
create table foo(f1 integer ARRAY[3]);
result same as create table foo(f1 integer[3]); the 3
really does nothing (this deviates from spec but is
same as current implementation)
create table foo(f1 integer ARRAY);
result same as create table foo(f1 integer[]);
select ARRAY[1,2,3];
result '{1,2,3}'
select ARRAY[(select oid from pg_class order by relname)];
result is array of all the oid's in pg_class in relname order
select ARRAY[1,2] || 3
result '{1,2,3}'
select ARRAY[1,2] || ARRAY[3,4]
result '{1,2,3,4}'

===========================================================
Proposed PostgreSQL extensions
===========================================================
select ARRAY[[1,2,3], [4,5,6]];
result '{{1,2,3},{4,5,6}}'
select ARRAY[[1,2],[3,4]] || 5
result '{{1},{3},{5}}'
select ARRAY[[1,2],[3,4]] || [5,6]
result '{{1,2},{3,4},{5,6}}'
use UNION's algorithm for deriving the element type when not specified

Comments, suggestions, objections?

Thanks,

Joe

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-03-09 04:06:36 Re: SQL99 ARRAY support proposal
Previous Message Tom Lane 2003-03-09 02:29:46 Re: regression failure in CVS HEAD

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-03-09 04:06:36 Re: SQL99 ARRAY support proposal
Previous Message Tom Lane 2003-03-08 22:09:17 Re: String changes