Re: SQL99 ARRAY support proposal - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: SQL99 ARRAY support proposal
Date
Msg-id Pine.LNX.4.44.0303131721500.1617-100000@peter.localdomain
Whole thread Raw
In response to Re: SQL99 ARRAY support proposal  (Joe Conway <mail@joeconway.com>)
Responses Re: SQL99 ARRAY support proposal  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: SQL99 ARRAY support proposal  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
OK, let's look at these more closely:

>  >>      array_push(anyarray, anyelement) returns anyarray

The standard spelling for that appears to be   somearray || ARRAY[element]
which also has the nice property that it is commutative.

>  >>      array_pop(anyarray) returns anyelement

That appears to mean that you return somearray[0] and alter the array as a
side effect.  How do you plan to do that?

>  >>      array_subscript(anyarray, int) yields anyelement

That's just somearray[x], no?

>  >>      singleton_array(anyelement) returns anyarray

That's ARRAY[element].

>  >>      split(text, text) returns text[]
>  >>         - split string into array on delimiter
>  >>      implode(text[], text) returns text
>  >>         - join array elements into a string using given string delimiter

I can live with these, but perhaps we should choose some not-so-generic
names.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Christoph Haller
Date:
Subject: Re: [SQL] What's wrong with this group by clause?
Next
From: Tom Lane
Date:
Subject: Re: [SQL] What's wrong with this group by clause?