Re: patch: plpgsql - access records with rec.(expr) - Mailing list pgsql-hackers

From Neil Conway
Subject Re: patch: plpgsql - access records with rec.(expr)
Date
Msg-id 1101168433.12361.17.camel@localhost.localdomain
Whole thread Raw
In response to Re: patch: plpgsql - access records with rec.(expr)  (Matt <matt@kynx.org>)
Responses Re: patch: plpgsql - access records with rec.(expr)  (Matt <matt@kynx.org>)
List pgsql-hackers
On Mon, 2004-11-22 at 10:06 +0000, Matt wrote:
> This would execute a string and pass back the result?

It would evaluate a string as a PL/PgSQL statement (which means you
could construct any PL/PgSQL statement dynamically, including access to
fields of a RECORD determined at runtime).

> > I don't like this: it implicitly coerces a string literal into an
> > identifier (i.e. a column name). Treating data as code can be useful,
> > but I think we need to make it more obvious to the user. I think a
> > proper EVALUATE statement might be a better solution.
> 
> See your point. But what about NEW.($1)?

I don't follow -- what do you mean?

(BTW, I think my comment also applies to variables of type "text" and
similar -- I think the patch would be a lot simpler if you just
implement access to record fields by ordinal position, and don't
implement access by field name.)

-Neil




pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [Testperf-general] Re: ExclusiveLock
Next
From: Dru
Date:
Subject: Re: Can postgresql accept mutliple connections in the same