Re: Inspection of row types in pl/pgsql and pl/sql - Mailing list pgsql-hackers

From Florian G. Pflug
Subject Re: Inspection of row types in pl/pgsql and pl/sql
Date
Msg-id 4AFEF533.2050101@phlo.org
Whole thread Raw
In response to Re: Inspection of row types in pl/pgsql and pl/sql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Roger Leigh
Date:
Subject: Re: Unicode UTF-8 table formatting for psql text output
Next
From: "Florian G. Pflug"
Date:
Subject: Re: Inspection of row types in pl/pgsql and pl/sql