Re: Updates with NULL - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Updates with NULL
Date
Msg-id 20030915081226.M66255@megazone.bigpanda.com
Whole thread Raw
In response to Updates with NULL  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
List pgsql-general
On Mon, 15 Sep 2003, Shridhar Daithankar wrote:

> I was just updating a table in oracle9.2 by hand and bumped into this.
>
> Following seems to be the valid syntax in oracle.
>
> Update foo set somefield=NULL where somefield >9;
>
> Now I am not sure having something equalled with NULL is a good thig logically.
> I would say
>
> Update foo set somefield [to] NULL where somefield >9;
>
> sounds much better. Postgresql uses =default expression which is fine.
>
> Is Oracle behaviour correct?

Yes (and we also allow update foo set somefield=NULL).

         <set clause list> ::=
              <set clause> [ { <comma> <set clause> }... ]

         <set clause> ::=
              <object column> <equals operator> <update source>

         <update source> ::=
                <value expression>
              | <null specification>
              | DEFAULT

         <object column> ::= <column name>

and null specification is:

     <null specification> ::=
          NULL


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Initalizing PostgreSQL Database
Next
From: Andrew Sullivan
Date:
Subject: Re: Does "vacuum analyze" contain "vacuum"?