PATCH: make plpgsql IN args mutable (v1)

Поиск
Список
Период
Сортировка
От Steve Prentice
Тема PATCH: make plpgsql IN args mutable (v1)
Дата
Msg-id BBE2C567-4995-4229-A811-0012FC263510@cisco.com
обсуждение исходный текст
Ответы Re: PATCH: make plpgsql IN args mutable (v1)  (Robert Haas <robertmhaas@gmail.com>)
Re: PATCH: make plpgsql IN args mutable (v1)  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]  (Abhijit Menon-Sen <ams@toroid.org>)
Re: PATCH: make plpgsql IN args mutable (v1)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Since I didn't get completely shot out of the water and a couple
people seemed to think it was helpful, I'm submitting this patch for
consideration in the next commitfest.

This patch changes plpgsql IN parameters so they are mutable.
Previously, they were being forced constant. This patch modifies the
plpgsql.sql regression test and corresponding .out file. The
regression test also makes sure the passed in parameter does not get
changed in the calling function.

I decided not to update the docs for this change because the docs
don't currently indicate that an IN parameter is constant and I didn't
want to encourage it because it isn't universally considered good
programming practice to assign to an IN parameter. If others think we
need a doc change for this, I'll update the patch.

The following function will compile with this patch:

   create or replace function param_assign_test(a int, val int)
returns void as $$
   begin
     a := val;
   end
   $$ language plpgsql;

This function would have failed to compile previously.

-Steve



Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: improvements for dict_xsyn extended synonym dictionary - RRR
Следующее
От: Robert Haas
Дата:
Сообщение: Re: PATCH: make plpgsql IN args mutable (v1)