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

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: PL/pgSQL 'i = i + 1' Syntax
Дата
Msg-id 200605171022.30886.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL 'i = i + 1' Syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PL/pgSQL 'i = i + 1' Syntax
Re: PL/pgSQL 'i = i + 1' Syntax
Список 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 по дате отправления:

Предыдущее
От: "Larry Rosenman"
Дата:
Сообщение: Re: [GENERAL] Querying libpq compile time options
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PL/pgSQL 'i = i + 1' Syntax