| From: | Chris Travers <chris(dot)travers(at)gmail(dot)com> |
|---|---|
| To: | "J(dot)V(dot)" <jvsrvcs(at)gmail(dot)com> |
| Cc: | PostgreSQL <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: how to key/value iterate in stored function |
| Date: | 2011-10-12 13:53:52 |
| Message-ID: | CAKt_Zft1xxHVJOWj-x7Ds04rQKf=m5o6NkvCEUbEei1ZFVR-pQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Wed, Oct 12, 2011 at 6:46 AM, J.V. <jvsrvcs(at)gmail(dot)com> wrote:
> I want to create a variable that is an array or list of key/value pairs.
>
> The key would be a table name and the value would be a sql statement or a
> value or list of values for which I could extract to create a sql statement
> and execute.
>
> I have tried experimenting with various arrays, but there is no clear
> example or documentation. The key and the value would be text.
>
> I want to iterate over the entire array (or list), so would need an example
> on that or some pointers there, if there is help.
>
Which version of PostgreSQl are you running? It's a little easier on
8.4 and higher (unnest comes in handy here), but prior to 1.4 you can
loop from array_lower to array_upper.....
Best Wishes,
Chris Travers
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Brandon Phelps | 2011-10-12 13:54:36 | Monitoring Replication |
| Previous Message | J.V. | 2011-10-12 13:46:37 | how to key/value iterate in stored function |