Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW] - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
Date
Msg-id 4AB15C5A.4040305@dunslane.net
Whole thread Raw
In response to Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers

Josh Berkus wrote:
> Michael,
>
>   
>> Have an example at hand? I'd argue that in a case of a function of more
>> complexity from a code clarity standpoint you'd want to assign to a new
>> variable that describes what the new value reflects.
>>     
>
> Depends on what programming language you're used to.  For those of us
> who do a lot of pass-by-reference in our non-database code, reusing the
> IN variable is "natural".  I know not being able to is a longstanding
> annoyance for me.
>
>
>   

It's the pass by reference case that would be dangerous, in fact. The 
fact that in C all function parameters are passed by value (unlike, say, 
FORTRAN) is what makes it safe to modify them inside the function.

Anyway, debates about such thigs tend to get a bit religious. getting 
more practical, I'm slightly inclined to say Steve Prentice has made a 
good enough case for doing this.

cheers

andrew




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Feedback on getting rid of VACUUM FULL
Next
From: Josh Berkus
Date:
Subject: Re: Hot Standby 0.2.1