Resolved an internal server error while selecting the role node on

PostgreSQL/PPAS server (version >= 9.5).

Reported by: Akshay Joshi
pull/3/head
Ashesh Vashi 2016-02-05 15:51:27 +05:30
parent a0648ed54b
commit a82f58a8f4
2 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ SELECT
FROM
(SELECT * FROM pg_auth_members WHERE member = r.oid) am
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
FROM
{{ role_tbl }} r

View File

@ -1,5 +1,5 @@
SELECT
array_to_string(array_agg(sql), E'\n\n')
array_to_string(array_agg(sql), E'\n\n') AS sql
FROM
(SELECT
CASE WHEN rolcanlogin THEN '-- User: ' ELSE '-- Role: ' END ||
@ -24,11 +24,11 @@ WHERE
r.oid=%(rid)s::OID
UNION ALL
(SELECT
array_to_string(array_agg(sql), E'\n')
array_to_string(array_agg(sql), E'\n') AS sql
FROM
(SELECT
'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
(SELECT
quote_ident(r.rolname) AS rolname, m.admin_option AS admin_option
@ -43,7 +43,7 @@ FROM
GROUP BY admin_option) s)
UNION ALL
(SELECT
array_to_string(array_agg(sql), E'\n') sql
array_to_string(array_agg(sql), E'\n') AS sql
FROM
(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