Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xJwgx-00000000Wiu-1QDZ for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Oct 2026 17:35:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xJwgw-0000000CjW0-2b9D for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Oct 2026 17:35:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xJwgw-0000000CjVs-1Y2r for pgsql-bugs@lists.postgresql.org; Thu, 22 Oct 2026 17:35:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xJwgu-00000000RLK-31Jj for pgsql-bugs@lists.postgresql.org; Thu, 22 Oct 2026 17:35:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 69MHYwKp2537308; Thu, 22 Oct 2026 13:34:58 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 69MHYwKp2537308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1792690498; bh=Xbohf72MPwHo9hG6w1b75Wyr2B4TPEnjl5Wa1SpaHxI=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=Q/EqSJ3ngd3YbT2yN4KOggo0qDkNmKjJ7DSXxN1WHZ4TOihvuT1105mk+vA32DAdS V0CesnW4gr3OCNiZbf40ZM6EPfZW3KQYIMSlZOcFBTg06ViHEZSIWv7qf4z1v/HEyL GHq+bNdeTCfmJKrl+Bt7hhQXZZOIdxJ5pPoNRQDU= From: Tom Lane To: Ayush Tiwari cc: roji@roji.org, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19778: Empty tsquery cannot roundtrip through binary input In-reply-to: References: <19778-1befc1fba593ab1b@postgresql.org> Comments: In-reply-to Ayush Tiwari message dated "Thu, 22 Oct 2026 22:22:37 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2537306.1792690498.1@sss.pgh.pa.us> Date: Thu, 22 Oct 2026 13:34:58 -0400 Message-ID: <2537307.1792690498@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ayush Tiwari writes: > On Thu, 22 Oct 2026 at 11:58, PG Bug reporting form > wrote: >> It appears that an empty binary tsquery cannot be written to PostgreSQL. > Thanks for the report, I can reproduce this on master too. Yeah, you can duplicate it without extra moving parts using binary COPY out and then in. > tsqueryrecv() calls findoprnd() even for an empty query, and that > fails with "malformed tsquery: operand not found". The text input > doesn't have this problem since parse_tsquery() returns early for an > empty query. > Attached is a patch that skips findoprnd() when size is 0. +1, will push. regards, tom lane