From a82f58a8f40ccf8d9991f8e782fb526c1c4db5f7 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Fri, 5 Feb 2016 15:51:27 +0530 Subject: [PATCH] Resolved an internal server error while selecting the role node on PostgreSQL/PPAS server (version >= 9.5). Reported by: Akshay Joshi --- .../roles/templates/role/sql/post9_4/properties.sql | 2 +- .../servers/roles/templates/role/sql/post9_4/sql.sql | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/properties.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/properties.sql index bb56ec438..80aee3774 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/properties.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/properties.sql @@ -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 diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/sql.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/sql.sql index 81fe40bc8..3f7bb0445 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/sql.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/sql.sql @@ -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