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 1nZb3J-0001hb-Q7 for pgsql-general@arkaria.postgresql.org; Wed, 30 Mar 2022 16:20:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZb3I-00074a-Of for pgsql-general@arkaria.postgresql.org; Wed, 30 Mar 2022 16:20:08 +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 1nZb3I-00074O-Do for pgsql-general@lists.postgresql.org; Wed, 30 Mar 2022 16:20:08 +0000 Received: from brisi.sourcepole.ch ([5.9.57.43]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZb3F-0002e7-QP for pgsql-general@lists.postgresql.org; Wed, 30 Mar 2022 16:20:08 +0000 Received: from [213.55.221.97] (helo=[192.168.43.81]) by vilan-mail with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nZb3D-0002oj-J8; Wed, 30 Mar 2022 18:20:03 +0200 Message-ID: <3cd1d627-bfe4-9112-0327-2549909f750f@sourcepole.ch> Date: Wed, 30 Mar 2022 18:19:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Reg: User creation script/List of privileges Content-Language: en-GB To: Sai Ch , pgsql-general@lists.postgresql.org References: From: Tomas Pospisek 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 30.03.22 05:09, Sai Ch wrote: > Hi Experts, > > I am looking for a query or possibility to generate all the privileges a > user/role has. > > I need this to create a user/role from one database to another with > exact same privileges. > > Kindly, share the query or way to proceed further. > > Thanks & Regards, Maybe have a look at https://github.com/tpo/little_shell_scripts/blob/master/psql_access_priv_decoder