Re: [PATCH] Add pg_get_role_ddl() functions for role recreation

Поиск
Список
Период
Сортировка
От Quan Zongliang
Тема Re: [PATCH] Add pg_get_role_ddl() functions for role recreation
Дата
Msg-id e8241421-7adb-4b72-96bd-5bc68b3e70e4@yeah.net
обсуждение исходный текст
Ответ на Re: [PATCH] Add pg_get_role_ddl() functions for role recreation  (Bryan Green <dbryan.green@gmail.com>)
Список 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 по дате отправления: