| From: | Steve Martin <steve(dot)martin(at)nec(dot)co(dot)nz> |
|---|---|
| To: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Substitute a variable in PL/PGSQL. |
| Date: | 2008-07-24 05:02:03 |
| Message-ID: | 48880CCB.7030804@nec.co.nz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Merlin Moncure wrote:
>On Wed, Jul 23, 2008 at 4:08 AM, Klint Gore <kgore4(at)une(dot)edu(dot)au> wrote:
>
>
>here is a way to do it with record variables...no inner loop but
>doesn't the column names. with a little work you could add those with
>some queries to information_schema (i don't think it's worth it
>though).
>
>create or replace function ff(tablename text) returns setof text as
>$$
> declare
> r record;
> begin
> for r in
> execute 'select record_out(' || tablename || ') as f' ||
> ' from ' || tablename loop
> return next r.f;
> end loop;
> end;
>$$ language plpgsql;
>
>merlin
>
>
>
Hi Merlin,
Where can I find out more on the record_out function?
Steve M.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2008-07-24 05:51:52 | Re: mac install question |
| Previous Message | Scott Marlowe | 2008-07-24 04:45:27 | Re: A couple of newbie questions ... |