From: dqetool <dqetool@126.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18764: server closed the connection unexpectedly
Date: Fri, 10 Jan 2025 10:41:05 +0800 (GMT+08:00)
Message-ID: <40e14bc2.2e9d5.1944e16339d.Coremail.dqetool@126.com> (raw)
In-Reply-To: <CAApHDvp8FAfk4trKMnc+3O0yoyzFjWBs33t6_rx06TZZV0erVA@mail.gmail.com>
References: <18764-63ad667ea26e877a@postgresql.org>
<446342.1735923417@sss.pgh.pa.us>
<468120.1735927103@sss.pgh.pa.us>
<CAMbWs49+-TEOGJmkQVPrEj6eu43ND7GNqccd8OCXxuFQTga1qg@mail.gmail.com>
<CAApHDvpytcc1eVXwB5brsjeppezvi4EJ_vTV+m3yUa2N-zT46A@mail.gmail.com>
<CAMbWs49c7-RbgZ-_6c4HTOS52LJjoGkkdCP7Q1E9yEq=tziR6w@mail.gmail.com>
<CAApHDvp8FAfk4trKMnc+3O0yoyzFjWBs33t6_rx06TZZV0erVA@mail.gmail.com>
Thanks for the quick fix and detailed explanation.
Jason
---- Replied Message ----
| From | David Rowley<dgrowleyml@gmail.com> |
| Date | 1/10/2025 09:36 |
| To | Richard Guo<guofenglinux@gmail.com> |
| Cc | Tom Lane<tgl@sss.pgh.pa.us>,
<dqetool@126.com>,
<pgsql-bugs@lists.postgresql.org> |
| Subject | Re: BUG #18764: server closed the connection unexpectedly |
On Thu, 9 Jan 2025 at 20:38, Richard Guo <guofenglinux@gmail.com> wrote:
On Thu, Jan 9, 2025 at 12:44 PM David Rowley <dgrowleyml@gmail.com> wrote:
Can't you just look up the setop's type from op->colTypes instead of
looking the type up via the sortop? i.e. the attached?
Yeah, right. Using SetOperationStmt.colTypes is more convenient here.
I pushed a revised patch. I removed the check for the sortop. I first
also thought I'd overlooked that, but it turned out that's fine as it
was as standard_qp_callback() handles checking for un-sortable
SortGroupClauses.
Jason, you can expect a fix for this in 17.3. In the meantime, you
could add an explicit cast to numeric in the subquery, e.g:
SELECT c2 AS ca2, c2 AS ca3
FROM t0
UNION
SELECT DISTINCT ca8 AS ca5, ca7::numeric AS ca6
FROM (
SELECT c1 AS ca7, c2 AS ca8 FROM t0
) AS ta1 JOIN (
SELECT c1 AS ca10, c1 AS ca11
FROM t0
) AS ta2 ON TRUE;
Thanks for the report.
David
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: dqetool@126.com, dgrowleyml@gmail.com, guofenglinux@gmail.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18764: server closed the connection unexpectedly
In-Reply-To: <40e14bc2.2e9d5.1944e16339d.Coremail.dqetool@126.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