Re: We aren't a relational database ... ?

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: We aren't a relational database ... ?
Дата
Msg-id 1191958243.19081.31.camel@dogma.ljc.laika.com
обсуждение исходный текст
Ответ на Re: We aren't a relational database ... ?  (David Fetter <david@fetter.org>)
Список pgsql-advocacy
On Tue, 2007-10-09 at 12:13 -0700, David Fetter wrote:
> On Tue, Oct 09, 2007 at 11:48:35AM -0700, Jeff Davis wrote:
> > On Tue, 2007-10-09 at 09:44 +0200, Kaare Rasmussen wrote:
> > > > In SQL, "=" is both an assignment operator (e.g. UPDATE) and a
> > > > comparison operator (e.g. WHERE clause). There are
> > > > nondeterministic
> > >
> > > Why would that be a problem when they occur in different parts of
> > > the statement?
> >
> > It can actually be in the same part of the statement:
> >
> > UPDATE foo SET b = a = 0;
>
> Don't Do That(TM).

Right, I don't; it was completely contrived. I am not making any attempt
to be elegant with such a statement.

I'm just trying to point out that, if there's a complex update statement
it might do something unexpected if you have a bug. Other languages have
different assignment and comparison operators to avoid these situations,
and I think it helps people catch bugs (and makes it easier to parse,
I'm sure).

Regards,
    Jeff Davis


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: We aren't a relational database ... ?
Следующее
От: Kaare Rasmussen
Дата:
Сообщение: Re: We aren't a relational database ... ?