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 1jtSgh-0001kT-SO for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2020 09:17:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtSgf-0001NG-NJ for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2020 09:17:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtSgf-0001N9-0d for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2020 09:17:49 +0000 Received: from [66.111.4.238] (helo=forward4-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtSgb-0000zn-JX for pgsql-hackers@postgresql.org; Thu, 09 Jul 2020 09:17:47 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id B8C1719410EE for ; Thu, 9 Jul 2020 05:17:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 09 Jul 2020 05:17:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=zFpqEqdpnp8R6sZ+jhgKcAkVDHu1l aCnyDKZSeLr+4I=; b=XaoofckjS/m9Run0VxtUpvi/No9nRvjbwIknjo36gclrg NRI2pWc9b4r1cXMz3auSfbaR5TjfsUBl2kR3VUE7ukXwe1a2znHQVwEwZYl/+d/Y on9wsiIt87rUmzJThOXUS7MQZnByUMie2s3/jzlLKtsMHz+r0OP9o96cDSv4AFgk a1vqz5fu+YM6zXerNroLdk6W+TPYs4TT9avxfippkYMAWDJUqvG5gj5WHEr9ElDK EBLtmG/4/9Jr1TtVeBnZMEjCoj2ngtgVX3CLBgX15tADjdwU7ML2OAJVIVFhoAfx UWc82ZwJ+9cmW05YR7HpydDI0Hva5HJxxZTi12FcA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudelgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepvffhufhokffffgggtgesmhdtreertd efjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghi shgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhmqeenucggtffrrghtthgvrh hnpeekieelleeftddtleetkeevgfehhfdviefgudetjedtueeugfffvdeltefhfeeuvden ucffohhmrghinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrddvgeefrd duledurddvfeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtoh hm X-ME-Proxy: Received: from april.pezone.net (p5df3bfee.dip0.t-ipconnect.de [93.243.191.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 0D8F230600A9 for ; Thu, 9 Jul 2020 05:17:33 -0400 (EDT) To: pgsql-hackers From: Peter Eisentraut Subject: Log the location field before any backtrace Organization: 2ndQuadrant Message-ID: <90f5fa04-c410-a54e-9449-aa3749fb7972@2ndquadrant.com> Date: Thu, 9 Jul 2020 11:17:32 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------96DA0C909360F6BB5FD8BBB3" Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.238 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------96DA0C909360F6BB5FD8BBB3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit In PG13, we added the ability to add backtraces to the log output. After some practical experience with it, I think the order in which the BACKTRACE and the LOCATION fields are printed is wrong. I propose we put the LOCATION field before the BACKTRACE field, not after. This makes more sense because the location is effectively at the lowest level of the backtrace. Patch attached. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --------------96DA0C909360F6BB5FD8BBB3 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="0001-Log-the-location-field-before-any-backtrace.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-Log-the-location-field-before-any-backtrace.patch" RnJvbSBhYWY0YTgxNDZjZjYwYTU5NTllNTA0MzIzNTlmZDk5NzJmNDEwZTFiIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBFaXNlbnRyYXV0IDxwZXRlckBlaXNlbnRy YXV0Lm9yZz4KRGF0ZTogVGh1LCA5IEp1bCAyMDIwIDExOjAwOjM0ICswMjAwClN1YmplY3Q6 IFtQQVRDSF0gTG9nIHRoZSBsb2NhdGlvbiBmaWVsZCBiZWZvcmUgYW55IGJhY2t0cmFjZQoK VGhpcyBvcmRlciBtYWtlcyBtb3JlIHNlbnNlIGJlY2F1c2UgdGhlIGxvY2F0aW9uIGlzIGVm ZmVjdGl2ZWx5IGF0IHRoZQpsb3dlc3QgbGV2ZWwgb2YgdGhlIGJhY2t0cmFjZS4KLS0tCiBz cmMvYmFja2VuZC91dGlscy9lcnJvci9lbG9nLmMgfCAxNCArKysrKysrLS0tLS0tLQogMSBm aWxlIGNoYW5nZW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