Re: array functions - request for opinions (was Re: [PATCHES] array - Mailing list pgsql-hackers

From Tom Lane
Subject Re: array functions - request for opinions (was Re: [PATCHES] array
Date
Msg-id 2162.1053967200@sss.pgh.pa.us
Whole thread Raw
In response to Re: array functions - request for opinions (was Re: [PATCHES]  (Joe Conway <mail@joeconway.com>)
Responses Re: array functions - request for opinions (was Re: [PATCHES]  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> In both cases I think it's mostly a matter of defining a defensible 
>> behavior, which is probably not that hard, but no one's yet gotten 
>> annoyed enough to try to fix it.

> It is probably easy enough to work around in the array concatenation 
> functions. Would it be defensible to say that ('{}'::int4[] || 2) should 
> produce ('{2}'::int4[]), i.e. a one-dimensional integer array with one 
> element?

You would also have to assume that the subscript lower bound is one,
which doesn't bother me but is an additional bit of state that has to
appear out of nowhere.  (In the assignment case you don't have to assume
that, since the subscript tells you what to do.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: array functions - request for opinions (was Re: [PATCHES]
Next
From: Tom Lane
Date:
Subject: Re: Bug(s) or not?