Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jCrlw-0007ao-Oe for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2020 21:23:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jCrlv-0005Wu-Dn for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2020 21:23:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jCrlu-0005Wm-3t for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2020 21:23:11 +0000 Received: from [64.147.123.24] (helo=wout1-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jCrlq-0004kF-SH for pgsql-hackers@postgresql.org; Fri, 13 Mar 2020 21:23:08 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4B807613; Fri, 13 Mar 2020 17:22:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 13 Mar 2020 17:22:55 -0400 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=fm2; bh=4M/oNzD3ULrdhPUS22QT+qNkQAPUE0UaAVV12aJoC P4=; b=A4kfzKnQlYMzEoJ79ir6X8H0xtLV4Utht22ky8odmhJnE96mmWtZbcE1K JbB6Anl1z/BZ0VJAWJjXKv/f7I3tB1jLIj5VkXw9YYgEbWVIsncFm8U/xhoNsMfO PhZ2gJpaeABMEOhdpV4ArT0Lp2TroIlDmZewcazyG4S6WFLCrLIi9yZHM/MLmtbR UpBZZvJnLF2dJnrX70K0UnGW+WEwR3FFpGW4ep5oNPI4tJDyoh9Rkc8KqcPjY154 k/77+W55j8nvD8/sT/XIYHObPdSA/7ZSOng5Hl2tJGAWo6GBhTpySHlaIrwKGRsq 0Y5D398K9EJY8ufNrYZwRtv1ITjrw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvjedgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnh guqhhurggurhgrnhhtrdgtohhmqeenucffohhmrghinhepvdhnughquhgrughrrghnthdr tghomhenucfkphepleefrddvgedvrddvudefrddvgedunecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht sedvnhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5df2d5f1.dip0.t-ipconnect.de [93.242.213.241]) by mail.messagingengine.com (Postfix) with ESMTPA id 6B4F43061363; Fri, 13 Mar 2020 17:22:53 -0400 (EDT) Subject: Re: backend type in log_line_prefix? To: Justin Pryzby , Fujii Masao References: <20200213091428.GA15600@nol> <20200310190142.GB29065@telsasoft.com> <20200311185354.GW29065@telsasoft.com> Cc: Julien Rouhaud , pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Fri, 13 Mar 2020 22:22:52 +0100 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 In-Reply-To: <20200311185354.GW29065@telsasoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.24 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-03-11 19:53, Justin Pryzby wrote: > Can I suggest: > > $ git diff > diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c > index 3a6f7f9456..56e0a1437e 100644 > --- a/src/backend/utils/error/elog.c > +++ b/src/backend/utils/error/elog.c > @@ -2945,7 +2945,7 @@ write_csvlog(ErrorData *edata) > if (MyProcPid == PostmasterPid) > appendCSVLiteral(&buf, "postmaster"); > else if (MyBackendType == B_BG_WORKER) > - appendCSVLiteral(&buf, MyBgworkerEntry->bgw_type); > + appendCSVLiteral(&buf, MyBgworkerEntry->bgw_name); > else > appendCSVLiteral(&buf, pgstat_get_backend_desc(MyBackendType)); The difference is intentional. bgw_type is so that you can filter and group by type. The bgw_name could be totally different for each instance. Having the bgw name available somehow would perhaps also be useful, but then we should also do this in a consistent way for processes that are not background workers, such as regular client backends or wal senders or autovacuum workers. Doing it just for background workers would create inconsistencies that the introduction of bgw_type some time ago sought to eliminate. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services