Re: BUG #18764: server closed the connection unexpectedly

From: dqetool <dqetool(at)126(dot)com>
To: "David Rowley" <dgrowleyml(at)gmail(dot)com>
Cc: "Richard Guo" <guofenglinux(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18764: server closed the connection unexpectedly
Date: 2025-01-10 02:41:05
Message-ID: 40e14bc2.2e9d5.1944e16339d.Coremail.dqetool@126.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for the quick fix and detailed explanation.

Jason
---- Replied Message ----
| From | David Rowley<dgrowleyml(at)gmail(dot)com> |
| Date | 1/10/2025 09:36 |
| To | Richard Guo<guofenglinux(at)gmail(dot)com> |
| Cc | Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us>,
<dqetool(at)126(dot)com>,
<pgsql-bugs(at)lists(dot)postgresql(dot)org> |
| Subject | Re: BUG #18764: server closed the connection unexpectedly |
On Thu, 9 Jan 2025 at 20:38, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:

On Thu, Jan 9, 2025 at 12:44 PM David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2025-01-10 08:00:55 Re: BUG #18769: ldapscheme is not displayed in pg_hba_file_rules
Previous Message PG Bug reporting form 2025-01-10 01:49:08 BUG #18770: The function 'packGraph ' causes a memory leak.