public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: BUG #19531: Inconsistent Error Messages for the Same SQL Query
Date: Wed, 24 Jun 2026 10:19:52 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Wed, 2026-06-24 at 07:20 +0000, PG Bug reporting form wrote:
> Environment:
> - PostgreSQL version: 18.4
> - Operating System: Ubuntu 22.04
> 
> Context:
> My application relies on the error messages returned by SQL statement
> execution to perform subsequent operations. During development, I discovered
> that the same SQL query can return different error messages . I'm not sure
> if this is a bug, but it does affect my application's ability to reliably
> handle errors.

I would say that this is not a bug.

Your statement contains two errors and it depends on the execution plan
which of the two errors you are hitting first.  If your program reacts
differently based on the exact error, both reactions would be correct,
because both errors are present in the query.

I would compare the situation to an INSERT statement into a table with
two constraints.  Depending on which data are present in the database,
you could hit a constraint violation error for either constraint.

Yours,
Laurenz Albe





view thread (3+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: BUG #19531: Inconsistent Error Messages for the Same SQL Query
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox