Accessing RECORD variable info

From: "Derrick Betts" <list(at)blueaxis(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Accessing RECORD variable info
Date: 2007-02-04 07:46:42
Message-ID: 0bd901c74830$a0eee7b0$0202a8c0@main
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have the following in a plpgsql function:

DECLARE
rec RECORD;

BEGIN
FOR rec IN EXECUTE 'SELECT * FROM '||table[1]
LOOP
--use the results here
END LOOP;

How can I determine the actual field name and the field value for the record variable (rec) if I were to look in index 1 or 2 or 3 of the variable?
As you can see from the snippet of the function, the table that will be queried is dynamic and as such so are the names of the fields the rec variable will be returning.

Thank you,
Derrick

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2007-02-04 08:15:34 Re: Accessing RECORD variable info
Previous Message Frank Bax 2007-02-03 22:54:29 Re: connection timeout?