From: | "Florian G(dot) Pflug" <fgp(at)phlo(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Postgresql-Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Inspection of row types in pl/pgsql and pl/sql |
Date: | 2009-11-14 18:21:39 |
Message-ID: | 4AFEF533.2050101@phlo.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> "Florian G. Pflug" <fgp(at)phlo(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Florian G. Pflug | 2009-11-14 18:31:04 | Re: Inspection of row types in pl/pgsql and pl/sql |
Previous Message | Roger Leigh | 2009-11-14 18:16:54 | Re: Unicode UTF-8 table formatting for psql text output |