pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: jackbicknell@gmail.com
Subject: Document behaviour of failed sub queries
Date: Mon, 28 Jun 2021 13:55:34 +0000
Message-ID: <162488853426.694.9342956513555878140@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/functions-subquery.html
Description:

I have found that when a sub query fails, the preceeding IN will ignore the
failure and execute as if the subquery did not exist.

I think this should either be stated explicitly in the documentation or it
should fail the main the query.

For example:
UPDATE table1 SET status='expired' WHERE id in (SELECT wrong_id IN table2)

This will update every row in table1if wrong_id doesn't exist, ignoring the
ERROR:  column "wrong_id" does not exist from the subquery.

If you feel like the documentation explains this thoroughly enough already
then please point me in the direction. At the moment it makes refernece to
queries not completing but it doesn't mention failures.

Thanks

Jack


view thread (3+ messages)  latest in thread

Message-ID: <162488853426.694.9342956513555878140@wrigleys.postgresql.org>
Permalink:  ../162488853426.694.9342956513555878140@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/162488853426.694.9342956513555878140@wrigleys.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, jackbicknell@gmail.com
  Subject: Re: Document behaviour of failed sub queries
  In-Reply-To: <162488853426.694.9342956513555878140@wrigleys.postgresql.org>

* 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