Re: [SQL] array_lower /array_prepend doubt

2004-05-30 Thread Bruce Momjian
Tom Lane wrote: > Joe Conway <[EMAIL PROTECTED]> writes: > > We may need another extension to the array literal syntax in > > order to deal with this. I'll report back after I've had some time to > > study it. > > There already is support in array_in for specification of the array > dimensions (

Re: [SQL] array_lower /array_prepend doubt

2004-02-12 Thread Joe Conway
Bruce Momjian wrote: Is this a TODO? Probably -- something like: Modify array literal representation to handle array index lower bound of other than one Joe ---(end of broadcast)--- TIP 6: Have you searched our list archives? http:/

Re: [SQL] array_lower /array_prepend doubt

2004-02-12 Thread Bruce Momjian
Joe Conway wrote: > Bruce Momjian wrote: > > Is this a TODO? > > Probably -- something like: >Modify array literal representation to handle array index lower bound >of other than one Added to TODO. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED]

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > We may need another extension to the array literal syntax in > order to deal with this. I'll report back after I've had some time to > study it. There already is support in array_in for specification of the array dimensions (though it may be suffering bit

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Joe Conway
Tom Lane wrote: Of course; I suppose this bug goes back to Berkeley days. We just hadn't recognized it before (or at least I hadn't). Neither had I. But the changes in 7.4 probably make it more likely people will bump into this as a problem. Without looking to confirm, I believe SQL99 defines an

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Joe Conway
Tom Lane wrote: The other point about pg_dump failing to correctly restore arrays with nondefault lower bounds is a good one, though. We need to think about how to fix that. I'll put some thought into it, but note that it is hardly a new issue -- it's been possible to create an array with < 1 low

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > I'll put some thought into it, but note that it is hardly a new issue -- Of course; I suppose this bug goes back to Berkeley days. We just hadn't recognized it before (or at least I hadn't). regards, tom lane

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Because array_prepend keeps the subscripts of the existing array >> elements the same. This was discussed during development of the >> code, but I don't see anything in the documentation that mentions it. > It could perhaps be added to t

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Joe Conway
Tom Lane wrote: Rajesh Kumar Mallah <[EMAIL PROTECTED]> writes: can anyone explain why SELECT array_lower(array_prepend(0, ARRAY[1,2,3]), 1); returns 0 not 1 Because array_prepend keeps the subscripts of the existing array elements the same. This was discussed during development of the code, but I

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Tom Lane
Rajesh Kumar Mallah <[EMAIL PROTECTED]> writes: > can anyone explain why > SELECT array_lower(array_prepend(0, ARRAY[1,2,3]), 1); > returns 0 not 1 Because array_prepend keeps the subscripts of the existing array elements the same. This was discussed during development of the code, but I don't s

Re: [SQL] array_lower /array_prepend doubt

2004-01-21 Thread Stephan Szabo
On Wed, 21 Jan 2004, Rajesh Kumar Mallah wrote: > can anyone explain why > SELECT array_lower(array_prepend(0, ARRAY[1,2,3]), 1); > returns 0 not 1 > > because > > tradein_clients=# SELECT array_prepend(0, ARRAY[1,2,3]); > +---+ > | array_prepend | > +---+ > | {0,1,2,3}

[SQL] array_lower /array_prepend doubt

2004-01-21 Thread Rajesh Kumar Mallah
Greetings! can anyone explain why SELECT array_lower(array_prepend(0, ARRAY[1,2,3]), 1); returns 0 not 1 because tradein_clients=# SELECT array_prepend(0, ARRAY[1,2,3]); +---+ | array_prepend | +---+ | {0,1,2,3} | +---+ (1 row) and tradein_clients=# SE