From d98e86d3df9912891080e2b946083c051c5bb654 Mon Sep 17 00:00:00 2001 From: Rahul Shirsat Date: Mon, 2 Dec 2019 11:25:51 +0530 Subject: [PATCH] Warn the user on changing the definition of Materialized View about the loss of data and its dependent objects. Fixes #4396 --- docs/en_US/materialized_view_dialog.rst | 4 +- docs/en_US/release_notes_4_16.rst | 33 +-- .../schemas/views/static/js/mview.js | 18 +- .../mviews/pg/9.4_plus/sql/update.sql | 16 +- .../mviews/ppas/9.3_plus/sql/update.sql | 12 +- .../9.4_plus/alter_mview_add_fillfactor.sql | 5 +- .../alter_mview_add_fillfactor_msql.sql | 2 +- .../alter_mview_add_table_parameter.sql | 5 +- .../pg/9.4_plus/alter_mview_definition.sql | 5 +- .../9.4_plus/alter_mview_definition_msql.sql | 4 + .../alter_mview_remove_table_parameter.sql | 5 +- .../pg/9.4_plus/alter_view_add_some_priv.sql | 2 +- .../alter_view_add_some_priv_msql.sql | 2 +- .../views/tests/pg/9.4_plus/test_mview.json | 2 +- .../views/tests/pg/9.4_plus/tests.json | 22 +- .../views/tests/ppas/11_plus/alter_mview.sql | 18 -- .../11_plus/alter_mview_add_fillfactor.sql | 16 -- .../alter_mview_add_fillfactor_msql.sql | 6 - .../alter_mview_add_table_parameter.sql | 17 -- .../alter_mview_add_table_parameter_msql.sql | 4 - .../ppas/11_plus/alter_mview_definition.sql | 12 - .../11_plus/alter_mview_definition_msql.sql | 4 - .../11_plus/alter_mview_drop_all_priv.sql | 17 -- .../alter_mview_drop_all_priv_msql.sql | 1 - .../tests/ppas/11_plus/alter_mview_msql.sql | 1 - .../alter_mview_remove_table_parameter.sql | 16 -- ...lter_mview_remove_table_parameter_msql.sql | 6 - .../views/tests/ppas/11_plus/alter_view.sql | 18 -- .../ppas/11_plus/alter_view_add_some_priv.sql | 19 -- .../11_plus/alter_view_add_some_priv_msql.sql | 1 - .../ppas/11_plus/alter_view_definition.sql | 18 -- .../11_plus/alter_view_definition_msql.sql | 4 - .../ppas/11_plus/alter_view_delete_priv.sql | 18 -- .../11_plus/alter_view_delete_priv_msql.sql | 1 - .../tests/ppas/11_plus/alter_view_msql.sql | 7 - .../views/tests/ppas/11_plus/create_mview.sql | 15 - .../tests/ppas/11_plus/create_mview_msql.sql | 11 - .../views/tests/ppas/11_plus/create_view.sql | 17 -- .../tests/ppas/11_plus/create_view_msql.sql | 12 - .../views/tests/ppas/11_plus/test_mview.json | 256 ------------------ .../views/tests/ppas/11_plus/tests.json | 178 ------------ .../9.4_plus/alter_mview_add_fillfactor.sql | 5 +- .../alter_mview_add_fillfactor_msql.sql | 2 +- .../alter_mview_add_table_parameter.sql | 5 +- .../ppas/9.4_plus/alter_mview_definition.sql | 5 +- .../9.4_plus/alter_mview_definition_msql.sql | 4 + .../alter_mview_remove_table_parameter.sql | 5 +- .../9.4_plus/alter_view_add_some_priv.sql | 2 +- .../alter_view_add_some_priv_msql.sql | 2 +- .../views/tests/ppas/9.4_plus/test_mview.json | 2 +- .../views/tests/ppas/9.4_plus/tests.json | 22 +- web/pgadmin/browser/static/js/node.js | 43 ++- 52 files changed, 150 insertions(+), 777 deletions(-) delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view_msql.sql delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/test_mview.json delete mode 100644 web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/tests.json diff --git a/docs/en_US/materialized_view_dialog.rst b/docs/en_US/materialized_view_dialog.rst index d7494d946..534e86b73 100644 --- a/docs/en_US/materialized_view_dialog.rst +++ b/docs/en_US/materialized_view_dialog.rst @@ -35,7 +35,9 @@ Click the *Definition* tab to continue. :align: center Use the text editor field in the *Definition* tab to provide the query that will -populate the materialized view. +populate the materialized view. Please note that updating the definition of existing +materialized view would result in loss of Parameter(Table, Toast), Security(Privileges & Security labels), +Indexes and other dependent objects. Click the *Storage* tab to continue. diff --git a/docs/en_US/release_notes_4_16.rst b/docs/en_US/release_notes_4_16.rst index d701f2edf..dc92d0c9c 100644 --- a/docs/en_US/release_notes_4_16.rst +++ b/docs/en_US/release_notes_4_16.rst @@ -9,6 +9,7 @@ This release contains a number of bug fixes and new features since the release o New features ************ +| `Issue #4396 `_ - Warn the user on changing the definition of Materialized View about the loss of data and its dependent objects. | `Issue #4435 `_ - Allow drag and drop functionality for all the nodes under the database node, excluding collection nodes. Housekeeping @@ -21,19 +22,19 @@ Housekeeping Bug fixes ********* -| `Issue #3538 `_ - Fix issue where the Reset button does not get enabled till all the mandatory fields are provided in the dialog. -| `Issue #4659 `_ - Updated documentation for default privileges to clarify more on the grantor. -| `Issue #4724 `_ - Fix network disconnect issue while establishing the connection via SSH Tunnel and it impossible to expand the Servers node. -| `Issue #4761 `_ - Fix an issue where the wrong type is displayed when changing the datatype from timestamp with time zone to timestamp without time zone. -| `Issue #4792 `_ - Ensure that the superuser should be able to create database, as the superuser overrides all the access restrictions. -| `Issue #4818 `_ - Fix server connection drops out issue in query tool. -| `Issue #4836 `_ - Updated the json file name from 'servers.json' to 'pgadmin4/servers.json' in the container deployment section of the documentation. -| `Issue #4878 `_ - Ensure that the superuser should be able to create role, as the superuser overrides all the access restrictions. -| `Issue #4925 `_ - Shown some text on process watcher till the initial logs are loaded. -| `Issue #4926 `_ - Fix VPN network disconnect issue where pgAdmin4 hangs on expanding the Servers node. -| `Issue #4930 `_ - Fix main window tab navigation accessibility issue. -| `Issue #4933 `_ - Ensure that the Servers collection node should expand independently of server connections. -| `Issue #4934 `_ - Fix the help button link on the User Management dialog. -| `Issue #4935 `_ - Fix accessibility issues. -| `Issue #4964 `_ - Fix an issue where length and precision are not removed from table/column dialog. -| `Issue #4965 `_ - Fix an issue where the Interval data type is not displayed in the properties dialog of table/column. +| `Issue #3538 `_ - Fix issue where the Reset button does not get enabled till all the mandatory fields are provided in the dialog. +| `Issue #4659 `_ - Updated documentation for default privileges to clarify more on the grantor. +| `Issue #4724 `_ - Fix network disconnect issue while establishing the connection via SSH Tunnel and it impossible to expand the Servers node. +| `Issue #4761 `_ - Fix an issue where the wrong type is displayed when changing the datatype from timestamp with time zone to timestamp without time zone. +| `Issue #4792 `_ - Ensure that the superuser should be able to create database, as the superuser overrides all the access restrictions. +| `Issue #4818 `_ - Fix server connection drops out issue in query tool. +| `Issue #4836 `_ - Updated the json file name from 'servers.json' to 'pgadmin4/servers.json' in the container deployment section of the documentation. +| `Issue #4878 `_ - Ensure that the superuser should be able to create role, as the superuser overrides all the access restrictions. +| `Issue #4925 `_ - Shown some text on process watcher till the initial logs are loaded. +| `Issue #4926 `_ - Fix VPN network disconnect issue where pgAdmin4 hangs on expanding the Servers node. +| `Issue #4930 `_ - Fix main window tab navigation accessibility issue. +| `Issue #4933 `_ - Ensure that the Servers collection node should expand independently of server connections. +| `Issue #4934 `_ - Fix the help button link on the User Management dialog. +| `Issue #4935 `_ - Fix accessibility issues. +| `Issue #4964 `_ - Fix an issue where length and precision are not removed from table/column dialog. +| `Issue #4965 `_ - Fix an issue where the Interval data type is not displayed in the properties dialog of table/column. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js index e50f61a1f..6d3dfbc05 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js @@ -142,6 +142,7 @@ define('pgadmin.node.mview', [ spcname: undefined, toast_autovacuum_enabled: false, autovacuum_enabled: false, + warn_text: undefined, }, schema: [{ id: 'name', label: gettext('Name'), cell: 'string', @@ -171,7 +172,22 @@ define('pgadmin.node.mview', [ id: 'definition', label: gettext('Definition'), cell: 'string', type: 'text', mode: ['create', 'edit'], group: gettext('Definition'), tabPanelCodeClass: 'sql-code-control', - control: Backform.SqlCodeControl, + control: Backform.SqlCodeControl.extend({ + onChange: function() { + Backform.SqlCodeControl.prototype.onChange.apply(this, arguments); + if(this.model && this.model.changed) { + if(this.model.origSessAttrs && (this.model.changed.definition != this.model.origSessAttrs.definition)) { + this.model.warn_text = gettext('Updating the definition will drop and re-create the materialized view. It may result in loss of information about its dependent objects. Do you want to continue?'); + } + else { + this.model.warn_text = undefined; + } + } + else { + this.model.warn_text = undefined; + } + }, + }), },{ id: 'with_data', label: gettext('With data?'), group: gettext('Storage'), mode: ['edit', 'create'], diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql index f243c4ab8..a728b18c9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql @@ -27,9 +27,14 @@ ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }} {% if def and def != o_data.definition.rstrip(';') %} DROP MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}; CREATE MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} -{% if data.fillfactor or (data['vacuum_data']['changed']|length > 0 ) %} +{% if data.fillfactor or o_data.fillfactor %} WITH( -{% if data.fillfactor %} FILLFACTOR = {{ data.fillfactor }}{% if data['vacuum_data']['changed']|length > 0 %},{% endif %}{{ '\n' }} {% endif %} +{% if data.fillfactor %} +FILLFACTOR = {{ data.fillfactor }}{% if (data['vacuum_data'] is defined and data['vacuum_data']['changed']|length > 0) or (o_data['vacuum_data'] is defined and o_data['vacuum_data']['changed']|length > 0) %},{% endif %} +{% elif o_data.fillfactor %} +FILLFACTOR = {{ o_data.fillfactor }}{% if (data['vacuum_data'] is defined and data['vacuum_data']['changed']|length > 0) or (o_data['vacuum_data'] is defined and o_data['vacuum_data']['changed']|length > 0) %},{% endif %} +{% endif %} + {% if data['vacuum_data']['changed']|length > 0 %} {% for field in data['vacuum_data']['changed'] %} {{ field.name }} = {{ field.value|lower }}{% if not loop.last %},{{ '\n' }}{% endif %} {% endfor %} @@ -40,11 +45,14 @@ WITH( {{ def }} {% if data.with_data is defined %} WITH {{ 'DATA' if data.with_data else 'NO DATA' }}; - -{% elif o_data.with_data %} +{% elif o_data.with_data is defined %} WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }}; {% endif %} +{% if o_data.comment and not data.comment %} +COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} + IS {{ o_data.comment|qtLiteral }}; +{% endif %} {% else %} {# ======= Alter Tablespace ========= #} {%- if data.spcoid and o_data.spcoid != data.spcoid -%} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql index 2b4cc9327..55cdfb03e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql @@ -27,10 +27,12 @@ ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }} {% if def and def != o_data.definition.rstrip(';') %} DROP MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}; CREATE MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} -{% if data.fillfactor or (data['vacuum_data']['changed']|length > 0 ) %} +{% if data.fillfactor or o_data.fillfactor %} WITH( {% if data.fillfactor %} - FILLFACTOR = {{ data.fillfactor }}{% if data['vacuum_data']['changed']|length > 0 %},{% endif %}{{ '\n' }} +FILLFACTOR = {{ data.fillfactor }}{% if (data['vacuum_data'] is defined and data['vacuum_data']['changed']|length > 0) or (o_data['vacuum_data'] is defined and o_data['vacuum_data']['changed']|length > 0) %},{% endif %} +{% elif o_data.fillfactor %} +FILLFACTOR = {{ o_data.fillfactor }}{% if (data['vacuum_data'] is defined and data['vacuum_data']['changed']|length > 0) or (o_data['vacuum_data'] is defined and o_data['vacuum_data']['changed']|length > 0) %},{% endif %} {% endif %} {% if data['vacuum_data']['changed']|length > 0 %} {% for field in data['vacuum_data']['changed'] %} {{ field.name }} = {{ field.value|lower }}{% if not loop.last %},{% endif %}{{ '\n' }} @@ -43,10 +45,14 @@ WITH( {% if data.with_data is defined %} WITH {{ 'DATA' if data.with_data else 'NO DATA' }}; -{% elif o_data.with_data %} +{% elif o_data.with_data is defined %} WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }}; {% endif %} +{% if o_data.comment and not data.comment %} +COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} + IS {{ o_data.comment|qtLiteral }}; +{% endif %} {% else %} {# ======= Alter Tablespace ========= #} {%- if data.spcoid and o_data.spcoid != data.spcoid -%} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql index 03197d009..5b55f1d4d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql @@ -10,7 +10,10 @@ WITH ( TABLESPACE pg_default AS SELECT 12 -WITH NO DATA; +WITH DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO postgres; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql index 0c51d157a..2ef36421f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql @@ -3,4 +3,4 @@ SET( FILLFACTOR = 18 ); -REFRESH MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" WITH NO DATA; +REFRESH MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" WITH DATA; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql index 9a60bd524..ff76b997e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql @@ -11,7 +11,10 @@ WITH ( TABLESPACE pg_default AS SELECT 12 -WITH NO DATA; +WITH DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO postgres; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql index 481879f70..7f9fe95c6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql @@ -6,7 +6,10 @@ CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" TABLESPACE pg_default AS SELECT 12 -WITH DATA; +WITH NO DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO postgres; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql index 2c1b637f4..16b772233 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql @@ -2,3 +2,7 @@ DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" AS SELECT 12 + WITH NO DATA; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql index 03197d009..5b55f1d4d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql @@ -10,7 +10,10 @@ WITH ( TABLESPACE pg_default AS SELECT 12 -WITH NO DATA; +WITH DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO postgres; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv.sql index b1e028996..03c03832e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv.sql @@ -16,4 +16,4 @@ COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; -GRANT SELECT, UPDATE, DELETE ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; +GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv_msql.sql index 83f974b32..285bb2268 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_view_add_some_priv_msql.sql @@ -1 +1 @@ -GRANT SELECT, UPDATE, DELETE ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; +GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/test_mview.json index 335b1fed9..7f0bd477d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/test_mview.json @@ -205,7 +205,7 @@ "msql_endpoint": "NODE-mview.msql_id", "data": { "fillfactor": "18", - "with_data": false + "with_data": true }, "expected_sql_file": "alter_mview_add_fillfactor.sql", "expected_msql_file": "alter_mview_add_fillfactor_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/tests.json index 95f02e749..14e121653 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/tests.json @@ -88,18 +88,8 @@ "grantee":"PUBLIC", "grantor":"postgres", "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - }, { - "privilege_type":"w", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"d", + "privilege_type":"r", "privilege":true, "with_grant":false } @@ -135,16 +125,6 @@ "privilege_type":"r", "privilege":true, "with_grant":false - }, - { - "privilege_type":"w", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"d", - "privilege":true, - "with_grant":false } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview.sql deleted file mode 100644 index b55878d2c..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview.sql +++ /dev/null @@ -1,18 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -TABLESPACE pg_default -AS - SELECT 1 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; - -COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" - IS 'comment1'; - -GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO PUBLIC; -GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor.sql deleted file mode 100644 index be0d59bea..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor.sql +++ /dev/null @@ -1,16 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -WITH ( - FILLFACTOR = 18, - autovacuum_enabled = false -) -TABLESPACE pg_default -AS - SELECT 12 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor_msql.sql deleted file mode 100644 index 0c51d157a..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_fillfactor_msql.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -SET( - FILLFACTOR = 18 -); - -REFRESH MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" WITH NO DATA; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter.sql deleted file mode 100644 index ee5956d1a..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter.sql +++ /dev/null @@ -1,17 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -WITH ( - FILLFACTOR = 18, - autovacuum_analyze_scale_factor = 0.2, - autovacuum_enabled = true -) -TABLESPACE pg_default -AS - SELECT 12 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter_msql.sql deleted file mode 100644 index 737ffaa32..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_add_table_parameter_msql.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" SET( - autovacuum_analyze_scale_factor = 0.2, - autovacuum_enabled = true -); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition.sql deleted file mode 100644 index 41f75fbe5..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition.sql +++ /dev/null @@ -1,12 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -TABLESPACE pg_default -AS - SELECT 12 -WITH DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition_msql.sql deleted file mode 100644 index 2c1b637f4..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_definition_msql.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" - AS -SELECT 12 diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv.sql deleted file mode 100644 index ee5220e13..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv.sql +++ /dev/null @@ -1,17 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -TABLESPACE pg_default -AS - SELECT 1 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; - -COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" - IS 'comment1'; - -GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv_msql.sql deleted file mode 100644 index 3bfd1b9fb..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_drop_all_priv_msql.sql +++ /dev/null @@ -1 +0,0 @@ -REVOKE ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_msql.sql deleted file mode 100644 index 2740b1969..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_msql.sql +++ /dev/null @@ -1 +0,0 @@ -GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter.sql deleted file mode 100644 index be0d59bea..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter.sql +++ /dev/null @@ -1,16 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -WITH ( - FILLFACTOR = 18, - autovacuum_enabled = false -) -TABLESPACE pg_default -AS - SELECT 12 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter_msql.sql deleted file mode 100644 index 8aed82923..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_mview_remove_table_parameter_msql.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" SET( - autovacuum_enabled = false -); -ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" RESET( - autovacuum_analyze_scale_factor -); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view.sql deleted file mode 100644 index 62ce17449..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view.sql +++ /dev/null @@ -1,18 +0,0 @@ --- View: public."testview_$%{}[]()&*^!@""'`\/#" - --- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#"; - -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" -WITH ( - check_option=cascaded, - security_barrier=true -) AS - SELECT test_view_table.col1 - FROM test_view_table; - -ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO enterprisedb; -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment-updated'; - -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv.sql deleted file mode 100644 index 8256dc599..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv.sql +++ /dev/null @@ -1,19 +0,0 @@ --- View: public."testview_$%{}[]()&*^!@""'`\/#" - --- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#"; - -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" -WITH ( - check_option=cascaded, - security_barrier=true -) AS - SELECT test_view_table.col1 - FROM test_view_table; - -ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO enterprisedb; -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment-updated'; - -GRANT DELETE, UPDATE, SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv_msql.sql deleted file mode 100644 index 83f974b32..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_add_some_priv_msql.sql +++ /dev/null @@ -1 +0,0 @@ -GRANT SELECT, UPDATE, DELETE ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition.sql deleted file mode 100644 index 62ce17449..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition.sql +++ /dev/null @@ -1,18 +0,0 @@ --- View: public."testview_$%{}[]()&*^!@""'`\/#" - --- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#"; - -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" -WITH ( - check_option=cascaded, - security_barrier=true -) AS - SELECT test_view_table.col1 - FROM test_view_table; - -ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO enterprisedb; -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment-updated'; - -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition_msql.sql deleted file mode 100644 index 84f01f995..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_definition_msql.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" - WITH (check_option=cascaded, security_barrier=true) - AS - SELECT * FROM test_view_table; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv.sql deleted file mode 100644 index 62ce17449..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv.sql +++ /dev/null @@ -1,18 +0,0 @@ --- View: public."testview_$%{}[]()&*^!@""'`\/#" - --- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#"; - -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" -WITH ( - check_option=cascaded, - security_barrier=true -) AS - SELECT test_view_table.col1 - FROM test_view_table; - -ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO enterprisedb; -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment-updated'; - -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv_msql.sql deleted file mode 100644 index 69c9ea663..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_delete_priv_msql.sql +++ /dev/null @@ -1 +0,0 @@ -REVOKE ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_msql.sql deleted file mode 100644 index da5669912..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/alter_view_msql.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#" - SET (security_barrier=true); -ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#" - SET (check_option=cascaded); - -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview.sql deleted file mode 100644 index 121113526..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview.sql +++ /dev/null @@ -1,15 +0,0 @@ --- View: public."testmview_$%{}[]()&*^!/@`#" - --- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; - -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -TABLESPACE pg_default -AS - SELECT 1 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; - -COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" - IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview_msql.sql deleted file mode 100644 index 324235f89..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_mview_msql.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" -TABLESPACE pg_default -AS -SELECT 1 -WITH NO DATA; - -ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" - OWNER TO enterprisedb; - -COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" - IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view.sql deleted file mode 100644 index 555658907..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view.sql +++ /dev/null @@ -1,17 +0,0 @@ --- View: public."testview_$%{}[]()&*^!@""'`\/#" - --- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#"; - -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" -WITH ( - check_option=local -) AS - SELECT test_view_table.col1 - FROM test_view_table; - -ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO enterprisedb; -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment'; - -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view_msql.sql deleted file mode 100644 index 7cd95ed2a..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/create_view_msql.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" -WITH ( - check_option=local -) AS -select col1 from test_view_table; - -ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO enterprisedb; -COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" - IS 'Testcomment'; - -GRANT INSERT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/test_mview.json deleted file mode 100644 index b945afacb..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/test_mview.json +++ /dev/null @@ -1,256 +0,0 @@ -{ - "scenarios": [ - { - "type": "create", - "name": "Create Materialised Views", - "endpoint": "NODE-mview.obj", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql", - "data": { - "spcname": "pg_default", - "toast_autovacuum_enabled": false, - "autovacuum_enabled": false, - "schema": "public", - "owner": "enterprisedb", - "vacuum_table": [ - { - "name": "autovacuum_analyze_scale_factor" - }, - { - "name": "autovacuum_analyze_threshold" - }, - { - "name": "autovacuum_freeze_max_age" - }, - { - "name": "autovacuum_vacuum_cost_delay" - }, - { - "name": "autovacuum_vacuum_cost_limit" - }, - { - "name": "autovacuum_vacuum_scale_factor" - }, - { - "name": "autovacuum_vacuum_threshold" - }, - { - "name": "autovacuum_freeze_min_age" - }, - { - "name": "autovacuum_freeze_table_age" - } - ], - "vacuum_toast": [ - { - "name": "autovacuum_freeze_max_age" - }, - { - "name": "autovacuum_vacuum_cost_delay" - }, - { - "name": "autovacuum_vacuum_cost_limit" - }, - { - "name": "autovacuum_vacuum_scale_factor" - }, - { - "name": "autovacuum_vacuum_threshold" - }, - { - "name": "autovacuum_freeze_min_age" - }, - { - "name": "autovacuum_freeze_table_age" - } - ], - "datacl": [], - "seclabels": [], - "name": "testmview_$%{}[]()&*^!/@`#", - "comment": "comment1", - "definition": "SELECT 1" - }, - "expected_sql_file": "create_mview.sql", - "expected_msql_file": "create_mview_msql.sql" - }, - { - "type": "alter", - "name": "Alter Materialised Views (Adding privileges)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "datacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "d", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "D", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "t", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_mview.sql", - "expected_msql_file": "alter_mview_msql.sql" - }, - { - "type": "alter", - "name": "Alter Materialised Views (Remove all privileges)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "datacl": { - "deleted": [ - { - "grantee": "PUBLIC", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "d", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "D", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "t", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_mview_drop_all_priv.sql", - "expected_msql_file": "alter_mview_drop_all_priv_msql.sql" - }, - { - "type": "alter", - "name": "Alter Materialised Views (change definition)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "definition": "SELECT 12;" - }, - "expected_sql_file": "alter_mview_definition.sql", - "expected_msql_file": "alter_mview_definition_msql.sql" - }, - { - "type": "alter", - "name": "Alter Materialised Views (Fillfactor)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "fillfactor": "18", - "with_data": false - }, - "expected_sql_file": "alter_mview_add_fillfactor.sql", - "expected_msql_file": "alter_mview_add_fillfactor_msql.sql" - }, - { - "type": "alter", - "name": "Alter Materialised Views (add table parameters)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "autovacuum_custom": true, - "autovacuum_enabled": true, - "vacuum_table": { - "changed": [ - { - "name": "autovacuum_analyze_scale_factor", - "value": 0.2 - } - ] - } - }, - "expected_sql_file": "alter_mview_add_table_parameter.sql", - "expected_msql_file": "alter_mview_add_table_parameter_msql.sql" - }, - { - "type": "alter", - "name": "Alter Materialised Views (remove table parameters)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "autovacuum_custom": true, - "autovacuum_enabled": false, - "vacuum_table": { - "changed": [ - { - "name": "autovacuum_analyze_scale_factor", - "value": null - } - ] - } - }, - "expected_sql_file": "alter_mview_remove_table_parameter.sql", - "expected_msql_file": "alter_mview_remove_table_parameter_msql.sql" - } - ] -} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/tests.json deleted file mode 100644 index 9bcb973d6..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/11_plus/tests.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "scenarios": [ - { - "type": "create", - "name": "Create Table for Views", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "test_view_table", - "check_constraint": [], - "coll_inherits": "[]", - "columns": [ - { - "name": "col1", - "cltype": "integer" - } - ], - "schema": "public" - } - }, - { - "type": "create", - "name": "Create View", - "endpoint": "NODE-view.obj", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql", - "data": { - "definition": "select col1 from test_view_table;", - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "enterprisedb", - "schema": "public", - "check_option": "local", - "security_barrier": false, - "comment":"Testcomment", - "datacl":[{"grantee":"enterprisedb", "grantor":"enterprisedb", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] - }, - "expected_sql_file": "create_view.sql", - "expected_msql_file": "create_view_msql.sql" - }, - { - "type": "alter", - "name": "Alter View", - "endpoint": "NODE-view.obj_id", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql_id", - "data": { - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "enterprisedb", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":[{"grantee":"enterprisedb", "grantor":"enterprisedb", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] - }, - "expected_sql_file": "alter_view.sql", - "expected_msql_file": "alter_view_msql.sql" - }, - { - "type": "alter", - "name": "Alter View (changing code)", - "endpoint": "NODE-view.obj_id", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql_id", - "data": { - "definition": "SELECT * FROM test_view_table;" - }, - "expected_sql_file": "alter_view_definition.sql", - "expected_msql_file": "alter_view_definition_msql.sql" - }, - { - "type": "alter", - "name": "Alter View (adding privileges)", - "endpoint": "NODE-view.obj_id", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql_id", - "data": { - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "enterprisedb", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":{ - "added":[ - { - "grantee":"PUBLIC", - "grantor":"enterprisedb", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"w", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"d", - "privilege":true, - "with_grant":false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_view_add_some_priv.sql", - "expected_msql_file": "alter_view_add_some_priv_msql.sql" - }, - { - "type": "alter", - "name": "Alter View (deleting privileges)", - "endpoint": "NODE-view.obj_id", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql_id", - "data": { - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "enterprisedb", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"enterprisedb", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"w", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"d", - "privilege":true, - "with_grant":false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_view_delete_priv.sql", - "expected_msql_file": "alter_view_delete_priv_msql.sql" - }, - { - "type": "delete", - "name": "Drop View", - "endpoint": "NODE-view.obj_id", - "data": { - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "enterprisedb", - "schema": "public" - } - }, - { - "type": "delete", - "name": "Drop Table for view", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "test_view_table", - "owner": "enterprisedb", - "schema": "public" - } - } - ] -} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql index be0d59bea..da3c3849f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql @@ -10,7 +10,10 @@ WITH ( TABLESPACE pg_default AS SELECT 12 -WITH NO DATA; +WITH DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO enterprisedb; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql index 0c51d157a..2ef36421f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql @@ -3,4 +3,4 @@ SET( FILLFACTOR = 18 ); -REFRESH MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" WITH NO DATA; +REFRESH MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" WITH DATA; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql index ee5956d1a..874d20d5a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql @@ -11,7 +11,10 @@ WITH ( TABLESPACE pg_default AS SELECT 12 -WITH NO DATA; +WITH DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO enterprisedb; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql index 41f75fbe5..3d31af0d2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql @@ -6,7 +6,10 @@ CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" TABLESPACE pg_default AS SELECT 12 -WITH DATA; +WITH NO DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO enterprisedb; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql index 2c1b637f4..16b772233 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql @@ -2,3 +2,7 @@ DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"; CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" AS SELECT 12 + WITH NO DATA; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql index be0d59bea..da3c3849f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql @@ -10,7 +10,10 @@ WITH ( TABLESPACE pg_default AS SELECT 12 -WITH NO DATA; +WITH DATA; ALTER TABLE public."testmview_$%{}[]()&*^!/@`#" OWNER TO enterprisedb; + +COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" + IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql index b4f9cd21d..b1ac54487 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql @@ -15,5 +15,5 @@ ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT SELECT, UPDATE, DELETE ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; +GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv_msql.sql index 83f974b32..285bb2268 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv_msql.sql @@ -1 +1 @@ -GRANT SELECT, UPDATE, DELETE ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; +GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/test_mview.json index b945afacb..4ea610331 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/test_mview.json @@ -205,7 +205,7 @@ "msql_endpoint": "NODE-mview.msql_id", "data": { "fillfactor": "18", - "with_data": false + "with_data": true }, "expected_sql_file": "alter_mview_add_fillfactor.sql", "expected_msql_file": "alter_mview_add_fillfactor_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/tests.json index 9bcb973d6..8d308167b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/tests.json @@ -88,20 +88,10 @@ "grantee":"PUBLIC", "grantor":"enterprisedb", "privileges":[ - { + { "privilege_type":"r", "privilege":true, "with_grant":false - }, - { - "privilege_type":"w", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"d", - "privilege":true, - "with_grant":false } ] } @@ -135,16 +125,6 @@ "privilege_type":"r", "privilege":true, "with_grant":false - }, - { - "privilege_type":"w", - "privilege":true, - "with_grant":false - }, - { - "privilege_type":"d", - "privilege":true, - "with_grant":false } ] } diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js index 90e4fb611..bad930417 100644 --- a/web/pgadmin/browser/static/js/node.js +++ b/web/pgadmin/browser/static/js/node.js @@ -1305,6 +1305,40 @@ define('pgadmin.browser.node', [ } }.bind(panel), + warnBeforeAttributeChange = function(yes_callback) { + var j = this.$container.find('.obj_properties').first(), + view = j && j.data('obj-view'), + self = this; + + if (view && view.model && !_.isUndefined(view.model.warn_text) && !_.isNull(view.model.warn_text)) { + let warn_text; + warn_text = gettext(view.model.warn_text); + if(view.model.sessChanged()){ + Alertify.confirm( + gettext('Warning'), + warn_text, + function() { + setTimeout(function(){ + yes_callback(); + }.bind(self), 50); + return true; + }, + function() { + return true; + } + ).set('labels', { + ok: gettext('Yes'), + cancel: gettext('No'), + }).show(); + } else { + return true; + } + } else { + yes_callback(); + return true; + } + }.bind(panel), + onSave = function(view, saveBtn) { var m = view.model, d = m.toJSON(true), @@ -1498,7 +1532,14 @@ define('pgadmin.browser.node', [ register: function(btn) { // Save the changes btn.on('click',() => { - onSave.call(this, view, btn); + warnBeforeAttributeChange.call( + panel, + function() { + setTimeout(function() { + onSave.call(this, view, btn); + }, 0); + } + ); }); }, }], 'footer', 'pg-prop-btn-group-below');