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

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Abhijit Menon-Sen <ams(at)toroid(dot)org>, pgsql-hackers(at)postgresql(dot)org, Steve Prentice <prentice(at)cisco(dot)com>
Subject: Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
Date: 2009-09-16 18:34:17
Message-ID: 373468D7-CB78-4D51-AA82-5323D848FA71@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Sep 16, 2009, at 13:40 , Josh Berkus wrote:

> 3. This patch eliminates a common plpgsql beginner error and saves all
> of us heavy plpgsql users some typing, especially when the use of a
> mutable variable means that we can eliminate the DECLARE section
> entirely, as in:
>
> This:
>
> CREATE PROCEDURE mod ( x int, y int )
> RETURNS int LANGUAGE plpgsql
> AS $f$
> DECLARE
> z INT := x;
> BEGIN
> z := x % y;
> RETURN z;
> END; $f$

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$

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2009-09-16 18:37:13 Re: Feedback on getting rid of VACUUM FULL
Previous Message Heikki Linnakangas 2009-09-16 18:23:04 Re: Feedback on getting rid of VACUUM FULL