From 46d4bf027d1ed4bffe9e5fd26bb61b22dfddcfac Mon Sep 17 00:00:00 2001 From: Joao De Almeida Pereira Date: Fri, 17 Aug 2018 14:50:16 +0530 Subject: [PATCH] Ensure sql for Role should be visible in SQL panel for GPDB. Fixes #3578 --- docs/en_US/release_notes_3_3.rst | 1 + .../roles/templates/role/sql/post8_4/sql.sql | 29 ------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/docs/en_US/release_notes_3_3.rst b/docs/en_US/release_notes_3_3.rst index a421f4eeb..d64bed324 100644 --- a/docs/en_US/release_notes_3_3.rst +++ b/docs/en_US/release_notes_3_3.rst @@ -18,3 +18,4 @@ Bug fixes | `Bug #3407 `_ - Fix keyboard shortcuts layout in the preferences panel. | `Bug #3461 `_ - Ensure that refreshing a node also updates the Property list. | `Bug #3528 `_ - Handle connection errors properly in the query tool. +| `Bug #3578 `_ - Ensure sql for Role should be visible in SQL panel for GPDB. diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql index 642009e04..d3cb081bb 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql @@ -59,35 +59,6 @@ FROM oid=%(rid)s::OID ) r ) a) b) --- PostgreSQL >= 9.0 -UNION ALL -(SELECT - array_to_string(array_agg(sql), E'\n') AS sql -FROM - (SELECT - 'ALTER ROLE ' || pg_catalog.quote_ident(pg_get_userbyid(%(rid)s::OID)) || - ' SET ' || param|| ' TO ' || - CASE - WHEN param IN ('search_path', 'temp_tablespaces') THEN value - ELSE quote_literal(value) - END || ';' AS sql - FROM - (SELECT - datname, split_part(rolconfig, '=', 1) AS param, replace(rolconfig, split_part(rolconfig, '=', 1) || '=', '') AS value - FROM - (SELECT - d.datname, unnest(c.setconfig) AS rolconfig - FROM - (SELECT * - FROM - pg_catalog.pg_db_role_setting dr - WHERE - dr.setrole=%(rid)s::OID AND dr.setdatabase!=0) c - LEFT JOIN pg_catalog.pg_database d ON (d.oid = c.setdatabase) - ) a - ) b - ) d -) UNION ALL (SELECT 'COMMENT ON ROLE ' || pg_catalog.quote_ident(pg_get_userbyid(%(rid)s::OID)) || ' IS ' || pg_catalog.quote_literal(description) || ';' AS sql