SQL99 ARRAY support proposal - Mailing list pgsql-hackers

From Joe Conway
Subject SQL99 ARRAY support proposal
Date
Msg-id 3E6ABB18.6080108@joeconway.com
Whole thread Raw
Responses Re: SQL99 ARRAY support proposal  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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
(thisdeviates 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: regression failure in CVS HEAD
Next
From: Tom Lane
Date:
Subject: Re: SQL99 ARRAY support proposal