pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rajesh Kumar Mallah <mallah@trade-india.com>
Cc: pgsql-sql@postgresql.org, Joe Conway <mail@joeconway.com>
Subject: Re: array_lower /array_prepend doubt
Date: Wed, 21 Jan 2004 12:14:30 -0500
Message-ID: <1648.1074705270@sss.pgh.pa.us> (raw)
In-Reply-To: <400E85EC.4000106@trade-india.com>
References: <400E85EC.4000106@trade-india.com>

Rajesh Kumar Mallah <mallah@trade-india.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



view thread (12+ messages)  latest in thread

Message-ID: <1648.1074705270@sss.pgh.pa.us>
Permalink:  ../1648.1074705270@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1648.1074705270@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mallah@trade-india.com, mail@joeconway.com
  Subject: Re: array_lower /array_prepend doubt
  In-Reply-To: <1648.1074705270@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox