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.96) (envelope-from ) id 1wcIq1-003FN8-2a for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jun 2026 08:20:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcIq0-00G8Ly-2N for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jun 2026 08:20:00 +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.96) (envelope-from ) id 1wcIq0-00G8Lq-1U for pgsql-bugs@lists.postgresql.org; Wed, 24 Jun 2026 08:20:00 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcIpy-00000001tAb-32Qv for pgsql-bugs@lists.postgresql.org; Wed, 24 Jun 2026 08:19:59 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-49249072f03so4123265e9.0 for ; Wed, 24 Jun 2026 01:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1782289197; x=1782893997; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=IyfrvNTPVBVcNnS2lvoxbcWUzmjezn5BcOKlHEzjD1A=; b=SKCencqikq5OV2C/f9KkHqJ/kCz035RHnIaapdAZDom5Q3FBrzbBrSdBGB0t/nX5zF zVMWcDZFox01g1Xy4YYZMF36+SAzVdLhZWtMbo4t8A89r+3tUJtMFjQiavTu72SDiPj1 NCKQhK5WFfbHw54D3QqQTGM7Bn7UyAcd25kgpp4pYTIw2YAYjQMV+nvEb4uY6Oz6kcyp AUDWh3RSIBW6DNGAPso92ZDq+T6JCdQD//JkOwbAtbksc5yishxdUUWja0hUnkkpDIWv gkJ0NKBDdB2wcu7deTKy+D8do0JyAEkHf8uZwqQPZD4U+ve1QyR5oLyopdFjWVxzoHJD qWrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782289197; x=1782893997; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IyfrvNTPVBVcNnS2lvoxbcWUzmjezn5BcOKlHEzjD1A=; b=e9NpaezDXl6uZxB0b1T3TGVc8JDQ01ceUVw4ZxqQDBUd9gcaM8jLMzWlpzD/yeG0Lo pe53FJZ6+O1JroamLTi+BOvDyugnbcKMyLujObAd31mbRggIAVR63gaiJkoPwrkfUMKV M7YoDzoVs1A+YxnWIUu/muCq0YL0+rH5d2gUxvkdDSkcncM+iz5H9zIPe62+G/gttCf+ 1KFrcWmNUnWai/rHNZxjrWeMXqI6Wm0iwQdwNjihWokNmmC/j0L4Ga6gYJwDRs7gcN8u lcpyjSDnU+uuoond4aUqyspnVIUka46LcgQZv4iO0xct9v96z+WYeSRfgopIXyMSaOft ojnw== X-Forwarded-Encrypted: i=1; AFNElJ9cO0Cr8riLA1+ujOYHRs2ZgczbrTiDsvprCBXbwqKqFYFndXTMlfHfsuBRvoQmPmiSfNBBw7IT46tP@lists.postgresql.org X-Gm-Message-State: AOJu0YyFoDQNXr1L/PfB/ePZm7yR3Wnul38Q6q47EKVXAhEqsX61ytbH 3xPMKQlTg6WeGPrUEP7pJ+VOXSQ07KJ3PPw3BhMW/cj9K0yLEH+19vbsz0eCgsZ7XQY= X-Gm-Gg: AfdE7ckPZ/9Xvm2sm/aSfUtfmZE45Q5m+KPJohd7GVR0fADbgnxIl+CiGNNrR8kFmHu GWKIQs3Svtoqz2OXJGi3m1FRv/v0wftnnHVMigowTByU3NTxg+0FTITPCbPu6CMVBgxW6cjwwvI fYoOzuEbLGB65P/tMfPj4lP9OmxoJTGve5gvkHfgdhSgxdCgrs0lIH3hAYlii7IlNaY47Kl4bmN awL2ylpWs2csblAOWlhqY3u9QxinmqLf+Vjz9z0zVLO/+GRAcgbqfPxvoA1aRvc88CipQ7yR3Ni cSi+sFgQD3mp972tLXTtL8tFt8PQYtlcMs5O/gn6xDZuyl7HbvfgSD8GeQkHEFVLhw4wrdp97+N yntujjZU5/BnJ8fThxYfCiCDNsjHZicomKWg916Eplq1YbmIYJirmtAJeopqQeHiUkb5GarVTiB bqE/F/IlyM7WZJ X-Received: by 2002:a05:600c:4686:b0:490:be14:bfda with SMTP id 5b1f17b1804b1-492608495e9mr28861025e9.6.1782289196640; Wed, 24 Jun 2026 01:19:56 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([213.208.157.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46c2279b734sm4454386f8f.30.2026.06.24.01.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 01:19:56 -0700 (PDT) Message-ID: <51f55cfd0fc2e8f7534b486ffa55acfce912253c.camel@cybertec.at> Subject: Re: BUG #19531: Inconsistent Error Messages for the Same SQL Query From: Laurenz Albe To: 1804981203@qq.com, pgsql-bugs@lists.postgresql.org Date: Wed, 24 Jun 2026 10:19:52 +0200 In-Reply-To: <19531-f13c547b30872910@postgresql.org> References: <19531-f13c547b30872910@postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2026-06-24 at 07:20 +0000, PG Bug reporting form wrote: > Environment=EF=BC=9A > - PostgreSQL version: 18.4 > - Operating System: Ubuntu 22.04 >=20 > Context=EF=BC=9A > My application relies on the error messages returned by SQL statement > execution to perform subsequent operations. During development, I discove= red > that the same SQL query can return different error messages . I'm not sur= e > 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