]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow record_in() and record_recv() to work for transient record types.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Aug 2015 15:19:33 +0000 (11:19 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Aug 2015 15:19:49 +0000 (11:19 -0400)
commit461235bdabc5de2d9977b31ecf2a32a200d8e224
treec01bbba469e26a0b1f5f6182fb10c381a642f9c5
parent8992e1acde19342f70210801b0442b6be68ef4f7
Allow record_in() and record_recv() to work for transient record types.

If we have the typmod that identifies a registered record type, there's no
reason that record_in() should refuse to perform input conversion for it.
Now, in direct SQL usage, record_in() will always be passed typmod = -1
with type OID RECORDOID, because no typmodin exists for type RECORD, so the
case can't arise.  However, some InputFunctionCall users such as PLs may be
able to supply the right typmod, so we should allow this to support them.

Note: the previous coding and comment here predate commit 59c016aa9f490b53.
There has been no case since 8.1 in which the passed type OID wouldn't be
valid; and if it weren't, this error message wouldn't be apropos anyway.
Better to let lookup_rowtype_tupdesc complain about it.

Back-patch to 9.1, as this is necessary for my upcoming plpython fix.
I'm committing it separately just to make it a bit more visible in the
commit history.
src/backend/utils/adt/rowtypes.c