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 1oYrHU-000392-Cf for pgsql-general@arkaria.postgresql.org; Thu, 15 Sep 2022 16:00:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYrHS-0003xc-TY for pgsql-general@arkaria.postgresql.org; Thu, 15 Sep 2022 15:59:58 +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 1oYrHS-0003xO-JQ for pgsql-general@lists.postgresql.org; Thu, 15 Sep 2022 15:59:58 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYrHO-0005CL-Dm for pgsql-general@postgresql.org; Thu, 15 Sep 2022 15:59:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 06BA83200AA6; Thu, 15 Sep 2022 11:59:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 15 Sep 2022 11:59:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1663257589; x= 1663343989; bh=t9vLnY4H15ip+S7Mn6VsNUeunJktiEcuUCqZdqbOq9Q=; b=U QLuN9la4VIHFYWXAC4fV2CnGD1qR9+5R/mSwaTqWdcd55p/X1BHqqGlOJTHiHPcR 6DFDx4ZBjiy8UvBPsxy5W7B2p08JIFdE5FK4ZKiBwojjTPUAusc/hhSQM8jf/UtA VuLslIyyvuyeF3SaZ2M3vdaCoTlNxFbS72i7Qu6+IS0sVUgZmmM7aAlfXPY2l+cD 2moF7sS7Si+uBRmuzC1CB6ZSL/aYYqUeAoVCbgEM/tGHXjSaJrkv6UoF3fAiG53r crSmiFBha0Bx4RigFOEq2W2q3tOVZERziB/2TVWB5YDPxQ81uhx8vmZdUAk8Od60 3PNj6f9QmUVSQ89oVAPEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1663257589; x=1663343989; bh=t 9vLnY4H15ip+S7Mn6VsNUeunJktiEcuUCqZdqbOq9Q=; b=i2azO17xJ92ccw7tW 2gXUv+uQcPTnQ391HRa44T4OHXbcwAJ981sA3J++t8IO9YTOr/8YDlfTrx0RsVdF UvaBxBbGn7DgIV2xaV6rLEDYZKlxcIGoJ16FMzPjxEdREmUnffk10Cg1jaMczrsX OUzKjZa0CAhSrKuBG9ipveiXrE9qENM5pWp7S1UVGVukWQcN93in53nezR2hS30A 8gc6IWVd7zHmcdTfItgO+KlWBwMcZEgpi65gR5BJppLs5ebWzG+Raaq90WJ4NwGQ t61tla65FvlGg/CPWRAT132OOBfCMqTzIel+6I+z/wFZQ566vldQTW8fOgYWFgWU LFx7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedukedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpedugfeuleegveffhfegleejhefhtedtgeeileeggfeh fefffeevgeejtdeutefftdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Sep 2022 11:59:48 -0400 (EDT) Message-ID: Date: Thu, 15 Sep 2022 08:59:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: get user info on log Content-Language: en-US To: Marcos Pegoraro , Postgres General References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/13/22 12:45, Marcos Pegoraro wrote: > When using set role or set session authorization and an error occurs I > get user name which logged in and not the one I´ve changed to. > > There is a way to get session_user and current_user on log ? When I do: test(5432)=# set role maura; ERROR: role "maura" does not exist test(5432)=# SET SESSION AUTHORIZATION 'maura'; ERROR: role "maura" does not exist I get: psql-postgres-2022-09-15 08:53:41.204 PDT-0ERROR: role "maura" does not exist psql-postgres-2022-09-15 08:53:41.204 PDT-0STATEMENT: set role maura; psql-postgres-2022-09-15 08:55:26.325 PDT-0ERROR: role "maura" does not exist psql-postgres-2022-09-15 08:55:26.325 PDT-0STATEMENT: SET SESSION AUTHORIZATION 'maura'; in the logs. Are you not seeing that or do you want something different? If you want something different then you will need to provide a more detailed description of what that is. > > Thanks > Marcos -- Adrian Klaver adrian.klaver@aklaver.com