From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: roji@roji.org
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19778: Empty tsquery cannot roundtrip through binary input
Date: Thu, 22 Oct 2026 13:34:58 -0400
Message-ID: <2537307.1792690498@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJTYsWW2ESUM2km5sAMoMHRXREkKWa7o-f5U363m2NSOabJunw@mail.gmail.com>
References: <19778-1befc1fba593ab1b@postgresql.org>
<CAJTYsWW2ESUM2km5sAMoMHRXREkKWa7o-f5U363m2NSOabJunw@mail.gmail.com>
Ayush Tiwari <ayushtiwari.slg01@gmail.com> writes:
> On Thu, 22 Oct 2026 at 11:58, PG Bug reporting form
> <noreply@postgresql.org> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, ayushtiwari.slg01@gmail.com, roji@roji.org
Subject: Re: BUG #19778: Empty tsquery cannot roundtrip through binary input
In-Reply-To: <2537307.1792690498@sss.pgh.pa.us>
References: <19778-1befc1fba593ab1b@postgresql.org> <CAJTYsWW2ESUM2km5sAMoMHRXREkKWa7o-f5U363m2NSOabJunw@mail.gmail.com> <2537307.1792690498@sss.pgh.pa.us>
* 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