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

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 (view raw or flat)
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

pgsql-general by date

Next:From: Tomas VondraDate: 2011-11-24 14:09:34
Subject: Re: General performance/load issue
Previous:From: Gaƫtan AllartDate: 2011-11-24 13:51:07
Subject: General performance/load issue

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