From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ravi Krishna <srkrishna@myself.com>
To: Vikas Sharma <shavikas@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: SQL query
Date: Thu, 18 Apr 2019 11:41:16 -0700
Message-ID: <e66f60fe-05f7-8e34-eeec-777f497c6b24@aklaver.com> (raw)
In-Reply-To: <trinity-9d27ccf7-5d86-48ba-bfe7-eda427221248-1555612595046@3c-app-mailcom-lxa14>
References: <CAN6gwKw9jDGk-kiuA21fW=L3HDk7ns7t6FW8XxOaJSDcGgqRFg@mail.gmail.com>
<trinity-9d27ccf7-5d86-48ba-bfe7-eda427221248-1555612595046@3c-app-mailcom-lxa14>
On 4/18/19 11:36 AM, Ravi Krishna wrote:
> Not able to produce this with PG 11.1
>
> If col1 is any type other than boolean, the update statement fails in syntax.
> If col1 is boolean, then it updated it correctly. In other words
> update col1 = NULL
> and col2 in (1,2)
> is treated same as
> update col1 = NULL
> where col2 in (1,2)
The above is not the same format as OP's query:
Update tableA set col1 = null and col2 in (1,2);
>
> Also I checked it on DB2 which rejected the UPDATE sql as bad syntax, as expected.
>
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, srkrishna@myself.com, shavikas@gmail.com
Subject: Re: SQL query
In-Reply-To: <e66f60fe-05f7-8e34-eeec-777f497c6b24@aklaver.com>
References: <CAN6gwKw9jDGk-kiuA21fW=L3HDk7ns7t6FW8XxOaJSDcGgqRFg@mail.gmail.com> <trinity-9d27ccf7-5d86-48ba-bfe7-eda427221248-1555612595046@3c-app-mailcom-lxa14> <e66f60fe-05f7-8e34-eeec-777f497c6b24@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox