Re: unnest

From: John Hansen <john(at)geeknet(dot)com(dot)au>
To: "Eric B(dot)Ridge" <ebr(at)tcdi(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: unnest
Date: 2004-11-09 03:26:49
Message-ID: 1099970808.4172.3.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
Makefile text/x-makefile 299 bytes
unnest.c text/x-csrc 2.2 KB
unnest.sql text/x-sql 107 bytes

In response to

  • Re: unnest at 2004-11-09 02:09:38 from Eric B.Ridge

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-11-09 03:41:55 Re: server auto-restarts and ipcs
Previous Message Ed L. 2004-11-09 02:28:57 Re: server auto-restarts and ipcs