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 1mdahZ-0000tD-Dj for pgsql-general@arkaria.postgresql.org; Thu, 21 Oct 2021 16:13:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mdahY-0001tp-A1 for pgsql-general@arkaria.postgresql.org; Thu, 21 Oct 2021 16:13:56 +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 1mdahW-0001ov-Il for pgsql-general@lists.postgresql.org; Thu, 21 Oct 2021 16:13:56 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdahT-00082C-Ox for pgsql-general@lists.postgresql.org; Thu, 21 Oct 2021 16:13:53 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 911C73201E3D; Thu, 21 Oct 2021 12:13:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 21 Oct 2021 12:13:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=Y 2pRZa4Ovmo8fh6z/2GydEbCV5zulaPtRcv33XaaMZ4=; b=KKKj4TKlxSdPn36gx WpsnVYsAkp0Uy3/PxT//w0MnCcE6HL2cXtILlFLL+di5askGDus7tCjsAkLKxxMh 7jKAZ3HccGVvD3wOPqB4Iv+ldVOp3gA7uYH8cZ/FLya2zLFvVxUJPhaNZhNYtrVy MC5SGMkPWvfWP7sQUMHT0Lxnbh5MCNdolf9xQAYVDIxkUHf4tzSNe+WAZnesQiKU ZJDbSi2fLdVlVoEld2VfSQMFBMbQp7EtOZyberzV/OO/XZGfY8+sFKASi2zT4Ydc xyFC/wf1wRxCwhRlVxk1KHV5o+2LbLcY8AurQGJ0Ukfwv0+OBR1SFYf1cMN/IeCQ KU0hQ== 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=Y2pRZa4Ovmo8fh6z/2GydEbCV5zulaPtRcv33XaaM Z4=; b=fELR+We6QJreFqZRxeGBz/UR/NXk4Cxs/JSBBf+9XL7xNb4HXBIRFOfPW mO6MGo0+vtt532W/TFEwOambxlkN9k7Uvfi7i3PjTGsbY6TVA7TvjS0Rj+M8pV5u Tc6SvpTg3LD/0B0oCUifSSgaXYhfFFCiSnItm5VtGgacg36GTk+lNkbSJBTT/1Qo inN9pk1eES8SVFrFQb7v3aZTn0rf1SDVqkC4bg+ojXjMm2XlzdS1BBdoJoo6AlzA M5tB+DJ3qoiwmtyvnJADK4H/GeoopF0UE+UwnD4DzZfXfM5G270fXwe9cYleOkK6 gcqSnoosNPR9z6eBJCR8VZAalv7ig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddviedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepudfgueelge evfffhgeeljeehhfettdegieelgefgheefffefveegjedtueetffdtnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvh gvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 21 Oct 2021 12:13:48 -0400 (EDT) Message-ID: Date: Thu, 21 Oct 2021 09:13:47 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: Can db user change own password? Content-Language: en-US To: Toomas , Vijaykumar Jain Cc: pgsql-general References: <62f56a19-0504-4d7b-5f73-b10e8206642a@aklaver.com> <7FC82398-5C8C-4F2D-9620-D16E54E77091@gmail.com> From: Adrian Klaver In-Reply-To: <7FC82398-5C8C-4F2D-9620-D16E54E77091@gmail.com> 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 10/21/21 08:39, Toomas wrote: > Hi, > > Basically the case was, when *session_user != current_user* then command > \password failed with error message “ERROR:  permission denied”. All was > good when session_user == current_user. > > In terms of statement “session_user user was set as the owner of the > database automatically” - I have a setup where session_user is changed > automatically as database owner when user logs into database. What I am looking for is a step by step outline that approximates: 1) psql -U 2) The command(s) that set session_user as database owner. 3) The command(s) that make session_user != current_user. 4) Output of: select session_user, current_user; 5) The output of \du for the users involved > > BR, > Toomas > -- Adrian Klaver adrian.klaver@aklaver.com