| From: | "John Hansen" <john(at)geeknet(dot)com(dot)au> | 
|---|---|
| To: | <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | unnest | 
| Date: | 2004-11-05 12:09:58 | 
| Message-ID: | 5066E5A966339E42AA04BA10BA706AE561FB@rodrick.geeknet.com.au | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Attached, array -> rows iterator.
select * from unnest(array[1,2,3,4,5]);
Unnest
---------------
 1
 2
 3
 4
 5
5 rows
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.
Does anyone know how to check individual array elements for NULL values?
PG_ARG_ISNULL() seems to return true if ANY array element is null; ex::
array[1,2,3,null,4,5]
Comments / improvements welcome.
Kind regards,
John
| Attachment | Content-Type | Size | 
|---|---|---|
| Makefile | application/octet-stream | 225 bytes | 
| unnest.c | application/octet-stream | 4.1 KB | 
| unnest.sql | application/octet-stream | 128 bytes | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thomas Hallgren | 2004-11-05 12:28:25 | Re: CVS should die | 
| Previous Message | Gaetano Mendola | 2004-11-05 12:00:56 | Re: [pgsql-www] pg_autovacuum is nice ... but ... |