Record Types Structure in PL/pgSQL

From: Diego Sanchez <dsanchez(at)roldansia(dot)com(dot)co>
To: pgsql-general(at)postgresql(dot)org
Subject: Record Types Structure in PL/pgSQL
Date: 2007-06-05 22:12:33
Message-ID: 4665DFD1.3000401@roldansia.com.co
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there.

Is there any way of determining the actual structure of a record
variable? E. g. I've written a small script to do some calculations
over some fields with a dinamically generated query. It looks like this:

create function foo(text) returns void as
$$
declare
a_record record;
my_query alias for $1;
begin
for a_record in execute my_query loop
-- Do some calculations
end loop;
return;
end;
$$
language plpgsql;

The question is: how could I possibly get the field names and other
information about the record a_record? I appreciate any suggestions or
tips about this.

Best regards.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2007-06-05 23:04:57 Re: Tablespaces
Previous Message Oliver Elphick 2007-06-05 21:55:20 Re: Running v8.1 amd v8.2 at the same time for a transition