Tom Lane wrote:
> "Florian G. Pflug" <fgp@phlo.org> writes:
>> Ok, I must be missing something. I currently fail to see how my
>> proposed record_value(record, name, anyelement) returns anyelement
>> function differs (from the type system's point of view) from
>> value_from_string(text, anyelement) returns anyelement which simply
>> casts the text value to the given type and can easily be
>> implemented in plpgsq.
>
> The problem is at the call site --- if you try to call it with
> different record types on different calls you're going to get a
> failure. Or so I expect anyway.
Ah, OK - so it's really the "record" type, and not my anyelement kludge
that might cause problems.
Actually, I do now realize that "record" is a way more special case than
I'd have initially thought. For example, I could have sworn that it's
possible to pass "record" values to pl/pgsql functions, but just found
out the hard way that it isn't. Seems that the possibility of declaring
"record" variables lulled me into thinking it's pretty standard type
when it actually isn't.
best regards, Florian Pflug