Re: PATCH: make plpgsql IN args mutable (v1)

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: PATCH: make plpgsql IN args mutable (v1)
Дата
Msg-id 1249004364.709.3.camel@monkey-cat.sm.truviso.com
обсуждение исходный текст
Ответ на Re: PATCH: make plpgsql IN args mutable (v1)  (David Fetter <david@fetter.org>)
Ответы Re: PATCH: make plpgsql IN args mutable (v1)  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Thu, 2009-07-30 at 17:40 -0700, David Fetter wrote:
> > > 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.
> 
> Wouldn't INOUT parameters cover this case?

That was my first, thought, but I don't think it solves his concern. The
out parameters are returned as part of a record, but he actually wants
to mutate the value passed in.

If mutable IN parameters were allowed, I don't even think it could be
allowable to call them from the SQL level, you could only from another
function.

For instance, what would it mean if you did something like:

SELECT foo(a) FROM mytable;

Where foo() mutated it's IN argument? Would that really be an UPDATE?

Regards,Jeff Davis



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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: PATCH: make plpgsql IN args mutable (v1)
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: PATCH: make plpgsql IN args mutable (v1)