Re: referencing an attribute of a ROWTYPE variable in pgpsql using quote_ident or quote_literal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David Monarchi" <david(dot)e(dot)monarchi(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: referencing an attribute of a ROWTYPE variable in pgpsql using quote_ident or quote_literal
Date: 2007-05-30 21:51:23
Message-ID: 21864.1180561883@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"David Monarchi" <david(dot)e(dot)monarchi(at)gmail(dot)com> writes:
> I'm trying to dynamically assign values to attributes in a record without
> know which attribute values I will actually receive.

You're wasting your time trying to do that in plpgsql --- quite aside
from syntactic difficulties, the language doesn't work well for this
because it's statically typed. Use one of the other PL languages.
In plperl, for instance, a record looks like a hash and it's easy to
iterate through the keys etc.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jasbinder Singh Bali 2007-05-31 08:32:27 Retreving count of rows returned by a join query
Previous Message David Monarchi 2007-05-30 20:25:23 referencing an attribute of a ROWTYPE variable in pgpsql using quote_ident or quote_literal