Re: unnest - Mailing list pgsql-hackers

From John Hansen
Subject Re: unnest
Date
Msg-id 1099970808.4172.3.camel@localhost.localdomain
Whole thread Raw
In response to Re: unnest  (Eric B.Ridge <ebr@tcdi.com>)
List pgsql-hackers
> > The switch statement could probably be done in a different way, but
> > there doesn't seem to be any good examples of how to return anyitem. If
> > anyone have a better way, please let me know.
>
> Why do you need the switch statement at all? array->elements is already
> an array of Datums.  Won't simply returning
>     array->elements[array->i]
> work?

yea,. sorry,. worked it out shortly after posting this, but forgot to
repost.... so here it is... attached.

> The problem is:
> test=# select * from unnest('{1,2,3,4,5}'::int8[]);
>    unnest
> ----------
>   25314880
>   25314888
>   25314896
>   25314904
>   25314912
> (5 rows)


Attachment

pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: unnest
Next
From: Josh Berkus
Date:
Subject: Re: [pgsql-hackers] Increasing the length of pg_stat_activity.current_query...