Re: PL/pgSQL 'i = i + 1' Syntax

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, all(at)adv(dot)magwien(dot)gv(dot)at
Subject: Re: PL/pgSQL 'i = i + 1' Syntax
Date: 2006-05-17 17:22:30
Message-ID: 200605171022.30886.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2006-05-17 17:23:01 Re: [GENERAL] Querying libpq compile time options
Previous Message Bruce Momjian 2006-05-17 17:21:32 Re: [GENERAL] Querying libpq compile time options