Reassign value of IN parameter in 9.1.1

From: Gavin Casey <gpjcasey(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Reassign value of IN parameter in 9.1.1
Date: 2011-11-24 13:52:16
Message-ID: CAMwtF+p3EPog=GxBZVk4v6Hw4UY+BkM8ivApLLjE00aV2ou_hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This works in 9.1.1 but seems like a bug to me:

create function xout(_x INTEGER)
returns integer
as $$
begin
_x = _x * 2;
return _x;
end;
$$ LANGUAGE plpgsql;

select xout(4);

It would not have compiled in version 8.

I came across such a reassignement doing a code review and was surprised it
compiled.

Is there a reason for the change in behaviour?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2011-11-24 14:09:34 Re: General performance/load issue
Previous Message Gaëtan Allart 2011-11-24 13:51:07 General performance/load issue