Re: [GENERAL] array_dims array_lower/upper distance

2005-09-23 Thread Matthew Peter
--- Guy Fraser <[EMAIL PROTECTED]> wrote: > On Fri, 2005-23-09 at 09:48 -0700, Matthew Peter > wrote: > > > > --- Guy Fraser <[EMAIL PROTECTED]> wrote: > > > ...snip... > > > OK what I jotted down was totally wrong. > > > > > > This is slightly more correct : > > > > > > SELECT > > > array_up

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-23 Thread Guy Fraser
On Fri, 2005-23-09 at 09:48 -0700, Matthew Peter wrote: > > --- Guy Fraser <[EMAIL PROTECTED]> wrote: > ...snip... > > OK what I jotted down was totally wrong. > > > > This is slightly more correct : > > > > SELECT > > array_upper(item,1) - array_lower(item,1) + 1 as > > elements > > FROM > >

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-23 Thread Matthew Peter
--- Guy Fraser <[EMAIL PROTECTED]> wrote: > On Thu, 2005-22-09 at 21:52 -0500, Bruno Wolff III > wrote: > > On Thu, Sep 22, 2005 at 14:16:48 -0600, > > Guy Fraser <[EMAIL PROTECTED]> wrote: > > > On Thu, 2005-22-09 at 12:43 -0400, Greg Stark > wrote: > > > > Guy Fraser <[EMAIL PROTECTED]> writ

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-23 Thread Guy Fraser
On Thu, 2005-22-09 at 21:52 -0500, Bruno Wolff III wrote: > On Thu, Sep 22, 2005 at 14:16:48 -0600, > Guy Fraser <[EMAIL PROTECTED]> wrote: > > On Thu, 2005-22-09 at 12:43 -0400, Greg Stark wrote: > > > Guy Fraser <[EMAIL PROTECTED]> writes: > > > > > > > So to answer his question he would likel

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-22 Thread Bruno Wolff III
On Thu, Sep 22, 2005 at 14:16:48 -0600, Guy Fraser <[EMAIL PROTECTED]> wrote: > On Thu, 2005-22-09 at 12:43 -0400, Greg Stark wrote: > > Guy Fraser <[EMAIL PROTECTED]> writes: > > > > > So to answer his question he would likely want : > > > > > > SELECT > > > array_upper(item,1) - array_upper(

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-22 Thread Guy Fraser
On Thu, 2005-22-09 at 12:43 -0400, Greg Stark wrote: > Guy Fraser <[EMAIL PROTECTED]> writes: > > > So to answer his question he would likely want : > > > > SELECT > > array_upper(item,1) - array_upper(item,0) + 1 as elements > > FROM > > arraytest ; > > Note that this doesn't work for empty a

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-22 Thread Greg Stark
Guy Fraser <[EMAIL PROTECTED]> writes: > So to answer his question he would likely want : > > SELECT > array_upper(item,1) - array_upper(item,0) + 1 as elements > FROM > arraytest ; Note that this doesn't work for empty arrays. It will return NULL instead of 0. -- greg --

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-22 Thread Guy Fraser
On Wed, 2005-21-09 at 07:48 -0700, Tony Wasson wrote: > On 9/20/05, Matthew Peter <[EMAIL PROTECTED]> wrote: > > Wondering if there's a way for postgres to return how > > many elements are in a array as a single integer? For > > instance, returning 10 (items in array) instead of > > [-5:4] > > > >

Re: [GENERAL] array_dims array_lower/upper distance

2005-09-21 Thread Tony Wasson
On 9/20/05, Matthew Peter <[EMAIL PROTECTED]> wrote: > Wondering if there's a way for postgres to return how > many elements are in a array as a single integer? For > instance, returning 10 (items in array) instead of > [-5:4] > > Also, is there a way to return the position of an item > in a array?

[GENERAL] array_dims array_lower/upper distance

2005-09-20 Thread Matthew Peter
Wondering if there's a way for postgres to return how many elements are in a array as a single integer? For instance, returning 10 (items in array) instead of [-5:4] Also, is there a way to return the position of an item in a array? __ Yahoo! Ma