From: Tom Lane <tgl@sss.pgh.pa.us>
To: buschmann@nidsa.net
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17842: Adding a qual to a working query gets bogus syntax error
Date: Tue, 14 Mar 2023 12:20:46 -0400
Message-ID: <2692255.1678810846@sss.pgh.pa.us> (raw)
In-Reply-To: <17842-0697f895ced573ee@postgresql.org>
References: <17842-0697f895ced573ee@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> During refactoring our application I got a bogus syntax error when adding a
> simple where-clause to a working query.
My guess is that this:
> ('0'||split_part(split_part(nline,'(',2),')',1))::smallint as nlen
sometimes produces a string that fails to cast to smallint, which you
accidentally don't notice because it never gets evaluated for troublesome
values of nline --- until you add the "nlen > 0" condition. There isn't
anything in your query that prevents that from being evaluated fairly
early.
This isn't a bug, or at least you have provided no data that would
motivate (or indeed allow) anyone else to poke into it more closely.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, buschmann@nidsa.net, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17842: Adding a qual to a working query gets bogus syntax error
In-Reply-To: <2692255.1678810846@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