Re: Strange behavior of "=" as assignment operator

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Strange behavior of "=" as assignment operator
Дата
Msg-id 1370097280714-5757670.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Strange behavior of "=" as assignment operator  (Chris Travers <chris.travers@gmail.com>)
Ответы Re: Strange behavior of "=" as assignment operator  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Chris Travers-5 wrote
> My  preference would be that at some point we start adding warnings when =
> is used as an assignment.  Such warnings could be turned off.  Then at
> some
> later point we can decide whether to change the behavior.  A decision to
> changing the language would be different if such behavior had given
> warnings for several years prior.

We can play the "let's pretend we have already been warning people for the
past 5 years about this: would we, today, turn off the behavior without a
recourse to turn it back on?" game.  We need to make a decision with the
information we have right now - not at "some later point".  The decision is
independent of whether we have been warning people or not - the warning is
simply part of the "how to go about affecting the decision that has already
been made".

A bogus warning is nearly as bad as simply disallowing the syntax in the
first place and I do not like turning one on unless there is the decision to
disallow the syntax in the future.

My preference would be to document the currently allowable usage of both
":=" and "=" (including within GET DIAGNOSTICS).  Address in the
documentation compatibility concerns.  And add configurations to the "check
function" implementation that allow the programmer to decide which usages
are allowable and which are not.  The default would be to allow either
symbol in either situation - i.e., the current behavior.

The status-quo, from the lack of discussion surrounding this recently,
doesn't seem to be that bad.  My sample and exposure to other's code,
though, is quite minimal and not everything makes it to the lists (or is
read if it does) so maybe there is some underlying significant risk that I
am simply missing.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Strange-behavior-of-as-assignment-operator-tp5757205p5757670.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: Victor Yegorov
Дата:
Сообщение: Re: Sum raw with the same continuous flags
Следующее
От: David Johnston
Дата:
Сообщение: Re: Sum raw with the same continuous flags