Re: join of array

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

elein wrote:
>> ARRAY[[1,2],[3,4]] || ARRAY[[1,2],[3,4]] ==
>> '{{{1,2},{3,4}},{{1,2},{3,4}}}'
>>
>>I think the first two still make sense. I guess the third case ought to be:
>> ARRAY[[1,2],[3,4]] || ARRAY[[1,2],[3,4]] ==
>> '{{1,2},{3,4},{1,2},{3,4}}'
>>?
>
> I do not think this is right. I think the current behaviour
> is right. You are effectively dereferencing or flattening
> the second array which changes the definition of the second
> object.

It makes sense in analogy to
ARRAY[1,2] || ARRAY[3,4] == '{1,2,3,4}'

In the case of, e.g. ARRAY[[1,2],[3,4]] || ARRAY[[5,6],[7,8]],
'{1,2}', '{3,4}', '{5,6}', and '{7,8}' are "elements" of the higher
level array, just like 1, 2, 3, & 4 are elements of '{1,2,3,4}'

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jenny Zhang 2003-08-15 17:10:20 getting execution plans with multiple database connections
Previous Message Stephan Szabo 2003-08-15 16:57:24 Re: importing db as text files

Browse pgsql-patches by date

  From Date Subject
Next Message expect 2003-08-15 17:18:44 summary and request
Previous Message elein 2003-08-15 16:54:43 Re: join of array