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

From Matt
Subject Re: patch: plpgsql - access records with rec.(expr)
Date
Msg-id 1100792195.4229.125.camel@matt.kynx.org
Whole thread Raw
In response to patch: plpgsql - access records with rec.(expr)  (Matt <matt@kynx.org>)
List pgsql-hackers
> 5. Because of the way the expression is parsed (looking for closing
> parenth), this will choke if you try and put a function in there. Would
> it be better to use curly braces '{expr}' or another character to mark
> the expression?

I lie! pgpgsql_read_expression() is smarter than that!

However, I do have another problem. If the value of the expr changes
inside a loop to a fieldname of a different type, it dies with the "type
of \"%s\" does not match that when preparing the plan" message, which is
quite true: it obviously doesn't.

Just setting expectedtypeoid to InvalidOid bombs the whole thing :(
Hrm.... the "best made plans" and all that...

Matt





pgsql-hackers by date:

Previous
From: G u i d o B a r o s i o
Date:
Subject: invalid page header
Next
From: Tom Lane
Date:
Subject: Re: invalid page header