pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: SQL query
Date: Thu, 18 Apr 2019 12:58:49 -0500
Message-ID: <771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.com> (raw)
In-Reply-To: <CAN6gwKw9jDGk-kiuA21fW=L3HDk7ns7t6FW8XxOaJSDcGgqRFg@mail.gmail.com>
References: <CAN6gwKw9jDGk-kiuA21fW=L3HDk7ns7t6FW8XxOaJSDcGgqRFg@mail.gmail.com>

On 4/18/19 11:43 AM, Vikas Sharma wrote:
> Hi,
>
> I have come across a query that a developer wrote to update a few rows in 
> table, the query did update the two desired rows but also updated the 
> rest of the table with the column value as 'false'.
>
> Update tableA set col1 = null and col2 in (1,2);
>
> The query updated col1 to null for the rows where col2 was either 1 or 2, 
> rest of rows were also updated for col1 to 'false'.
>  The above was run without where clause.

On the QA server, right?

-- 
Angular momentum makes the world go 'round.





view thread (45+ messages)  latest in thread

Message-ID: <771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.com>
Permalink:  ../771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.com/
Also on:    postgresql.org/message-id/771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.com

 · 

reply

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: ronljohnsonjr@gmail.com
  Subject: Re: SQL query
  In-Reply-To: <771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.com>
  References: <CAN6gwKw9jDGk-kiuA21fW=L3HDk7ns7t6FW8XxOaJSDcGgqRFg@mail.gmail.com> <771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.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