| From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
|---|---|
| To: | Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Updates with NULL |
| Date: | 2003-09-15 15:15:35 |
| Message-ID: | 20030915081226.M66255@megazone.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | N.K. | 2003-09-15 15:15:42 | Re: Connecting to postgres from a romote machhine |
| Previous Message | Tom Lane | 2003-09-15 15:14:56 | Re: Initalizing PostgreSQL Database |