From: David G. Johnston <david.g.johnston@gmail.com>
To: Harry Ambrose <harry.ambrose@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Odd Update Behaviour
Date: Thu, 20 Jun 2019 14:16:50 -0700
Message-ID: <CAKFQuwZdkSWaSLBY_19ESL7BctrWtVEyXfqSyprsGT0y+3YS3Q@mail.gmail.com> (raw)
In-Reply-To: <CAK4Knu-vB0=fG-ApNNVVYyGpt5_mQA5jDBFOTigTnAu3OsJdPQ@mail.gmail.com>
References: <CAK4Knu-vB0=fG-ApNNVVYyGpt5_mQA5jDBFOTigTnAu3OsJdPQ@mail.gmail.com>
On Thu, Jun 20, 2019 at 2:13 PM Harry Ambrose <harry.ambrose@gmail.com>
wrote:
> Hi,
>
> I noticed some weird update behaviour today in one of our development
> environments. In my opinion this appears to be a bug, but before reporting
> it I thought I should seek the opinions of others in the community. Maybe
> this is known and/or seen before?
>
Yep, seen before, even has an FAQ entry:
https://wiki.postgresql.org/wiki/FAQ#Why_doesn.27t_PostgreSQL_report_a_column_not_found_error_when_u...> The behaviour is visible when a subquery is used in an update. More
> specifically when a subquery is rejected by the parser when executed on
> it's own. This causes the where condition to be ignored entirely and thus
> the whole table updated rather than the parser throwing an error.
>
David J.
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: david.g.johnston@gmail.com, harry.ambrose@gmail.com
Subject: Re: Odd Update Behaviour
In-Reply-To: <CAKFQuwZdkSWaSLBY_19ESL7BctrWtVEyXfqSyprsGT0y+3YS3Q@mail.gmail.com>
References: <CAK4Knu-vB0=fG-ApNNVVYyGpt5_mQA5jDBFOTigTnAu3OsJdPQ@mail.gmail.com> <CAKFQuwZdkSWaSLBY_19ESL7BctrWtVEyXfqSyprsGT0y+3YS3Q@mail.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