From 1831c9e70af15762cbf812a1e44ce9bc15fe726c Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Mon, 15 Jul 2019 11:31:27 +0100 Subject: [PATCH] Use ROLE consistently when generating RE-SQL for roles, not USER. Fixes #4446 --- docs/en_US/release_notes_4_11.rst | 1 + .../templates/roles/sql/9.1_plus/create.sql | 2 +- .../roles/templates/roles/sql/9.1_plus/sql.sql | 9 ++++----- .../templates/roles/sql/9.1_plus/update.sql | 4 ++-- .../templates/roles/sql/9.4_plus/create.sql | 2 +- .../roles/templates/roles/sql/9.4_plus/sql.sql | 9 ++++----- .../templates/roles/sql/9.4_plus/update.sql | 4 ++-- ...on.sql => alter_login_role_description.sql} | 6 +++--- ...user_name.sql => alter_login_role_name.sql} | 6 +++--- ...ptions.sql => alter_login_role_options.sql} | 6 +++--- .../{create_user.sql => create_login_role.sql} | 6 +++--- .../servers/roles/tests/9.1_plus/test.json | 18 +++++++++--------- ...on.sql => alter_login_role_description.sql} | 6 +++--- ...user_name.sql => alter_login_role_name.sql} | 6 +++--- ...ptions.sql => alter_login_role_options.sql} | 6 +++--- .../roles/tests/9.4_plus/create_login_role.sql | 10 ++++++++++ .../roles/tests/9.4_plus/create_user.sql | 10 ---------- .../servers/roles/tests/9.4_plus/test.json | 18 +++++++++--------- 18 files changed, 64 insertions(+), 65 deletions(-) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/{alter_user_description.sql => alter_login_role_description.sql} (65%) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/{alter_user_name.sql => alter_login_role_name.sql} (65%) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/{alter_user_options.sql => alter_login_role_options.sql} (54%) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/{create_user.sql => create_login_role.sql} (55%) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/{alter_user_description.sql => alter_login_role_description.sql} (54%) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/{alter_user_name.sql => alter_login_role_name.sql} (54%) rename web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/{alter_user_options.sql => alter_login_role_options.sql} (54%) create mode 100644 web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_login_role.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_user.sql diff --git a/docs/en_US/release_notes_4_11.rst b/docs/en_US/release_notes_4_11.rst index 748b2760a..e85778788 100644 --- a/docs/en_US/release_notes_4_11.rst +++ b/docs/en_US/release_notes_4_11.rst @@ -39,5 +39,6 @@ Bug fixes | `Issue #4429 `_ - Ensure drag/drop from the treeview works as expected on Firefox. | `Issue #4437 `_ - Fix table icon issue when updating any existing field. | `Issue #4442 `_ - Ensure browser should not be started by Selenium when feature tests are excluded from a test run. +| `Issue #4446 `_ - Use ROLE consistently when generating RE-SQL for roles, not USER. | `Issue #4450 `_ - Fix reverse engineered sql for Foreign Data Wrapper created on EPAS server in redwood mode. | `Issue #4462 `_ - Fix some minor UI issues on IE11. \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/create.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/create.sql index 07869859f..620d6653b 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/create.sql @@ -1,6 +1,6 @@ {% import 'macros/security.macros' as SECLABEL %} {% import 'macros/variable.macros' as VARIABLE %} -CREATE {% if data.rolcanlogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(data.rolname) }} WITH{% if data.rolcanlogin and data.rolcanlogin is sameas True %} +CREATE ROLE {{ conn|qtIdent(data.rolname) }} WITH{% if data.rolcanlogin and data.rolcanlogin is sameas True %} LOGIN{% else %} diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/sql.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/sql.sql index 28d8f68d4..0fcad2679 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/sql.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/sql.sql @@ -2,11 +2,10 @@ SELECT array_to_string(array_agg(sql), E'\n\n') FROM (SELECT - CASE WHEN rolcanlogin THEN '-- User: ' ELSE '-- Role: ' END || + '-- Role: ' || pg_catalog.quote_ident(rolname) || - E'\n-- DROP ' || CASE WHEN rolcanlogin THEN 'USER ' ELSE 'ROLE ' END || - pg_catalog.quote_ident(rolname) || E';\n\nCREATE ' || - CASE WHEN rolcanlogin THEN 'USER ' ELSE 'ROLE ' END || + E'\n-- DROP ROLE ' || + pg_catalog.quote_ident(rolname) || E';\n\nCREATE ROLE ' || pg_catalog.quote_ident(rolname) || E' WITH\n ' || CASE WHEN rolcanlogin THEN 'LOGIN' ELSE 'NOLOGIN' END || E'\n ' || CASE WHEN rolcanlogin AND rolpassword LIKE 'md5%%' THEN 'ENCRYPTED PASSWORD ' || quote_literal(rolpassword) || E'\n ' ELSE '' END || @@ -48,7 +47,7 @@ UNION ALL 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 + 'ALTER ROLE ' || 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 FROM (SELECT rolcanlogin, rolname, split_part(rolconfig, '=', 1) AS param, replace(rolconfig, split_part(rolconfig, '=', 1) || '=', '') AS value diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/update.sql index 5cfb3d540..b23593c41 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/update.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.1_plus/update.sql @@ -2,14 +2,14 @@ {% import 'macros/variable.macros' as VARIABLE %} {% if 'rolname' in data %} {% set rolname=data.rolname %} -ALTER{% if rolCanLogin %} USER {% else %} ROLE {% endif %}{{ conn|qtIdent(role) }} +ALTER ROLE {{ conn|qtIdent(role) }} RENAME TO {{ conn|qtIdent(rolname) }}; {% else %} {% set rolname=role %} {% endif %} {% if data|hasAny(alterKeys) %} -ALTER {% if rolCanLogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(rolname) }}{% if 'rolcanlogin' in data %} +ALTER ROLE {{ conn|qtIdent(rolname) }}{% if 'rolcanlogin' in data %} {% if data.rolcanlogin %} LOGIN{% else %} diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/create.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/create.sql index f5ab674cf..8d0825a20 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/create.sql @@ -1,6 +1,6 @@ {% import 'macros/security.macros' as SECLABEL %} {% import 'macros/variable.macros' as VARIABLE %} -CREATE {% if data.rolcanlogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(data.rolname) }} WITH{% if data.rolcanlogin and data.rolcanlogin is sameas True %} +CREATE ROLE {{ conn|qtIdent(data.rolname) }} WITH{% if data.rolcanlogin and data.rolcanlogin is sameas True %} LOGIN{% else %} diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/sql.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/sql.sql index 8cbc8117d..cda36c336 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/sql.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/sql.sql @@ -2,11 +2,10 @@ SELECT array_to_string(array_agg(sql), E'\n\n') AS sql FROM (SELECT - CASE WHEN rolcanlogin THEN '-- User: ' ELSE '-- Role: ' END || + '-- Role: ' || pg_catalog.quote_ident(rolname) || - E'\n-- DROP ' || CASE WHEN rolcanlogin THEN 'USER ' ELSE 'ROLE ' END || - pg_catalog.quote_ident(rolname) || E';\n\nCREATE ' || - CASE WHEN rolcanlogin THEN 'USER ' ELSE 'ROLE ' END || + E'\n-- DROP ROLE ' || + pg_catalog.quote_ident(rolname) || E';\n\nCREATE ROLE ' || pg_catalog.quote_ident(rolname) || E' WITH\n ' || CASE WHEN rolcanlogin THEN 'LOGIN' ELSE 'NOLOGIN' END || E'\n ' || CASE WHEN rolcanlogin AND rolpassword LIKE 'md5%%' THEN 'ENCRYPTED PASSWORD ' || quote_literal(rolpassword) || E'\n ' ELSE '' END || @@ -46,7 +45,7 @@ UNION ALL 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 + 'ALTER ROLE ' || 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 FROM (SELECT rolcanlogin, rolname, split_part(rolconfig, '=', 1) AS param, replace(rolconfig, split_part(rolconfig, '=', 1) || '=', '') AS value diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/update.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/update.sql index faa1c78c6..f77921f59 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/update.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/templates/roles/sql/9.4_plus/update.sql @@ -2,14 +2,14 @@ {% import 'macros/variable.macros' as VARIABLE %} {% if 'rolname' in data %} {% set rolname=data.rolname %} -ALTER{% if rolCanLogin %} USER {% else %} ROLE {% endif %}{{ conn|qtIdent(role) }} +ALTER ROLE {{ conn|qtIdent(role) }} RENAME TO {{ conn|qtIdent(rolname) }}; {% else %} {% set rolname=role %} {% endif %} {% if data|hasAny(alterKeys) %} -ALTER {% if rolCanLogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(rolname) }}{% if 'rolcanlogin' in data %} +ALTER ROLE {{ conn|qtIdent(rolname) }}{% if 'rolcanlogin' in data %} {% if data.rolcanlogin %} LOGIN{% else %} diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_description.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_description.sql similarity index 65% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_description.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_description.sql index df1af0fb8..9f762b7f2 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_description.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_description.sql @@ -1,7 +1,7 @@ --- User: "Role1_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role1_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role1_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role1_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role1_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role1_$%{}[]()&*^!@""'`\/#" WITH LOGIN SUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_name.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_name.sql similarity index 65% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_name.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_name.sql index 51af5cf92..5ce8a6f08 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_name.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_name.sql @@ -1,7 +1,7 @@ --- User: "Role2_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role2_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role2_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role2_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH LOGIN SUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_options.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_options.sql similarity index 54% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_options.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_options.sql index 5bba7aebb..a40faf938 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_user_options.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/alter_login_role_options.sql @@ -1,7 +1,7 @@ --- User: "Role2_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role2_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role2_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role2_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH LOGIN NOSUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/create_user.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/create_login_role.sql similarity index 55% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/create_user.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/create_login_role.sql index ddf866688..1b9a29797 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/create_user.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/create_login_role.sql @@ -1,7 +1,7 @@ --- User: "Role1_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role1_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role1_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role1_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role1_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role1_$%{}[]()&*^!@""'`\/#" WITH LOGIN SUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/test.json b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/test.json index c02159d4a..6a3f65b26 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.1_plus/test.json @@ -62,7 +62,7 @@ }, { "type": "create", - "name": "Create User", + "name": "Create Login Role", "endpoint": "NODE-role.obj", "sql_endpoint": "NODE-role.sql_id", "data": { @@ -81,42 +81,42 @@ "seclabels": [], "variables": [] }, - "expected_sql_file": "create_user.sql" + "expected_sql_file": "create_login_role.sql" }, { "type": "alter", - "name": "Alter User description", + "name": "Alter Login Role description", "endpoint": "NODE-role.obj_id", "sql_endpoint": "NODE-role.sql_id", "data": { "description": "This is detailed description" }, - "expected_sql_file": "alter_user_description.sql" + "expected_sql_file": "alter_login_role_description.sql" }, { "type": "alter", - "name": "Alter User name", + "name": "Alter Login Role name", "endpoint": "NODE-role.obj_id", "sql_endpoint": "NODE-role.sql_id", "data": { "rolname": "Role2_$%{}[]()&*^!@\"'`\\/#" }, - "expected_sql_file": "alter_user_name.sql" + "expected_sql_file": "alter_login_role_name.sql" }, { "type": "alter", - "name": "Alter User superuser, createdb etc options", + "name": "Alter Login Role superuser, createdb etc options", "endpoint": "NODE-role.obj_id", "sql_endpoint": "NODE-role.sql_id", "data": { "rolsuper": false, "rolcreatedb": false }, - "expected_sql_file": "alter_user_options.sql" + "expected_sql_file": "alter_login_role_options.sql" }, { "type": "delete", - "name": "Drop User", + "name": "Drop Login Role", "endpoint": "NODE-role.obj_id", "data": {} } diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_description.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_description.sql similarity index 54% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_description.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_description.sql index 097dca111..6098d25ce 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_description.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_description.sql @@ -1,7 +1,7 @@ --- User: "Role1_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role1_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role1_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role1_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role1_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role1_$%{}[]()&*^!@""'`\/#" WITH LOGIN SUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_name.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_name.sql similarity index 54% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_name.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_name.sql index 5821a2f87..7e4c5e336 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_name.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_name.sql @@ -1,7 +1,7 @@ --- User: "Role2_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role2_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role2_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role2_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH LOGIN SUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_options.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_options.sql similarity index 54% rename from web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_options.sql rename to web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_options.sql index 5bba7aebb..a40faf938 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_user_options.sql +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/alter_login_role_options.sql @@ -1,7 +1,7 @@ --- User: "Role2_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role2_$%{}[]()&*^!@""'`\/#"; +-- Role: "Role2_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role2_$%{}[]()&*^!@""'`\/#"; -CREATE USER "Role2_$%{}[]()&*^!@""'`\/#" WITH +CREATE ROLE "Role2_$%{}[]()&*^!@""'`\/#" WITH LOGIN NOSUPERUSER INHERIT diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_login_role.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_login_role.sql new file mode 100644 index 000000000..027c9d890 --- /dev/null +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_login_role.sql @@ -0,0 +1,10 @@ +-- Role: "Role1_$%{}[]()&*^!@""'`\/#" +-- DROP ROLE "Role1_$%{}[]()&*^!@""'`\/#"; + +CREATE ROLE "Role1_$%{}[]()&*^!@""'`\/#" WITH + LOGIN + SUPERUSER + INHERIT + CREATEDB + CREATEROLE + REPLICATION; diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_user.sql b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_user.sql deleted file mode 100644 index 625a6cdd8..000000000 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/create_user.sql +++ /dev/null @@ -1,10 +0,0 @@ --- User: "Role1_$%{}[]()&*^!@""'`\/#" --- DROP USER "Role1_$%{}[]()&*^!@""'`\/#"; - -CREATE USER "Role1_$%{}[]()&*^!@""'`\/#" WITH - LOGIN - SUPERUSER - INHERIT - CREATEDB - CREATEROLE - REPLICATION; diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/test.json b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/test.json index c02159d4a..6a3f65b26 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/9.4_plus/test.json @@ -62,7 +62,7 @@ }, { "type": "create", - "name": "Create User", + "name": "Create Login Role", "endpoint": "NODE-role.obj", "sql_endpoint": "NODE-role.sql_id", "data": { @@ -81,42 +81,42 @@ "seclabels": [], "variables": [] }, - "expected_sql_file": "create_user.sql" + "expected_sql_file": "create_login_role.sql" }, { "type": "alter", - "name": "Alter User description", + "name": "Alter Login Role description", "endpoint": "NODE-role.obj_id", "sql_endpoint": "NODE-role.sql_id", "data": { "description": "This is detailed description" }, - "expected_sql_file": "alter_user_description.sql" + "expected_sql_file": "alter_login_role_description.sql" }, { "type": "alter", - "name": "Alter User name", + "name": "Alter Login Role name", "endpoint": "NODE-role.obj_id", "sql_endpoint": "NODE-role.sql_id", "data": { "rolname": "Role2_$%{}[]()&*^!@\"'`\\/#" }, - "expected_sql_file": "alter_user_name.sql" + "expected_sql_file": "alter_login_role_name.sql" }, { "type": "alter", - "name": "Alter User superuser, createdb etc options", + "name": "Alter Login Role superuser, createdb etc options", "endpoint": "NODE-role.obj_id", "sql_endpoint": "NODE-role.sql_id", "data": { "rolsuper": false, "rolcreatedb": false }, - "expected_sql_file": "alter_user_options.sql" + "expected_sql_file": "alter_login_role_options.sql" }, { "type": "delete", - "name": "Drop User", + "name": "Drop Login Role", "endpoint": "NODE-role.obj_id", "data": {} }