Re: PL/pgSQL 'i = i + 1' Syntax - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: PL/pgSQL 'i = i + 1' Syntax
Date
Msg-id 200605171022.30886.josh@agliodbs.com
Whole thread Raw
In response to Re: PL/pgSQL 'i = i + 1' Syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PL/pgSQL 'i = i + 1' Syntax
Re: PL/pgSQL 'i = i + 1' Syntax
List pgsql-hackers
Tom,

> True, but there were clear benefits from doing so.  Disallowing "="
> assignment in plpgsql wouldn't buy anything, just break programs.

But it's already disallowed in most places.   The i = i + 1 seems to be an 
exception.   

So what happens to "i" if I do:

IF i = i + 1 THEN ....

does "i" increment?   If so, isn't that a bug? 

I don't think too many people are using that functionality intentionally; I 
probably write more PL/pgSQL than anyone and would regard any assignment 
without ":=" as a bug.

-- 
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco


pgsql-hackers by date:

Previous
From: "Larry Rosenman"
Date:
Subject: Re: [GENERAL] Querying libpq compile time options
Next
From: Tom Lane
Date:
Subject: Re: PL/pgSQL 'i = i + 1' Syntax