Re: array_lower /array_prepend doubt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: array_lower /array_prepend doubt
Date: 2004-01-21 17:14:30
Message-ID: 1648.1074705270@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> 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 see anything in the documentation that mentions it.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2004-01-21 18:03:28 Re: array_lower /array_prepend doubt
Previous Message Stephan Szabo 2004-01-21 15:53:11 Re: array_lower /array_prepend doubt