Skip site navigation (1) Skip section navigation (2)

pgsql: Make plpgsql provide the typmods for its variables to the mainp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make plpgsql provide the typmods for its variables to the mainp
Date: 2011-05-22 19:17:15
Message-ID: E1QOE9L-0001db-AC@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: 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

Next:From: Peter EisentrautDate: 2011-05-22 19:40:34
Subject: pgsql: Put lists in sensible order
Previous:From: Tom LaneDate: 2011-05-22 18:18:06
Subject: Re: pgsql: Pull up isReset flag from AllocSetContext to MemoryContext struc

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group