Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
Date: 2009-09-16 21:44:58
Message-ID: 4AB15C5A.4040305@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-09-16 22:05:17 Re: Hot Standby 0.2.1
Previous Message Robert Haas 2009-09-16 21:43:45 Re: Feedback on getting rid of VACUUM FULL