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 1xRYg2-00000001509-0nQx for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2026 17:33:34 +0000 Received: from localhost ([127.0.0.1]:56530 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xRYg1-000000045PM-0cX8 for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2026 17:33:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:39192) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRYg0-000000045PA-3gi0 for pgsql-bugs@lists.postgresql.org; Thu, 12 Nov 2026 17:33:32 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRYfy-00000000iFk-2v1T for pgsql-bugs@lists.postgresql.org; Thu, 12 Nov 2026 17:33:32 +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 6ACHXSs9045964; Thu, 12 Nov 2026 12:33:28 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6ACHXSs9045964 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1794504808; bh=IZ5SLn4CeECPr+2+NLTwzJ/ieRNv6ylrPfs39T9Bh2c=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=eMe1n78YHRgjw8msMgL7RiWsA3+KvTPWFU8J0hhKc9Cdd9Ve5Wun++1I/3WxvPJoO OYhU76fEk5jEQ+rBT2KsWuOFfvUFqB+ci+3Y+JTSShK8muQIshV/ER8PWJn/ucWW7i JqsiHZuyY5MamHiGot23LtgSMFZYPmFDXztuXkPY= From: Tom Lane To: imchifan8@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19885: pg_input_is_valid(tsquery) throws stack depth error instead of returning false In-reply-to: <19885-741df1acb48cdad1@postgresql.org> References: <19885-741df1acb48cdad1@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 11 Nov 2026 14:37:34 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <45962.1794504808.1@sss.pgh.pa.us> Date: Thu, 12 Nov 2026 12:33:28 -0500 Message-ID: <45963.1794504808@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > pg_input_is_valid() throws SQLSTATE 54001 while validating a deeply > parenthesized tsquery when max_stack_depth is 100kB. I do not think this is a bug. pg_input_is_valid() does not promise to avoid throwing a hard error for resource-exhaustion cases. As a counterexample, if you hit OOM while constructing the input string, it'd fail before ever reaching pg_input_is_valid(). Also, if we were to accept this as a case that should be handled, there are many many more in the same class. regards, tom lane