Resolved an internal server error while selecting the role node on
PostgreSQL/PPAS server (version >= 9.5). Reported by: Akshay Joshipull/3/head
parent
a0648ed54b
commit
a82f58a8f4
|
@ -7,7 +7,7 @@ SELECT
|
||||||
FROM
|
FROM
|
||||||
(SELECT * FROM pg_auth_members WHERE member = r.oid) am
|
(SELECT * FROM pg_auth_members WHERE member = r.oid) am
|
||||||
LEFT JOIN pg_catalog.pg_roles rm ON (rm.oid = am.roleid)
|
LEFT JOIN pg_catalog.pg_roles rm ON (rm.oid = am.roleid)
|
||||||
) rolmembership,
|
) AS rolmembership,
|
||||||
(SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=r.oid) AS seclabels
|
(SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=r.oid) AS seclabels
|
||||||
FROM
|
FROM
|
||||||
{{ role_tbl }} r
|
{{ role_tbl }} r
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SELECT
|
SELECT
|
||||||
array_to_string(array_agg(sql), E'\n\n')
|
array_to_string(array_agg(sql), E'\n\n') AS sql
|
||||||
FROM
|
FROM
|
||||||
(SELECT
|
(SELECT
|
||||||
CASE WHEN rolcanlogin THEN '-- User: ' ELSE '-- Role: ' END ||
|
CASE WHEN rolcanlogin THEN '-- User: ' ELSE '-- Role: ' END ||
|
||||||
|
@ -24,11 +24,11 @@ WHERE
|
||||||
r.oid=%(rid)s::OID
|
r.oid=%(rid)s::OID
|
||||||
UNION ALL
|
UNION ALL
|
||||||
(SELECT
|
(SELECT
|
||||||
array_to_string(array_agg(sql), E'\n')
|
array_to_string(array_agg(sql), E'\n') AS sql
|
||||||
FROM
|
FROM
|
||||||
(SELECT
|
(SELECT
|
||||||
'GRANT ' || array_to_string(array_agg(rolname), ', ') || ' TO ' || pg_catalog.quote_ident(pg_get_userbyid(%(rid)s::OID)) ||
|
'GRANT ' || array_to_string(array_agg(rolname), ', ') || ' TO ' || pg_catalog.quote_ident(pg_get_userbyid(%(rid)s::OID)) ||
|
||||||
CASE WHEN admin_option THEN ' WITH ADMIN OPTION;' ELSE ';' END sql
|
CASE WHEN admin_option THEN ' WITH ADMIN OPTION;' ELSE ';' END AS sql
|
||||||
FROM
|
FROM
|
||||||
(SELECT
|
(SELECT
|
||||||
quote_ident(r.rolname) AS rolname, m.admin_option AS admin_option
|
quote_ident(r.rolname) AS rolname, m.admin_option AS admin_option
|
||||||
|
@ -43,7 +43,7 @@ FROM
|
||||||
GROUP BY admin_option) s)
|
GROUP BY admin_option) s)
|
||||||
UNION ALL
|
UNION ALL
|
||||||
(SELECT
|
(SELECT
|
||||||
array_to_string(array_agg(sql), E'\n') sql
|
array_to_string(array_agg(sql), E'\n') AS sql
|
||||||
FROM
|
FROM
|
||||||
(SELECT
|
(SELECT
|
||||||
'ALTER ' || CASE WHEN rolcanlogin THEN 'USER ' ELSE 'ROLE ' END || pg_catalog.quote_ident(rolname) || ' SET ' || param || ' TO ' || CASE WHEN param IN ('search_path', 'temp_tablespaces') THEN value ELSE quote_literal(value) END || ';' AS sql
|
'ALTER ' || CASE WHEN rolcanlogin THEN 'USER ' ELSE 'ROLE ' END || pg_catalog.quote_ident(rolname) || ' SET ' || param || ' TO ' || CASE WHEN param IN ('search_path', 'temp_tablespaces') THEN value ELSE quote_literal(value) END || ';' AS sql
|
||||||
|
|
Loading…
Reference in New Issue