|
|
@ -736,28 +736,31 @@ dumpRoles(PGconn *conn) |
|
|
|
i_is_current_user; |
|
|
|
i_is_current_user; |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
|
|
/* note: rolconfig is dumped later */ |
|
|
|
/*
|
|
|
|
|
|
|
|
* Notes: rolconfig is dumped later, and pg_authid must be used for |
|
|
|
|
|
|
|
* extracting rolcomment regardless of role_catalog. |
|
|
|
|
|
|
|
*/ |
|
|
|
if (server_version >= 90600) |
|
|
|
if (server_version >= 90600) |
|
|
|
printfPQExpBuffer(buf, |
|
|
|
printfPQExpBuffer(buf, |
|
|
|
"SELECT oid, rolname, rolsuper, rolinherit, " |
|
|
|
"SELECT oid, rolname, rolsuper, rolinherit, " |
|
|
|
"rolcreaterole, rolcreatedb, " |
|
|
|
"rolcreaterole, rolcreatedb, " |
|
|
|
"rolcanlogin, rolconnlimit, rolpassword, " |
|
|
|
"rolcanlogin, rolconnlimit, rolpassword, " |
|
|
|
"rolvaliduntil, rolreplication, rolbypassrls, " |
|
|
|
"rolvaliduntil, rolreplication, rolbypassrls, " |
|
|
|
"pg_catalog.shobj_description(oid, '%s') as rolcomment, " |
|
|
|
"pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, " |
|
|
|
"rolname = current_user AS is_current_user " |
|
|
|
"rolname = current_user AS is_current_user " |
|
|
|
"FROM %s " |
|
|
|
"FROM %s " |
|
|
|
"WHERE rolname !~ '^pg_' " |
|
|
|
"WHERE rolname !~ '^pg_' " |
|
|
|
"ORDER BY 2", role_catalog, role_catalog); |
|
|
|
"ORDER BY 2", role_catalog); |
|
|
|
else if (server_version >= 90500) |
|
|
|
else if (server_version >= 90500) |
|
|
|
printfPQExpBuffer(buf, |
|
|
|
printfPQExpBuffer(buf, |
|
|
|
"SELECT oid, rolname, rolsuper, rolinherit, " |
|
|
|
"SELECT oid, rolname, rolsuper, rolinherit, " |
|
|
|
"rolcreaterole, rolcreatedb, " |
|
|
|
"rolcreaterole, rolcreatedb, " |
|
|
|
"rolcanlogin, rolconnlimit, rolpassword, " |
|
|
|
"rolcanlogin, rolconnlimit, rolpassword, " |
|
|
|
"rolvaliduntil, rolreplication, rolbypassrls, " |
|
|
|
"rolvaliduntil, rolreplication, rolbypassrls, " |
|
|
|
"pg_catalog.shobj_description(oid, '%s') as rolcomment, " |
|
|
|
"pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, " |
|
|
|
"rolname = current_user AS is_current_user " |
|
|
|
"rolname = current_user AS is_current_user " |
|
|
|
"FROM %s " |
|
|
|
"FROM %s " |
|
|
|
"ORDER BY 2", role_catalog, role_catalog); |
|
|
|
"ORDER BY 2", role_catalog); |
|
|
|
else |
|
|
|
else |
|
|
|
printfPQExpBuffer(buf, |
|
|
|
printfPQExpBuffer(buf, |
|
|
|
"SELECT oid, rolname, rolsuper, rolinherit, " |
|
|
|
"SELECT oid, rolname, rolsuper, rolinherit, " |
|
|
@ -765,10 +768,10 @@ dumpRoles(PGconn *conn) |
|
|
|
"rolcanlogin, rolconnlimit, rolpassword, " |
|
|
|
"rolcanlogin, rolconnlimit, rolpassword, " |
|
|
|
"rolvaliduntil, rolreplication, " |
|
|
|
"rolvaliduntil, rolreplication, " |
|
|
|
"false as rolbypassrls, " |
|
|
|
"false as rolbypassrls, " |
|
|
|
"pg_catalog.shobj_description(oid, '%s') as rolcomment, " |
|
|
|
"pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, " |
|
|
|
"rolname = current_user AS is_current_user " |
|
|
|
"rolname = current_user AS is_current_user " |
|
|
|
"FROM %s " |
|
|
|
"FROM %s " |
|
|
|
"ORDER BY 2", role_catalog, role_catalog); |
|
|
|
"ORDER BY 2", role_catalog); |
|
|
|
|
|
|
|
|
|
|
|
res = executeQuery(conn, buf->data); |
|
|
|
res = executeQuery(conn, buf->data); |
|
|
|
|
|
|
|
|
|
|
|