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 1suEoU-005Hbz-9L for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 17:31:30 +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 1suEoS-00CXq8-Jt for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 17:31:28 +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 1suEoS-00CXpz-AG for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 17:31:28 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1suEoL-001Lsm-HI for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 17:31:27 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1470:d7a0:cdb3:ed:178:ed8b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 4XFcvW2fn1z3F6y; Fri, 27 Sep 2024 19:31:19 +0200 (CEST) Date: Fri, 27 Sep 2024 19:31:19 +0200 From: Christoph Berg To: Tom Lane Cc: Michael Banck , Tommy Pavlicek , Dagfinn Ilmari =?iso-8859-1?Q?Manns=E5ker?= , pgsql-hackers@lists.postgresql.org, jian.universality@gmail.com Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR) Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <571930.1727454668@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Tom Lane > Perhaps. I spent a little more effort on this and added code to > report errors that don't come with an error location. On those, > we don't have any constraints about what to report in the QUERY > field, so I made it trim the string to just the current query > within the script, which makes things quite a bit better. You > can see the results in the test_extensions regression test changes. That looks very good me, thanks! > (It might be worth some effort to trim away comments appearing > just before a command, but I didn't tackle that here.) The "error when psql" comments do look confusing, but I guess in other places the comment just before the query adds valuable context, so I'd say leaving the comments in is ok. Christoph