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.94.2) (envelope-from ) id 1t0C6y-009wzj-LF for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 03:51:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t0C6w-009QXc-7V for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 03:51:10 +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.94.2) (envelope-from ) id 1t0C6v-009QXU-Tr for pgsql-hackers@lists.postgresql.org; Mon, 14 Oct 2024 03:51:10 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0C6t-000lsZ-Jj for pgsql-hackers@lists.postgresql.org; Mon, 14 Oct 2024 03:51:08 +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 49E3owZ13563385; Sun, 13 Oct 2024 23:50:58 -0400 From: Tom Lane To: jian he cc: Pavel Stehule , Christoph Berg , Michael Banck , Tommy Pavlicek , =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , pgsql-hackers@lists.postgresql.org Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR) In-reply-to: References: <560086.1698160614@sss.pgh.pa.us> <570833.1698162135@sss.pgh.pa.us> <66f33840.050a0220.1f9e60.7fb9@mx.google.com> <325394.1727365907@sss.pgh.pa.us> <571930.1727454668@sss.pgh.pa.us> <621972.1727459684@sss.pgh.pa.us> <1092841.1727552736@sss.pgh.pa.us> <2245576.1728418678@sss.pgh.pa.us> <3482022.1728839631@sss.pgh.pa.us> Comments: In-reply-to jian he message dated "Mon, 14 Oct 2024 11:38:47 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3563383.1728877858.1@sss.pgh.pa.us> Date: Sun, 13 Oct 2024 23:50:58 -0400 Message-ID: <3563384.1728877858@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk jian he writes: > So if we are in script_error_callback > `int location = callback_arg->stmt_location;` > location >= 0 will be always true? No, not if the grammar threw an error. regards, tom lane