Re: subquery column error causes data destroying equality

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Cy <frompostgres(at)cy1(dot)allowed(dot)org>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: subquery column error causes data destroying equality
Date: 2020-07-25 14:01:37
Message-ID: CAKFQuwZhZqSQjN2hJKxwhx9uCXTtQsXQUJ9=kS-hGMuVCj_fuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Jul 25, 2020 at 3:32 AM Cy <frompostgres(at)cy1(dot)allowed(dot)org> wrote:

> update comic.panels set medium = x'2a958'::int where page = (
> select page from comic.pages where comic = x'1db'::int and which = 0);
>
> Unfortunately, I forgot that the column in the "pages" table was named
> "id" not "page".
> This would have been the correct query:
>
> update comic.panels set medium = x'2a958'::int where page = (
> select id from comic.pages where comic = x'1db'::int and which = 0);
>

https://wiki.postgresql.org/wiki/FAQ#Why_doesn.27t_PostgreSQL_report_a_column_not_found_error_when_using_the_wrong_name_in_a_subquery.3F

> So... please have errors in subqueries cause the surrounding query to fail.

Won't happen.

I'm using version 13devel, git commit
> 9f87ae38eaffcc7f72c45bfeb79e09dd6e8c2f48 so if the
> bug has been fixed since then, feel free to ignore me.
>

This isn't a bug.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2020-07-25 14:08:17 Re: BUG #16554: Consistent sequence gaps occuring next day
Previous Message PG Bug reporting form 2020-07-25 08:52:38 BUG #16554: Consistent sequence gaps occuring next day