From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jounts@gmail.com
Subject: BUG #17762: date field casts to null in case section with join's
Date: Fri, 27 Jan 2023 12:21:11 +0000
Message-ID: <17762-1a82488048c89e3c@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17762
Logged by: Evgeny Nee
Email address: jounts@gmail.com
PostgreSQL version: 15.1
Operating system: debian 11
Description:
Query works fine:
SELECT id,
CASE
WHEN date_field IS NOT NULL THEN date_field::TEXT
END AS date_str
FROM my_table
But this query:
SELECT t1id, t2.name,
CASE
WHEN t1.date_field IS NOT NULL THEN t1.date_field::TEXT
END AS date_str
FROM my_table t1
JOIN my_table2 t2 ON t1.id = t2.id
returns: null in date_str
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, jounts@gmail.com
Subject: Re: BUG #17762: date field casts to null in case section with join's
In-Reply-To: <17762-1a82488048c89e3c@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