Re: PL/pgSQL 'i = i + 1' Syntax
От | Hannu Krosing |
---|---|
Тема | Re: PL/pgSQL 'i = i + 1' Syntax |
Дата | |
Msg-id | 1147896157.3889.6.camel@localhost.localdomain обсуждение исходный текст |
Ответ на | Re: PL/pgSQL 'i = i + 1' Syntax (Josh Berkus <josh@agliodbs.com>) |
Ответы |
Re: PL/pgSQL 'i = i + 1' Syntax
|
Список | pgsql-hackers |
Ühel kenal päeval, K, 2006-05-17 kell 10:22, kirjutas Josh Berkus: > 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. I do occasionally write some pl/pgSQL, and have at some points written a lot of it. And most of it uses = instead of := , including all code written during last 1.5 years. Once I found out that = works for assignment, i completely stopped using := .I have treated := as "deprecated" for some time already. So allowing only := for assignment would make me very sad . -- ---------------- Hannu Krosing Database Architect Skype Technologies OÜ Akadeemia tee 21 F, Tallinn, 12618, Estonia Skype me: callto:hkrosing Get Skype for free: http://www.skype.com
В списке pgsql-hackers по дате отправления: