From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: niko@aku.mx
Subject: BUG #17671: Query returns unexpected result
Date: Mon, 31 Oct 2022 05:15:44 +0000
Message-ID: <17671-d6cc9b68691a264e@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17671
Logged by: Nikola Mirkov
Email address: niko@aku.mx
PostgreSQL version: 12.12
Operating system: Ubuntu 12.12-0ubuntu0.20.
Description:
Hey guys,
When I run the following query:
SELECT foo, bar
FROM table1
WHERE fk_id = 637
AND utc > '2022-10-16'
UNION
SELECT foo, bar
FROM table2
WHERE fk_id = 637
AND utc > '2022-10-16'
I'm getting only one row per table. If I add the column "utc" to the list in
SELECT, I get the expected result.
Why is this happening?
Thank you so much!
Niko
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-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, niko@aku.mx
Subject: Re: BUG #17671: Query returns unexpected result
In-Reply-To: <17671-d6cc9b68691a264e@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