pgsql: Make plpgsql provide the typmods for its variables to the main p - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Make plpgsql provide the typmods for its variables to the main p
Date
Msg-id E1QOE9L-0001db-AC@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Make plpgsql provide the typmods for its variables to the main parser.

Historically we didn't do this, even though we had the information, because
plpgsql passed its Params via SPI APIs that only include type OIDs not
typmods.  Now that plpgsql uses parser callbacks to create Params, it's
easy to insert the right typmod.  This should generally result in lower
surprise factors, because a plpgsql variable that is declared with a typmod
will now work more like a table column with the same typmod.  In particular
it's the "right" way to fix bug #6020, in which plpgsql's attempt to return
an anonymous record type is defeated by stricter record-type matching
checks that were added in 9.0.  However, it's not impossible that this
could result in subtle behavioral changes that could break somebody's
existing plpgsql code, so I'm afraid to back-patch this change into
released branches.  In those branches we'll have to lobotomize the
record-type checks instead.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/219dfae4e1b0ca7cbc0b2f0f7740e01657964c07

Modified Files
--------------
src/pl/plpgsql/src/pl_comp.c |    8 +++--
src/pl/plpgsql/src/pl_exec.c |   72 ++++++++++++++++++++++++++++++++---------
src/pl/plpgsql/src/plpgsql.h |    5 ++-
3 files changed, 64 insertions(+), 21 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Pull up isReset flag from AllocSetContext to MemoryContext struc
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Put lists in sensible order