Accessing RECORD variable info - Mailing list pgsql-novice

From Derrick Betts
Subject Accessing RECORD variable info
Date
Msg-id 0bd901c74830$a0eee7b0$0202a8c0@main
Whole thread Raw
In response to connection timeout?  (Frank Bax <fbax@sympatico.ca>)
Responses Re: Accessing RECORD variable info  (Andreas Kretschmer <akretschmer@spamfence.net>)
List 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

pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: Re: connection timeout?
Next
From: Andreas Kretschmer
Date:
Subject: Re: Accessing RECORD variable info