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

From Josh Berkus
Subject Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
Date
Msg-id 4AB139B4.9060004@agliodbs.com
Whole thread Raw
In response to Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]  (Michael Glaesemann <grzm@seespotcode.net>)
Responses Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
List pgsql-hackers
Michael,

> This is also currently valid:
> 
> CREATE FUNCTION mod (x int, y int)
> RETURNS int LANGUAGE plpgsql
> AS $f$
> DECLARE
>  z INT := x % y;
> BEGIN
>   RETURN z;
> END; $f$
> 
> As is this:
> 
> CREATE FUNCTION mod (x int, y int)
> RETURNS int LANGUAGE plpgsql
> AS $f$
> BEGIN
>   RETURN (x % y);
> END; $f$

Certainly.  I was doing that to have a simple example; obviously you
wouldn't write a mod funciton, and you wouldn't do it in plpgsql.  There
are other case where the lack of mutability in IN parameters causes you
to create a throwaway variable.

-- 
Josh Berkus
PostgreSQL Experts Inc.
www.pgexperts.com


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Feedback on getting rid of VACUUM FULL
Next
From: tomas@tuxteam.de
Date:
Subject: Re: WIP: generalized index constraints