Re: join of array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: join of array
Date: 2003-08-15 12:07:08
Message-ID: 12638.1060949228@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz> writes:
> Is possible merge two arrays like
> array[1,2,3] + array[4,5,6] => array[1,2,3,4,5,6]

I was about to say that || would do it, but I see that's not quite
right:

regression=# SELECT ARRAY[1,2,3] || ARRAY[4,5,6];
?column?
-------------------
{{1,2,3},{4,5,6}}
(1 row)

Offhand, I would think that '{1,2,3,4,5,6}' would be what I'd
intuitively expect to get from "concatenating" these arrays.
Joe, do we really have this implemented per spec?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-08-15 12:34:31 Re: tsearch2 in 7.4beta1 compile problem
Previous Message Tom Lane 2003-08-15 11:57:10 Re: [GENERAL] 7.4Beta

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2003-08-15 15:34:14 Re: join of array
Previous Message Pavel Stehule 2003-08-15 09:41:21 join of array