Re: Reassign value of IN parameter in 9.1.1

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Gavin Casey <gpjcasey(at)googlemail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Reassign value of IN parameter in 9.1.1
Date: 2011-11-24 15:37:19
Message-ID: CAFj8pRAARF0j0jUiGKdsmQKPEmbizR8Y++MOaNCRBzHP0=F_hA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2011/11/24 Gavin Casey <gpjcasey(at)googlemail(dot)com>:
> 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?
>

Read only parameters was confusing for people without knowledge
classic SP languages. Typical programming languages allows it. More
this limit has not real reason in PL/pgSQL and after remove , the
parameters are little bit more usable - try to implement buble sort.

Regards

Pavel Stehule

>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2011-11-24 15:39:58 Re: General performance/load issue
Previous Message Andrus 2011-11-24 15:17:52 Re: How to get normalized data from tekst column