Re: join of array - Mailing list pgsql-general

From Tom Lane
Subject Re: join of array
Date
Msg-id 12638.1060949228@sss.pgh.pa.us
Whole thread Raw
In response to join of array  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Responses Re: join of array  (Joe Conway <mail@joeconway.com>)
List pgsql-general
Pavel Stehule <stehule@kix.fsv.cvut.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: tsearch2 in 7.4beta1 compile problem
Next
From: The Hermit Hacker
Date:
Subject: Re: Why the duplicate messages to pgsql-general?