Re: Record Types Structure in PL/pgSQL

From: "Bart Degryse" <Bart(dot)Degryse(at)indicator(dot)be>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Record Types Structure in PL/pgSQL
Date: 2007-06-08 13:03:21
Message-ID: 46696FB9.A3DD.0030.0@indicator.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Impossible in plpgsql. Use plperl instead.

>>> "Diego Sanchez R." <dmsanchezr(at)gmail(dot)com> 2007-06-08 14:14 >>>
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.

--
Diego M. Sánchez

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Bernier 2007-06-08 13:05:54 Live CD status
Previous Message Diego Sanchez R. 2007-06-08 12:14:50 Record Types Structure in PL/pgSQL