pgsql: Allow record_in() and record_recv() to work for transient record - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Allow record_in() and record_recv() to work for transient record
Date
Msg-id E1ZSp4u-0001Do-1s@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f2ae044babe846f36b42577dc91b25b1cc40f8b9

Modified Files
--------------
src/backend/utils/adt/rowtypes.c |   39 +++++++++++++++++---------------------
1 file changed, 17 insertions(+), 22 deletions(-)


pgsql-committers by date:

Previous
From: Stephen Frost
Date:
Subject: pgsql: In AlterRole, make bypassrls an int
Next
From: Tom Lane
Date:
Subject: pgsql: Fix plpython crash when returning string representation of a REC