Re: We aren't a relational database ... ? - Mailing list pgsql-advocacy

From Jeff Davis
Subject Re: We aren't a relational database ... ?
Date
Msg-id 1191958243.19081.31.camel@dogma.ljc.laika.com
Whole thread Raw
In response to Re: We aren't a relational database ... ?  (David Fetter <david@fetter.org>)
List 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 by date:

Previous
From: David Fetter
Date:
Subject: Re: We aren't a relational database ... ?
Next
From: Kaare Rasmussen
Date:
Subject: Re: We aren't a relational database ... ?