Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llYP3-0007Un-2G for pgsql-hackers@arkaria.postgresql.org; Tue, 25 May 2021 14:51:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1llYP1-0005zq-W4 for pgsql-hackers@arkaria.postgresql.org; Tue, 25 May 2021 14:51:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llYP1-0005zi-Oe for pgsql-hackers@lists.postgresql.org; Tue, 25 May 2021 14:51:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llYOz-0005KU-OV for pgsql-hackers@postgresql.org; Tue, 25 May 2021 14:51:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 14PEpNX91210611; Tue, 25 May 2021 10:51:23 -0400 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: Replace run-time error check with assertion In-reply-to: <452e9df8-ec89-e01b-b64a-8cc6ce830458@enterprisedb.com> References: <452e9df8-ec89-e01b-b64a-8cc6ce830458@enterprisedb.com> Comments: In-reply-to Peter Eisentraut message dated "Tue, 25 May 2021 11:28:56 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1210609.1621954283.1@sss.pgh.pa.us> Date: Tue, 25 May 2021 10:51:23 -0400 Message-ID: <1210610.1621954283@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > In the attached patch, the error message was checking that the > structures returned from the parser matched expectations. That's > something we usually use assertions for, not a full user-facing error > message. So I replaced that with an assertion (hidden inside > lfirst_node()). Works for me. It's certainly silly to use a translatable ereport rather than elog for this. Localizing those variables some more looks sane too. regards, tom lane