Re: join of array

Поиск
Список
Период
Сортировка
Искать
От
elein
Тема
Re: join of array
Дата
Msg-id
20030815111712.G22348@cookie
Ответ на
Re: join of array (Joe Conway)
Список
Дерево обсуждения
join of array Pavel Stehule <stehule@kix.fsv.cvut.cz>
Re: join of array Tom Lane <tgl@sss.pgh.pa.us>
Re: join of array Joe Conway <mail@joeconway.com>
Re: join of array Tom Lane <tgl@sss.pgh.pa.us>
Re: join of array Joe Conway <mail@joeconway.com>
Arrays and "goodness" in RDBMSs (was Re: join of array) Ron Johnson <ron.l.johnson@cox.net>
Re: Arrays and "goodness" in RDBMSs (was Re: join of array) elein <elein@varlena.com>
Re: Arrays and "goodness" in RDBMSs (was Re: join of Ron Johnson <ron.l.johnson@cox.net>
Re: Arrays and "goodness" in RDBMSs (was Re: join of elein <elein@varlena.com>
Re: Arrays and "goodness" in RDBMSs (was Re: join of "Andrew L. Gould" <algould@datawok.com>
Re: Arrays and "goodness" in RDBMSs (was Re: join of Ron Johnson <ron.l.johnson@cox.net>
Re: Arrays and "goodness" in RDBMSs (was Re: join of array) "Andrew L. Gould" <algould@datawok.com>
Re: Arrays and "goodness" in RDBMSs (was Re: join of array) "Matthew D. Fuller" <fullermd@over-yonder.net>
Re: join of array elein <elein@varlena.com>
Re: join of array Joe Conway <mail@joeconway.com>
Re: join of array Tom Lane <tgl@sss.pgh.pa.us>
Re: join of array Joe Conway <mail@joeconway.com>
Re: join of array Tom Lane <tgl@sss.pgh.pa.us>
Re: join of array Tino Wildenhain <tino@wildenhain.de>
Re: join of array elein <elein@varlena.com>
Re: join of array Joe Conway <mail@joeconway.com>
Re: join of array elein <elein@varlena.com>
summary and request expect <expect@ihubbell.com>
Re: summary and request Jason Godden <jasongodden@optushome.com.au>
Re: summary and request expect <expect@ihubbell.com>
Re: summary and request - correction Jason Godden <jasongodden@optushome.com.au>
I guess I am arguing against the spec. :-)
But given the spec... 
The spec is consistent in that it seems to
dereference the right operand one level.

However, that would still make 2b inconsistent
in the evaluation of the right operand.

> 1a)  ARRAY[1,2] || ARRAY[3,4]         == '{1,2,3,4}'
> 1b)  ARRAY[[1],[2]] || ARRAY[[3],[4]] == '{{1},{2},{3},{4}}'
and    ARRAY[1,2] || ARRAY[[3],[4]]     == '{1,2,{3},{4}}'

> So by analogy the multidimensional variant is:
> 2b)  ARRAY[[1],[2]] || ARRAY[3]       == '{{1},{2},{3}}'
I would think this would be                '{{1},{2}, 3}}'
and    ARRAY[1,2] || ARRAY[[3],[4]]     == '{1,2,{3},{4}}'

I do see the analogy you are making.  But I 
respectfully disagree (with the spec ?) that
the type/structure of the left operand should be
taken into account when evaluating the right operand.

elein

On Fri, Aug 15, 2003 at 10:36:54AM -0700, Joe Conway wrote:
> elein wrote:
> >you said we had:
> >
> >>We also have
>      ^^^^
> 
> There are two variants each of two cases. The first case is what started 
> this discussion. The newest reading of the SQL99 spec says that we 
> *must* do this:
> 1a)  ARRAY[1,2] || ARRAY[3,4] == '{1,2,3,4}'
> 
> Quoting the paragraph provided by Tom:
> "c) Otherwise, the result is the array comprising every element
>     of AV1 followed by every element of AV2."
> 
> The variant is that when you have an "array of arrays", i.e. a 
> multidimensional array (which Peter E pointed out earlier is part of 
> SQL99 too), the spec wording implies that we also *must* do this:
> 1b)  ARRAY[[1],[2]] || ARRAY[[3],[4]] == '{{1},{2},{3},{4}'
> 
> 
> The second case is not directly addressed by the spec as far as I can 
> see, i.e. it is a Postgres extension. That is:
> 2a)  ARRAY[1,2] || 3 == '{1,2,3}'
> 
> So by analogy the multidimensional variant is:
> 2b)  ARRAY[[1],[2]] || ARRAY[3] == '{{1},{2},{3}}'
> 
> Cases 1a and 1b are currently wrong according to the spec., and that's 
> the change we've been discussing. Cases 2a and 2b currently work as 
> shown and are correct IMHO (although Tom pointed out a lower bound index 
> issue that I'll address in my response to him).
> 
> Does this help?
> 
> Joe
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 
В списке pgsql-general по дате отправления
От: Ron Johnson
Дата:
От: Joe Conway
Дата:
Сообщение: Re: join of array
FAQ