pgsql: Make plpgsql provide the typmods for its variables to the main p

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Make plpgsql provide the typmods for its variables to the main p
Дата
Msg-id E1QOE9L-0001db-AC@gemulon.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Pull up isReset flag from AllocSetContext to MemoryContext struc
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Put lists in sensible order