Re: [PATCH] Add pg_get_role_ddl() functions for role recreation - Mailing list pgsql-hackers

From Quan Zongliang
Subject Re: [PATCH] Add pg_get_role_ddl() functions for role recreation
Date
Msg-id e8241421-7adb-4b72-96bd-5bc68b3e70e4@yeah.net
Whole thread Raw
In response to Re: [PATCH] Add pg_get_role_ddl() functions for role recreation  (Bryan Green <dbryan.green@gmail.com>)
List pgsql-hackers

On 11/7/25 12:20 AM, Bryan Green wrote:

>>
> The rebased patch is attached.
> 
> Thanks,
> 
Currently, we have the "CREATE USER" command. Should we consider 
outputting users with the "LOGIN" attribute as "CREATE USER"?
Otherwise, it might look a little strange.

postgres=# CREATE USER testuser;
CREATE ROLE
postgres=# SELECT pg_get_role_ddl('testuser');
                                           pg_get_role_ddl
---------------------------------------------------------------------------------------------------
  CREATE ROLE testuser LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT 
NOREPLICATION NOBYPASSRLS;
(1 row)

The drawback of doing this is that the command "CREATE ROLE xxx LOGIN" 
will be converted to "CREATE USER". But I still think this is better.

Regards,

--
Quan Zongliang




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [Patch] Windows relation extension failure at 2GB and 4GB
Next
From: Peter Smith
Date:
Subject: Re: Skipping schema changes in publication