Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


pgsql-sql by date

Next:From: Joe ConwayDate: 2004-01-21 18:03:28
Subject: Re: array_lower /array_prepend doubt
Previous:From: Stephan SzaboDate: 2004-01-21 15:53:11
Subject: Re: array_lower /array_prepend doubt

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group