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 1mo0y2-0007Ft-R1 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 10:18:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mo0y1-00077A-Rp for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 10:18:01 +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 1mo0y1-00076r-Hd for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 10:18:01 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo0xu-0005my-1V for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 10:18:01 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 87C365C0131; Fri, 19 Nov 2021 05:17:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 19 Nov 2021 05:17:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=LhjLkqKPaK2CnJP9p6I8rTV0+B2rvfLw6lljLez2i bk=; b=mSr0ES11dahnTQ9ZA55ipopryyPSvp7jL6XSqa6kuhBFyo+dcuCSdhElE DyUHaM6QmTuCzO+gHqgVuJ0U8yygEvHZ++OjMWHwfcouYb5j2sr5QZO+szeaUih9 p23vQ/E8WvGQ0fJd/7cvxLfAPC3MXxky+cMsuD/5bXgwLbVwT3dVElBP6vTe15cs kRa10RH3GzN9JSRh2R9a0k+FWFeibjvQxM+AauBAX2VyEAl049G/ahheRToX/+Pj ubWRcbvLCzhQyScECtZD3SXqLeH7sNmYRN3ecJv077Fv3Vv06ofA8l4K3r8PJGpe w8d2/IJ0Ko3tCEV5+n0uCyaYjCZYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeekgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefjeegheetuefhveevudel ueeftdejteeiffetvdduhfdtieefgfeutedtveeggfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Nov 2021 05:17:51 -0500 (EST) Message-ID: Date: Fri, 19 Nov 2021 11:17:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: Frontend error logging style Content-Language: en-US To: Robert Haas , Michael Paquier Cc: Tom Lane , PostgreSQL Hackers References: <1363732.1636496441@sss.pgh.pa.us> <632f02ed-12ac-b91f-0e99-9c1b086f8cd0@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 16.11.21 16:18, Robert Haas wrote: > I think we need frontend facilities that look like the backend > facilities, so try/catch blocks, on-exit callbacks, and whatever else > there is. Otherwise code reuse is going to continue to be annoying. If people want to do that kind of thing (I'm undecided whether the complexity is worth it), then make it a different API. The pg_log_* calls are for writing formatted output. They normalized existing hand-coded patterns at the time. We can wrap another API on top of them that does flow control and output. The pg_log_* stuff is more on the level of syslog(), which also just outputs stuff. Nobody is suggesting that syslog(LOG_EMERG) should exit the program automatically. But you can wrap higher-level APIs such as ereport() on top of that that might do that.