Re: SQL99 ARRAY support proposal

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hannu Krosing <hannu(at)tm(dot)ee>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL99 ARRAY support proposal
Date: 2003-03-13 16:50:32
Message-ID: Pine.LNX.4.44.0303131721500.1617-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-03-13 17:02:55 Re: [SQL] What's wrong with this group by clause?
Previous Message Christoph Haller 2003-03-13 16:15:16 Re: [SQL] What's wrong with this group by clause?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-03-13 17:12:46 Re: SQL99 ARRAY support proposal
Previous Message Tom Lane 2003-03-13 06:06:21 Re: SQL99 ARRAY support proposal