diff --git a/requirements.txt b/requirements.txt index c831275d4fa..1857f298a83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,8 @@ # relevant packages. ############################################################################### -Authlib==1.7.0 +Authlib==1.6.*; python_version <= '3.9' +Authlib==1.7.*; python_version > '3.9' azure-identity==1.25.3 azure-mgmt-rdbms==10.1.1 azure-mgmt-resource==25.0.0 @@ -31,7 +32,8 @@ Flask-Security-Too==5.4.*; python_version <= '3.9' Flask-Security-Too==5.8.*; python_version > '3.9' Flask-SocketIO==5.6.* Flask-SQLAlchemy==3.1.* -Flask-WTF==1.3.* +Flask-WTF==1.2.*; python_version <= '3.9' +Flask-WTF==1.3.*; python_version > '3.9' Flask==3.1.* google-api-python-client==2.* google-auth-oauthlib==1.3.1 diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_comment_version.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_comment_version.sql index 49d96293cd6..8b0179b41a3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_comment_version.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_comment_version.sql @@ -7,7 +7,7 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#" FOREIGN DATA WRAPPER test_fdw_for_fs; ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#" IS 'Test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_options_privileges.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_options_privileges.sql index b8118b19713..1f5f80b76f7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_options_privileges.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_options_privileges.sql @@ -8,11 +8,11 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#" OPTIONS (host '192.168.1.1', dbname 'edb', port '5450'); ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#" IS 'Test comment'; GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_remove_options_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_remove_options_priv.sql index 826ada3bd6c..78d4dc779bf 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_remove_options_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/alter_remove_options_priv.sql @@ -7,9 +7,9 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#" FOREIGN DATA WRAPPER test_fdw_for_fs; ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#" IS 'Test comment'; -GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options.sql index 17b2c07e7c2..6ec9292822a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options.sql @@ -9,10 +9,10 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#" OPTIONS (host '192.168.1.1', dbname 'edb', port '5450'); ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#" IS 'Test comment'; GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options_msql.sql index a0e422ca0ce..f2d54a2f33d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/create_fs_all_options_msql.sql @@ -5,7 +5,7 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#" OPTIONS (host '192.168.1.1', dbname 'edb', port '5450'); ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#" IS 'Test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/test_foreign_servers.json b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/test_foreign_servers.json index d8c0c3435a7..b571549603e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/test_foreign_servers.json +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/pg/default/test_foreign_servers.json @@ -32,11 +32,11 @@ "fsrvoption":"port", "fsrvvalue":"5450" }], - "fsrvowner":"postgres", + "fsrvowner":"", "description":"Test comment", "fsrvacl":[{ "grantee":"PUBLIC", - "grantor":"postgres", + "grantor":"", "privileges":[{ "privilege_type":"U", "privilege":true, @@ -60,7 +60,7 @@ "sql_endpoint": "NODE-foreign_server.sql_id", "data": { "name":"FS_$%{}[]()&*^!@\"'`\\/#", - "fsrvowner":"postgres" + "fsrvowner":"" } }, { "type": "alter", @@ -96,7 +96,7 @@ "fsrvacl":{ "added": [{ "grantee":"PUBLIC", - "grantor":"postgres", + "grantor":"", "privileges":[{ "privilege_type":"U", "privilege":true, @@ -129,7 +129,7 @@ "fsrvacl":{ "deleted": [{ "grantee":"PUBLIC", - "grantor":"postgres", + "grantor":"", "privileges":[{ "privilege_type":"U", "privilege":true, diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options.sql index 55a6df07083..8185525c669 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options.sql @@ -1,6 +1,6 @@ --- User Mapping : postgres +-- User Mapping : --- DROP USER MAPPING IF EXISTS FOR postgres SERVER test_fs_for_user_mapping +-- DROP USER MAPPING IF EXISTS FOR SERVER test_fs_for_user_mapping -CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping +CREATE USER MAPPING FOR SERVER test_fs_for_user_mapping OPTIONS ("user" 'test_user12', password 'secret123'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted.sql index 475aefaa0d0..858d88c8e0b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted.sql @@ -1,5 +1,5 @@ --- User Mapping : postgres +-- User Mapping : --- DROP USER MAPPING IF EXISTS FOR postgres SERVER test_fs_for_user_mapping +-- DROP USER MAPPING IF EXISTS FOR SERVER test_fs_for_user_mapping -CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping; +CREATE USER MAPPING FOR SERVER test_fs_for_user_mapping; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted_msql.sql index dc07895608b..108d4cecaff 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_deleted_msql.sql @@ -1,2 +1,2 @@ -ALTER USER MAPPING FOR postgres SERVER test_fs_for_user_mapping +ALTER USER MAPPING FOR SERVER test_fs_for_user_mapping OPTIONS (DROP "user", DROP password); diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_msql.sql index 6b8af09227b..da2f8ba1e3d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/alter_options_msql.sql @@ -1,2 +1,2 @@ -ALTER USER MAPPING FOR postgres SERVER test_fs_for_user_mapping +ALTER USER MAPPING FOR SERVER test_fs_for_user_mapping OPTIONS (SET "user" 'test_user12', SET password 'secret123'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping.sql index 8a090727e0d..ee3ffb2e062 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping.sql @@ -1,6 +1,6 @@ --- User Mapping : postgres +-- User Mapping : --- DROP USER MAPPING IF EXISTS FOR postgres SERVER test_fs_for_user_mapping +-- DROP USER MAPPING IF EXISTS FOR SERVER test_fs_for_user_mapping -CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping +CREATE USER MAPPING FOR SERVER test_fs_for_user_mapping OPTIONS ("user" 'test_user', password 'secret'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping_msql.sql index 769a44e1e6c..846a42c6679 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/create_user_mapping_msql.sql @@ -1,2 +1,2 @@ -CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping +CREATE USER MAPPING FOR SERVER test_fs_for_user_mapping OPTIONS ("user" 'test_user', password 'secret'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/test_user_mappings.json b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/test_user_mappings.json index 2792d97c8a2..a0143cf56aa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/test_user_mappings.json +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/tests/pg/default/test_user_mappings.json @@ -27,7 +27,7 @@ "sql_endpoint": "NODE-user_mapping.sql_id", "msql_endpoint": "NODE-user_mapping.msql", "data": { - "name": "postgres", + "name": "", "umoptions":[{ "umoption":"user", "umvalue":"test_user" diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/alter_fdw_privileges.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/alter_fdw_privileges.sql index 341df3ee8f6..69af99708c9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/alter_fdw_privileges.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/alter_fdw_privileges.sql @@ -13,4 +13,4 @@ COMMENT ON FOREIGN DATA WRAPPER "Fdw2_$%{}[]()&*^!@""'`\/#" IS 'a comment'; GRANT USAGE ON FOREIGN DATA WRAPPER "Fdw2_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT USAGE ON FOREIGN DATA WRAPPER "Fdw2_$%{}[]()&*^!@""'`\/#" TO postgres WITH GRANT OPTION; +GRANT USAGE ON FOREIGN DATA WRAPPER "Fdw2_$%{}[]()&*^!@""'`\/#" TO WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/test.json index 556f2eee97d..be5ea311d33 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/pg/default/test.json @@ -103,7 +103,7 @@ "fdwacl": { "added":[{ "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges":[ { "privilege_type": "U", @@ -111,8 +111,8 @@ "with_grant": false }] },{ - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges":[{ "privilege_type": "U", "privilege": true, diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/language_test_data.json b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/language_test_data.json index 28f3c96c941..f4bff509567 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/language_test_data.json +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/language_test_data.json @@ -262,7 +262,7 @@ "lanproc": "plpgsql_call_handler", "lanval": null, "description": null, - "lanowner": "postgres", + "lanowner": "", "laninl": null, "seclabels": null } diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges.sql index ea919102821..48e4ba2c5b3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges.sql @@ -15,4 +15,4 @@ COMMENT ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO postgres WITH GRANT OPTION; +GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges_msql.sql index bdbbe4d180d..7593fac3832 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_comment_privileges_msql.sql @@ -3,4 +3,4 @@ COMMENT ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO postgres WITH GRANT OPTION; +GRANT USAGE ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" TO WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_revoke_privileges_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_revoke_privileges_msql.sql index 7284e8cc38d..0a2157781f7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_revoke_privileges_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/alter_revoke_privileges_msql.sql @@ -1,2 +1,2 @@ REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM PUBLIC; -REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM postgres; +REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/test.json index 7e680e1e1f6..56d836e804e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/pg/default/test.json @@ -40,7 +40,7 @@ "lanacl": { "added":[{ "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges":[ { "privilege_type": "U", @@ -48,8 +48,8 @@ "with_grant": false }] },{ - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges":[{ "privilege_type": "U", "privilege": true, @@ -70,7 +70,7 @@ "lanacl": { "deleted":[{ "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges":[ { "privilege_type": "U", @@ -78,8 +78,8 @@ "with_grant": false }] },{ - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges":[{ "privilege_type": "U", "privilege": true, diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/test.json index 1cb54e3c670..64c0d0fe95c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/test.json @@ -64,7 +64,7 @@ "evnt_update": true, "evnt_delete": false, "evnt_truncate": false, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": true, "pubtable": "" @@ -116,11 +116,13 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": ["public.test_table_publication"] + "pubtable": [ + "public.test_table_publication" + ] }, "expected_sql_file": "create_publication_few_tables.sql", "expected_msql_file": "create_publication_few_tables_msql.sql" @@ -132,7 +134,10 @@ "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql_id", "data": { - "pubtable": ["public.test_table_publication", "public.test_table_publication_2"] + "pubtable": [ + "public.test_table_publication", + "public.test_table_publication_2" + ] }, "expected_sql_file": "alter_publication_add_tables.sql", "expected_msql_file": "alter_publication_add_tables_msql.sql" @@ -144,7 +149,9 @@ "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql_id", "data": { - "pubtable": ["public.test_table_publication_2"] + "pubtable": [ + "public.test_table_publication_2" + ] }, "expected_sql_file": "alter_publication_drop_tables.sql", "expected_msql_file": "alter_publication_drop_tables_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/15_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/15_plus/test.json index 795173776c0..9cc6b6e0eb6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/15_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/15_plus/test.json @@ -84,7 +84,7 @@ "evnt_update": true, "evnt_delete": false, "evnt_truncate": false, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": true, "only_table": false, @@ -139,13 +139,15 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table_publication" - }], + "pubtable": [ + { + "table_name": "public.test_table_publication" + } + ], "pubschema": "" }, "expected_sql_file": "create_publication_few_tables.sql", @@ -159,9 +161,11 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "added": [{ - "table_name": "public.test_table_publication_2" - }] + "added": [ + { + "table_name": "public.test_table_publication_2" + } + ] } }, "expected_sql_file": "alter_publication_add_tables.sql", @@ -175,9 +179,11 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "deleted": [{ - "table_name": "public.test_table_publication_2" - }] + "deleted": [ + { + "table_name": "public.test_table_publication_2" + } + ] } }, "expected_sql_file": "alter_publication_drop_tables.sql", @@ -191,10 +197,14 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "added": [{ - "table_name": "public.test_table_publication_2", - "columns": ["dept_id"] - }] + "added": [ + { + "table_name": "public.test_table_publication_2", + "columns": [ + "dept_id" + ] + } + ] } }, "expected_sql_file": "alter_publication_add_tables_columns.sql", @@ -208,10 +218,14 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "changed": [{ - "table_name": "public.test_table_publication_2", - "columns": ["dept_name"] - }] + "changed": [ + { + "table_name": "public.test_table_publication_2", + "columns": [ + "dept_name" + ] + } + ] } }, "expected_sql_file": "alter_publication_set_tables_columns.sql", @@ -225,9 +239,11 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "deleted": [{ - "table_name": "public.test_table_publication_2" - }] + "deleted": [ + { + "table_name": "public.test_table_publication_2" + } + ] } }, "expected_sql_file": "alter_publication_drop_tables.sql", @@ -241,10 +257,12 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "added": [{ - "table_name": "public.test_table_publication_2", - "where": "dept_id=2" - }] + "added": [ + { + "table_name": "public.test_table_publication_2", + "where": "dept_id=2" + } + ] } }, "expected_sql_file": "alter_publication_add_tables_where.sql", @@ -258,10 +276,12 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "changed": [{ - "table_name": "public.test_table_publication_2", - "where": "dept_name='test'" - }] + "changed": [ + { + "table_name": "public.test_table_publication_2", + "where": "dept_name='test'" + } + ] } }, "expected_sql_file": "alter_publication_set_tables_where.sql", @@ -275,9 +295,11 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "deleted": [{ - "table_name": "public.test_table_publication_2" - }] + "deleted": [ + { + "table_name": "public.test_table_publication_2" + } + ] } }, "expected_sql_file": "alter_publication_drop_tables.sql", @@ -291,11 +313,15 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "added": [{ - "table_name": "public.test_table_publication_2", - "columns": ["dept_id"], - "where": "dept_id=2" - }] + "added": [ + { + "table_name": "public.test_table_publication_2", + "columns": [ + "dept_id" + ], + "where": "dept_id=2" + } + ] } }, "expected_sql_file": "alter_publication_add_tables_columns_where.sql", @@ -309,11 +335,15 @@ "msql_endpoint": "NODE-publication.msql_id", "data": { "pubtable": { - "changed": [{ - "table_name": "public.test_table_publication_2", - "columns": ["dept_name"], - "where": "dept_name='test'" - }] + "changed": [ + { + "table_name": "public.test_table_publication_2", + "columns": [ + "dept_name" + ], + "where": "dept_name='test'" + } + ] } }, "expected_sql_file": "alter_publication_set_tables_columns_where.sql", @@ -339,12 +369,14 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, "pubtable": "", - "pubschema": ["test_schema_publication"] + "pubschema": [ + "test_schema_publication" + ] }, "expected_sql_file": "create_publication_few_schemas.sql", "expected_msql_file": "create_publication_few_schemas_msql.sql" @@ -356,7 +388,10 @@ "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql_id", "data": { - "pubschema": ["test_schema_publication","test_schema_publication_2"] + "pubschema": [ + "test_schema_publication", + "test_schema_publication_2" + ] }, "expected_sql_file": "alter_publication_add_schemas.sql", "expected_msql_file": "alter_publication_add_schemas_msql.sql" @@ -368,7 +403,9 @@ "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql_id", "data": { - "pubschema": ["test_schema_publication_2"] + "pubschema": [ + "test_schema_publication_2" + ] }, "expected_sql_file": "alter_publication_drop_schemas.sql", "expected_msql_file": "alter_publication_drop_schemas_msql.sql" @@ -393,13 +430,15 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": true, - "pubtable": [{ - "table_name": "public.test_table_publication" - }], + "pubtable": [ + { + "table_name": "public.test_table_publication" + } + ], "pubschema": "" }, "expected_sql_file": "create_publication_few_tables_only.sql", @@ -425,14 +464,18 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table_publication" - }], - "pubschema": ["test_schema_publication"] + "pubtable": [ + { + "table_name": "public.test_table_publication" + } + ], + "pubschema": [ + "test_schema_publication" + ] }, "expected_sql_file": "create_publication_few_tables_schemas.sql", "expected_msql_file": "create_publication_few_tables_schemas_msql.sql" @@ -457,14 +500,19 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table_publication", - "columns": ["emp_id", "name"] - }], + "pubtable": [ + { + "table_name": "public.test_table_publication", + "columns": [ + "emp_id", + "name" + ] + } + ], "pubschema": "" }, "expected_sql_file": "create_publication_few_tables_columns.sql", @@ -490,14 +538,16 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table_publication", - "where": "emp_id=2 and name='test'" - }], + "pubtable": [ + { + "table_name": "public.test_table_publication", + "where": "emp_id=2 and name='test'" + } + ], "pubschema": "" }, "expected_sql_file": "create_publication_few_tables_where.sql", @@ -523,15 +573,20 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table_publication", - "columns": ["emp_id", "name"], - "where": "emp_id=2 and name='test'" - }], + "pubtable": [ + { + "table_name": "public.test_table_publication", + "columns": [ + "emp_id", + "name" + ], + "where": "emp_id=2 and name='test'" + } + ], "pubschema": "" }, "expected_sql_file": "create_publication_few_tables_columns_where.sql", @@ -557,15 +612,19 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table_publication", - "where": "emp_id=2 and name='test'" - }], - "pubschema": ["test_schema_publication"] + "pubtable": [ + { + "table_name": "public.test_table_publication", + "where": "emp_id=2 and name='test'" + } + ], + "pubschema": [ + "test_schema_publication" + ] }, "expected_sql_file": "create_publication_few_tables_where_schemas.sql", "expected_msql_file": "create_publication_few_tables_where_schemas_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/default/test.json index 8f09ae05bdd..a45d56e4f22 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/default/test.json @@ -64,7 +64,7 @@ "evnt_update": true, "evnt_delete": false, "evnt_truncate": false, - "pubowner": "postgres", + "pubowner": "", "all_table": true, "pubtable": "" }, @@ -115,10 +115,12 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "all_table": false, "only_table": false, - "pubtable": ["public.test_table_publication"] + "pubtable": [ + "public.test_table_publication" + ] }, "expected_sql_file": "create_publication_few_tables.sql", "expected_msql_file": "create_publication_few_tables_msql.sql" @@ -130,7 +132,10 @@ "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql_id", "data": { - "pubtable": ["public.test_table_publication", "public.test_table_publication_2"] + "pubtable": [ + "public.test_table_publication", + "public.test_table_publication_2" + ] }, "expected_sql_file": "alter_publication_add_tables.sql", "expected_msql_file": "alter_publication_add_tables_msql.sql" @@ -142,7 +147,9 @@ "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql_id", "data": { - "pubtable": ["public.test_table_publication_2"] + "pubtable": [ + "public.test_table_publication_2" + ] }, "expected_sql_file": "alter_publication_drop_tables.sql", "expected_msql_file": "alter_publication_drop_tables_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/13_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/13_plus/test.json index e680befb95e..f1362f147ae 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/13_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/13_plus/test.json @@ -44,7 +44,7 @@ "data": { "name": "Cl1_$%{}[]()&*^!@\"'`\\/#b", "schema": "testschema", - "owner": "postgres", + "owner": "", "description": "Description for extra params", "locale": "locale", "provider": "icu", @@ -70,7 +70,7 @@ "data": { "name": "Cl1_$%{}[]()&*^!@\"'`\\/#b", "schema": "testschema", - "owner": "postgres", + "owner": "", "description": "libc", "locale": "C", "provider": "libc", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/17_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/17_plus/test.json index 138ac520154..2bfd84786e4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/17_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/pg/17_plus/test.json @@ -44,7 +44,7 @@ "data": { "name": "Cl1_$%{}[]()&*^!@\"'`\\/#b", "schema": "testschema", - "owner": "postgres", + "owner": "", "description": "Description for extra params", "locale": "locale", "provider": "icu", @@ -70,7 +70,7 @@ "data": { "name": "Cl1_$%{}[]()&*^!@\"'`\\/#b", "schema": "testschema", - "owner": "postgres", + "owner": "", "description": "libc", "locale": "C", "provider": "libc", @@ -95,7 +95,7 @@ "data": { "name": "Cl1_$%{}[]()&*^!@\"'`\\/#b", "schema": "testschema", - "owner": "postgres", + "owner": "", "description": "builtin", "locale": "C", "provider": "builtin", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_comment.sql index b64486583e6..6908cb08970 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_comment.sql @@ -8,7 +8,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" DEFAULT 5 NOT NULL; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT constraint_1 CHECK (3 < 5); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_default_expression.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_default_expression.sql index 40052078a9d..f3800f77016 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_default_expression.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_default_expression.sql @@ -7,7 +7,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" COLLATE pg_catalog."C" DEFAULT 3; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT constraint_1 CHECK (3 < 5); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_name.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_name.sql index b7f5248bede..cede716a6d8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_name.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_name.sql @@ -7,7 +7,7 @@ CREATE DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" COLLATE pg_catalog."C" DEFAULT 3; -ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" OWNER TO ; ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT constraint_1 CHECK (3 < 5); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_null_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_null_type.sql index 8e0b271d4fe..d81c72f1242 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_null_type.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/alter_domain_null_type.sql @@ -7,7 +7,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" COLLATE pg_catalog."C" DEFAULT 5; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT constraint_1 CHECK (3 < 5); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain.sql index 48e7565af3e..a2112d2bb6c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain.sql @@ -8,7 +8,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" DEFAULT 5 NOT NULL; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT constraint_1 CHECK (3 < 5); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain_numeric.sql index d4f7f155131..d66c0e83258 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain_numeric.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/create_domain_numeric.sql @@ -7,7 +7,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" DEFAULT 3 NOT NULL; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" IS 'test_comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain.sql index 5e4da15a3df..be9e94b8ae9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain.sql @@ -4,7 +4,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" DEFAULT 5 NOT NULL; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT constraint_1 CHECK (3 < 5); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain_numeric.sql index 9feccd2db41..09391afcb0d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain_numeric.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/msql_create_domain_numeric.sql @@ -3,7 +3,7 @@ CREATE DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" DEFAULT 3 NOT NULL; -ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO postgres; +ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" OWNER TO ; COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#" IS 'test_comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/test.json index 2b23970c54a..c7ebd5f0fe8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/pg/default/test.json @@ -9,7 +9,7 @@ "name": "Dom1_$%{}[]()&*^!@\"'`\\/#", "schema": "public", "schema_id": "", - "owner": "postgres", + "owner": "", "basensp": "public", "description": "test_comment", "basetype": "text", @@ -90,7 +90,7 @@ "name": "Dom1_$%{}[]()&*^!@\"'`\\/#", "schema": "public", "schema_id": "", - "owner": "postgres", + "owner": "", "basensp": "public", "description": "test_comment", "basetype": "numeric", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py index fd1ecb66caf..e3f6b18f989 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_sql.py @@ -101,13 +101,16 @@ def runTest(self): # Replace multiple spaces with one space and check the expected sql sql = re.sub(r'\s+', ' ', orig_sql).strip() + from pgadmin.utils.driver.psycopg3 import Driver expected_sql = '-- DOMAIN: {0}.{1} -- DROP DOMAIN IF EXISTS ' \ '{0}.{1}; CREATE DOMAIN {0}.{1} {2} ' \ 'ALTER DOMAIN {0}.{1} OWNER' \ ' TO {3};'.format(self.schema_name, self.test_data['domain_name'], self.test_data['domain_sql'], - self.server["username"]) + Driver.qtIdent( + None, + self.server["username"])) self.assertEqual(sql, expected_sql) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/12_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/12_plus/test.json index 0b43ec9a782..3865598fc1d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/12_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/12_plus/test.json @@ -18,7 +18,7 @@ "endpoint": "NODE-foreign_server.obj", "sql_endpoint": "NODE-foreign_server.sql_id", "data": { - "name":"test_fs_for_foreign_table_column" + "name": "test_fs_for_foreign_table_column" }, "store_object_id": "True" }, @@ -33,7 +33,7 @@ "schema": "public", "basensp": "public", "ftsrvname": "test_fs_for_foreign_table_column", - "owner": "postgres", + "owner": "", "ftoptions": [], "inherits": [], "relacl": [], @@ -51,9 +51,9 @@ "name": "col_1_$%{}[]()&*^!@\"'`\\/#", "description": "Comment for create", "cltype": "numeric", - "attlen":"10", - "attprecision":"5", - "colconstype":"n", + "attlen": "10", + "attprecision": "5", + "colconstype": "n", "attnotnull": true, "attoptions": [], "seclabels": [], @@ -73,7 +73,14 @@ "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", "description": "Comment for alter", "cltype": "real", - "coloptions":{"added":[{"option":"column_name","value":"test"}]} + "coloptions": { + "added": [ + { + "option": "column_name", + "value": "test" + } + ] + } }, "expected_sql_file": "alter_column_numeric.sql", "expected_msql_file": "alter_column_numeric.msql" @@ -153,7 +160,7 @@ "data": { "attlen": "10", "attnotnull": false, - "attnum":3, + "attnum": 3, "description": "test comment modification" }, "expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql", @@ -174,16 +181,28 @@ "endpoint": "NODE-foreign_table_column.obj", "sql_endpoint": "NODE-foreign_table_column.sql_id", "msql_endpoint": "NODE-foreign_table_column.msql", - "data": {"name":"col_4_$%{}[]()&*^!@\"'`\\/#", - "description":"test comment", - "cltype":"bigint", - "attnotnull":true, - "coloptions":[{"option":"column_name","value":"test_options"}], - "colconstype":"g", - "is_tlength":false, - "is_precision":false, - "genexpr":"1000+1", - "attoptions":[{"name":"n_distinct","value":"1"}]}, + "data": { + "name": "col_4_$%{}[]()&*^!@\"'`\\/#", + "description": "test comment", + "cltype": "bigint", + "attnotnull": true, + "coloptions": [ + { + "option": "column_name", + "value": "test_options" + } + ], + "colconstype": "g", + "is_tlength": false, + "is_precision": false, + "genexpr": "1000+1", + "attoptions": [ + { + "name": "n_distinct", + "value": "1" + } + ] + }, "expected_sql_file": "create_column_with_integer_generated_always_column_option_variables.sql", "expected_msql_file": "create_column_with_integer_generated_always_column_option_variables.msql" }, @@ -193,11 +212,25 @@ "endpoint": "NODE-foreign_table_column.obj_id", "sql_endpoint": "NODE-foreign_table_column.sql_id", "msql_endpoint": "NODE-foreign_table_column.msql_id", - "data":{ - "attoptions":{ - "changed":[{"name":"n_distinct","value":"111"}]}, - "coloptions":{"changed":[{"option":"column_name","value":"test_options_update"}]}, - "attnum":4}, + "data": { + "attoptions": { + "changed": [ + { + "name": "n_distinct", + "value": "111" + } + ] + }, + "coloptions": { + "changed": [ + { + "option": "column_name", + "value": "test_options_update" + } + ] + }, + "attnum": 4 + }, "expected_sql_file": "alter_column_with_integer_generated_always_column_option_variables.sql", "expected_msql_file": "alter_column_with_integer_generated_always_column_option_variables.msql" }, @@ -207,7 +240,8 @@ "endpoint": "NODE-foreign_table_column.obj_id", "sql_endpoint": "NODE-foreign_table_columnn.sql_id", "data": { - "name":"col_4_$%{}[]()&*^!@\"'`\\/#" + "name": "col_4_$%{}[]()&*^!@\"'`\\/#" } } - ]} + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/default/test.json index f3ba37bbdf5..b32e46fabf6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/foreign_table_columns/tests/pg/default/test.json @@ -18,7 +18,7 @@ "endpoint": "NODE-foreign_server.obj", "sql_endpoint": "NODE-foreign_server.sql_id", "data": { - "name":"test_fs_for_foreign_table_column" + "name": "test_fs_for_foreign_table_column" }, "store_object_id": "True" }, @@ -33,7 +33,7 @@ "schema": "public", "basensp": "public", "ftsrvname": "test_fs_for_foreign_table_column", - "owner": "postgres", + "owner": "", "ftoptions": [], "inherits": [], "relacl": [], @@ -51,10 +51,10 @@ "name": "col_1_$%{}[]()&*^!@\"'`\\/#", "description": "Comment for create", "cltype": "numeric", - "attlen":"10", - "attprecision":"5", - "coloptions":[], - "colconstype":"n", + "attlen": "10", + "attprecision": "5", + "coloptions": [], + "colconstype": "n", "attnotnull": true, "attoptions": [], "seclabels": [], @@ -74,7 +74,14 @@ "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", "description": "Comment for alter", "cltype": "real", - "coloptions":{"added":[{"option":"column_name","value":"test"}]} + "coloptions": { + "added": [ + { + "option": "column_name", + "value": "test" + } + ] + } }, "expected_sql_file": "alter_column_numeric.sql", "expected_msql_file": "alter_column_numeric.msql" @@ -127,4 +134,5 @@ "name": "col_2_$%{}[]()&*^!@\"'`\\/#" } } - ]} + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/foreign_tables_test_data.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/foreign_tables_test_data.json index 3e2db677197..e919bb89d12 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/foreign_tables_test_data.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/foreign_tables_test_data.json @@ -241,7 +241,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "U", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/17_plus/test_foreign_table.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/17_plus/test_foreign_table.json index 0ae716a00aa..2b7a6832787 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/17_plus/test_foreign_table.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/17_plus/test_foreign_table.json @@ -18,7 +18,7 @@ "endpoint": "NODE-foreign_server.obj", "sql_endpoint": "NODE-foreign_server.sql_id", "data": { - "name":"test_fs_for_foreign_table" + "name": "test_fs_for_foreign_table" }, "store_object_id": "True" }, @@ -30,74 +30,94 @@ "msql_endpoint": "NODE-foreign_table.msql", "data": { "name": "FT1_$%{}[]()&*^!@\"'`\\/#", - "owner":"postgres", + "owner": "", "schema": "public", - "basensp":"public", - "description":"Test Comment", - "ftsrvname":"test_fs_for_foreign_table", - "columns":[{ - "name":"col1", - "cltype":"bigint", - "coloptions":[] - },{ - "name":"col2", - "cltype":"text", - "coloptions":[] - }], - "constraints":[{ - "conname":"cons1", - "consrc":"true", - "connoinherit":true, - "convalidated":true - }], - "ftoptions":[{ - "option":"schema_name", - "value":"public" - },{ - "option":"table_name", - "value":"test_table" - }], - "relacl":[{ - "grantee":"PUBLIC", - "grantor":"postgres", - "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":"x", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"d", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"D", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"t", - "privilege":true, - "with_grant":false - }, { - "privilege_type":"m", - "privilege":true, - "with_grant":false - }] - }] + "basensp": "public", + "description": "Test Comment", + "ftsrvname": "test_fs_for_foreign_table", + "columns": [ + { + "name": "col1", + "cltype": "bigint", + "coloptions": [] + }, + { + "name": "col2", + "cltype": "text", + "coloptions": [] + } + ], + "constraints": [ + { + "conname": "cons1", + "consrc": "true", + "connoinherit": true, + "convalidated": true + } + ], + "ftoptions": [ + { + "option": "schema_name", + "value": "public" + }, + { + "option": "table_name", + "value": "test_table" + } + ], + "relacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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": "x", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "t", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_foreign_table_with_all_options.sql", "expected_msql_file": "create_foreign_table_with_all_options_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop foreign table", "endpoint": "NODE-foreign_table.delete_id" @@ -109,7 +129,7 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "data": { "name": "FT1_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "basensp": "public", "ftsrvname": "test_fs_for_foreign_table", @@ -123,18 +143,21 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "msql_endpoint": "NODE-foreign_table.msql_id", "data": { - "description":"Test Comment", + "description": "Test Comment", "columns": { - "added": [{ - "name":"col1", - "cltype":"bigint", - "coloptions":[], - "attnotnull": true - },{ - "name":"col2", - "cltype":"text", - "coloptions":[] - }] + "added": [ + { + "name": "col1", + "cltype": "bigint", + "coloptions": [], + "attnotnull": true + }, + { + "name": "col2", + "cltype": "text", + "coloptions": [] + } + ] } }, "expected_sql_file": "alter_comment_add_columns.sql", @@ -148,21 +171,26 @@ "msql_endpoint": "NODE-foreign_table.msql_id", "data": { "constraints": { - "added": [{ - "conname":"cons1", - "consrc":"true", - "connoinherit":true, - "convalidated":true - }] + "added": [ + { + "conname": "cons1", + "consrc": "true", + "connoinherit": true, + "convalidated": true + } + ] }, "ftoptions": { - "added": [{ - "option":"schema_name", - "value":"public" - },{ - "option":"table_name", - "value":"test_table" - }] + "added": [ + { + "option": "schema_name", + "value": "public" + }, + { + "option": "table_name", + "value": "test_table" + } + ] } }, "expected_sql_file": "alter_add_cons_opts.sql", @@ -175,16 +203,20 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "msql_endpoint": "NODE-foreign_table.msql_id", "data": { - "relacl":{ - "added": [{ - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[{ - "privilege_type":"r", - "privilege":true, - "with_grant":false - }] - }] + "relacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_add_priv.sql", @@ -198,26 +230,32 @@ "msql_endpoint": "NODE-foreign_table.msql_id", "data": { "ftoptions": { - "changed": [{ - "option":"schema_name", - "value":"test_public" - }] + "changed": [ + { + "option": "schema_name", + "value": "test_public" + } + ] }, "columns": { - "changed": [{ - "name": "col1", - "attnum": 1, - "attoptions": null, - "attnotnull":false, - "attstattarget": 10, - "collname": "", - "coloptions": [], - "cltype": "integer" - }], - "deleted": [{ - "name":"col2", - "cltype":"text" - }] + "changed": [ + { + "name": "col1", + "attnum": 1, + "attoptions": null, + "attnotnull": false, + "attstattarget": 10, + "collname": "", + "coloptions": [], + "cltype": "integer" + } + ], + "deleted": [ + { + "name": "col2", + "cltype": "text" + } + ] } }, "expected_sql_file": "alter_col_opts.sql", @@ -230,50 +268,62 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "msql_endpoint": "NODE-foreign_table.msql_id", "data": { - "relacl":{ - "deleted": [{ - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[{ - "privilege_type":"a", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"r", - "privilege":true, - "with_grant":false - }] - }] + "relacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "constraints": { - "deleted": [{ - "conname":"cons1", - "consrc":"true", - "connoinherit":true, - "convalidated":true - }] + "deleted": [ + { + "conname": "cons1", + "consrc": "true", + "connoinherit": true, + "convalidated": true + } + ] }, "ftoptions": { - "deleted": [{ - "option":"schema_name", - "value":"public" - }] + "deleted": [ + { + "option": "schema_name", + "value": "public" + } + ] } }, "expected_sql_file": "alter_remove_opts_priv_cons.sql", "expected_msql_file": "alter_remove_opts_priv_cons_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop foreign table", "endpoint": "NODE-foreign_table.delete_id" - }, { + }, + { "type": "delete", "name": "Drop foreign server", "endpoint": "NODE-foreign_server.delete_id", "data": { "name": "test_fs_for_foreign_table" } - }, { + }, + { "type": "delete", "name": "Drop FDW", "endpoint": "NODE-foreign_data_wrapper.delete_id", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_cons_opts.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_cons_opts.sql index 2ae6f3cb0b6..d3cb2d75622 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_cons_opts.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_cons_opts.sql @@ -10,7 +10,7 @@ CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"( OPTIONS (schema_name 'public', table_name 'test_table'); ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT cons1 CHECK (true) NO INHERIT; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_priv.sql index 4e207f71a20..d25bd77abd5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_add_priv.sql @@ -10,7 +10,7 @@ CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"( OPTIONS (schema_name 'public', table_name 'test_table'); ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT cons1 CHECK (true) NO INHERIT; @@ -20,4 +20,4 @@ COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" GRANT SELECT ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_col_opts.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_col_opts.sql index 86db655679d..21606ce7c0f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_col_opts.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_col_opts.sql @@ -9,7 +9,7 @@ CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"( OPTIONS (schema_name 'test_public', table_name 'test_table'); ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT cons1 CHECK (true) NO INHERIT; @@ -19,7 +19,7 @@ COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" GRANT SELECT ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO ; ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_comment_add_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_comment_add_columns.sql index a7aaee89f00..e269713bced 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_comment_add_columns.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_comment_add_columns.sql @@ -9,7 +9,7 @@ CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"( SERVER test_fs_for_foreign_table; ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" IS 'Test Comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_remove_opts_priv_cons.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_remove_opts_priv_cons.sql index 77d17e5ffc1..91c84c5d115 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_remove_opts_priv_cons.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/alter_remove_opts_priv_cons.sql @@ -9,12 +9,12 @@ CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"( OPTIONS (table_name 'test_table'); ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" IS 'Test Comment'; -GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO ; ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options.sql index e50fc1e7a07..6b7e61d8f11 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options.sql @@ -10,7 +10,7 @@ CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"( OPTIONS (schema_name 'public', table_name 'test_table'); ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT cons1 CHECK (true) NO INHERIT; @@ -20,4 +20,4 @@ COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options_msql.sql index 89a2842cc50..733d2a613a6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/create_foreign_table_with_all_options_msql.sql @@ -6,7 +6,7 @@ CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"( OPTIONS (schema_name 'public', table_name 'test_table'); ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#" ADD CONSTRAINT cons1 CHECK (true) NO INHERIT; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/test_foreign_table.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/test_foreign_table.json index 4f0076176b1..36b662da724 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/test_foreign_table.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/default/test_foreign_table.json @@ -18,7 +18,7 @@ "endpoint": "NODE-foreign_server.obj", "sql_endpoint": "NODE-foreign_server.sql_id", "data": { - "name":"test_fs_for_foreign_table" + "name": "test_fs_for_foreign_table" }, "store_object_id": "True" }, @@ -30,70 +30,89 @@ "msql_endpoint": "NODE-foreign_table.msql", "data": { "name": "FT1_$%{}[]()&*^!@\"'`\\/#", - "owner":"postgres", + "owner": "", "schema": "public", - "basensp":"public", - "description":"Test Comment", - "ftsrvname":"test_fs_for_foreign_table", - "columns":[{ - "name":"col1", - "cltype":"bigint", - "coloptions":[] - },{ - "name":"col2", - "cltype":"text", - "coloptions":[] - }], - "constraints":[{ - "conname":"cons1", - "consrc":"true", - "connoinherit":true, - "convalidated":true - }], - "ftoptions":[{ - "option":"schema_name", - "value":"public" - },{ - "option":"table_name", - "value":"test_table" - }], - "relacl":[{ - "grantee":"PUBLIC", - "grantor":"postgres", - "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":"x", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"d", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"D", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"t", - "privilege":true, - "with_grant":false - }] - }] + "basensp": "public", + "description": "Test Comment", + "ftsrvname": "test_fs_for_foreign_table", + "columns": [ + { + "name": "col1", + "cltype": "bigint", + "coloptions": [] + }, + { + "name": "col2", + "cltype": "text", + "coloptions": [] + } + ], + "constraints": [ + { + "conname": "cons1", + "consrc": "true", + "connoinherit": true, + "convalidated": true + } + ], + "ftoptions": [ + { + "option": "schema_name", + "value": "public" + }, + { + "option": "table_name", + "value": "test_table" + } + ], + "relacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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": "x", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "t", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_foreign_table_with_all_options.sql", "expected_msql_file": "create_foreign_table_with_all_options_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop foreign table", "endpoint": "NODE-foreign_table.delete_id" @@ -105,7 +124,7 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "data": { "name": "FT1_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "basensp": "public", "ftsrvname": "test_fs_for_foreign_table", @@ -119,18 +138,21 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "msql_endpoint": "NODE-foreign_table.msql_id", "data": { - "description":"Test Comment", + "description": "Test Comment", "columns": { - "added": [{ - "name":"col1", - "cltype":"bigint", - "coloptions":[], - "attnotnull": true - },{ - "name":"col2", - "cltype":"text", - "coloptions":[] - }] + "added": [ + { + "name": "col1", + "cltype": "bigint", + "coloptions": [], + "attnotnull": true + }, + { + "name": "col2", + "cltype": "text", + "coloptions": [] + } + ] } }, "expected_sql_file": "alter_comment_add_columns.sql", @@ -144,21 +166,26 @@ "msql_endpoint": "NODE-foreign_table.msql_id", "data": { "constraints": { - "added": [{ - "conname":"cons1", - "consrc":"true", - "connoinherit":true, - "convalidated":true - }] + "added": [ + { + "conname": "cons1", + "consrc": "true", + "connoinherit": true, + "convalidated": true + } + ] }, "ftoptions": { - "added": [{ - "option":"schema_name", - "value":"public" - },{ - "option":"table_name", - "value":"test_table" - }] + "added": [ + { + "option": "schema_name", + "value": "public" + }, + { + "option": "table_name", + "value": "test_table" + } + ] } }, "expected_sql_file": "alter_add_cons_opts.sql", @@ -171,16 +198,20 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "msql_endpoint": "NODE-foreign_table.msql_id", "data": { - "relacl":{ - "added": [{ - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[{ - "privilege_type":"r", - "privilege":true, - "with_grant":false - }] - }] + "relacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_add_priv.sql", @@ -194,26 +225,32 @@ "msql_endpoint": "NODE-foreign_table.msql_id", "data": { "ftoptions": { - "changed": [{ - "option":"schema_name", - "value":"test_public" - }] + "changed": [ + { + "option": "schema_name", + "value": "test_public" + } + ] }, "columns": { - "changed": [{ - "name": "col1", - "attnum": 1, - "attoptions": null, - "attnotnull":false, - "attstattarget": 10, - "collname": "", - "coloptions": [], - "cltype": "integer" - }], - "deleted": [{ - "name":"col2", - "cltype":"text" - }] + "changed": [ + { + "name": "col1", + "attnum": 1, + "attoptions": null, + "attnotnull": false, + "attstattarget": 10, + "collname": "", + "coloptions": [], + "cltype": "integer" + } + ], + "deleted": [ + { + "name": "col2", + "cltype": "text" + } + ] } }, "expected_sql_file": "alter_col_opts.sql", @@ -226,50 +263,62 @@ "sql_endpoint": "NODE-foreign_table.sql_id", "msql_endpoint": "NODE-foreign_table.msql_id", "data": { - "relacl":{ - "deleted": [{ - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[{ - "privilege_type":"a", - "privilege":true, - "with_grant":false - },{ - "privilege_type":"r", - "privilege":true, - "with_grant":false - }] - }] + "relacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "constraints": { - "deleted": [{ - "conname":"cons1", - "consrc":"true", - "connoinherit":true, - "convalidated":true - }] + "deleted": [ + { + "conname": "cons1", + "consrc": "true", + "connoinherit": true, + "convalidated": true + } + ] }, "ftoptions": { - "deleted": [{ - "option":"schema_name", - "value":"public" - }] + "deleted": [ + { + "option": "schema_name", + "value": "public" + } + ] } }, "expected_sql_file": "alter_remove_opts_priv_cons.sql", "expected_msql_file": "alter_remove_opts_priv_cons_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop foreign table", "endpoint": "NODE-foreign_table.delete_id" - }, { + }, + { "type": "delete", "name": "Drop foreign server", "endpoint": "NODE-foreign_server.delete_id", "data": { "name": "test_fs_for_foreign_table" } - }, { + }, + { "type": "delete", "name": "Drop FDW", "endpoint": "NODE-foreign_data_wrapper.delete_id", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json index 6b2273237ac..d9d4825caf0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/tests/default/test.json @@ -12,11 +12,12 @@ "options": [], "schema": "test", "schema_id": "", - "owner": "postgres" + "owner": "" }, "expected_sql_file": "create_fts_dictionary.sql", "expected_msql_file": "msql_create_fts_dictionary.sql" - }, { + }, + { "type": "create", "name": "Create FTS Configuration", "endpoint": "NODE-fts_configuration.obj", @@ -31,25 +32,37 @@ }, "expected_sql_file": "create_fts_conf.sql", "expected_msql_file": "msql_create_fts_conf.sql" - }, { + }, + { "type": "alter", "name": "Alter FTS Configuration add token to verify schema qualified names", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { - "tokens": {"added": [{"token": "asciiword", "dictname": ["test.test_dic"]}]} + "tokens": { + "added": [ + { + "token": "asciiword", + "dictname": [ + "test.test_dic" + ] + } + ] + } }, "expected_sql_file": "alter_fts_conf_add_token_verify_schema.sql", "expected_msql_file": "msql_alter_fts_conf_add_token_verify_schema.sql" - }, { + }, + { "type": "delete", "name": "Drop FTS Configuration", "endpoint": "NODE-fts_configuration.delete_id", "data": { "name": "test_fts_conf_$%{}[]()&*^!@\"'`\\/#" } - }, { + }, + { "type": "create", "name": "Create FTS Configuration with Parser", "endpoint": "NODE-fts_configuration.obj", @@ -64,7 +77,8 @@ }, "expected_sql_file": "create_fts_conf_def1.sql", "expected_msql_file": "msql_create_fts_conf_def1.sql" - }, { + }, + { "type": "alter", "name": "Alter FTS Configuration add comment", "endpoint": "NODE-fts_configuration.obj_id", @@ -75,18 +89,29 @@ }, "expected_sql_file": "alter_fts_conf_add_comment.sql", "expected_msql_file": "msql_alter_fts_conf_add_comment.sql" - }, { + }, + { "type": "alter", "name": "Alter FTS Configuration add token file", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { - "tokens": {"added": [{"token": "file", "dictname": ["english_stem"]}]} + "tokens": { + "added": [ + { + "token": "file", + "dictname": [ + "english_stem" + ] + } + ] + } }, "expected_sql_file": "alter_fts_conf_add_token.sql", "expected_msql_file": "msql_alter_fts_conf_add_token.sql" - }, { + }, + { "type": "alter", "name": "Alter FTS Configuration Rename", "endpoint": "NODE-fts_configuration.obj_id", @@ -97,14 +122,16 @@ }, "expected_sql_file": "alter_fts_conf_rename.sql", "expected_msql_file": "msql_alter_fts_conf_rename.sql" - }, { + }, + { "type": "delete", "name": "Drop FTS Configuration with parser", "endpoint": "NODE-fts_configuration.delete_id", "data": { "name": "test_fts_configuration_def1" } - }, { + }, + { "type": "create", "name": "Create FTS Configuration with copy config", "endpoint": "NODE-fts_configuration.obj", @@ -118,18 +145,29 @@ }, "expected_sql_file": "create_fts_conf_def2.sql", "expected_msql_file": "msql_create_fts_conf_def2.sql" - }, { + }, + { "type": "alter", "name": "Alter FTS Configuration remove token file", "endpoint": "NODE-fts_configuration.obj_id", "sql_endpoint": "NODE-fts_configuration.sql_id", "msql_endpoint": "NODE-fts_configuration.msql_id", "data": { - "tokens": {"deleted": [{"token": "word", "dictname": ["english_stem"]}]} + "tokens": { + "deleted": [ + { + "token": "word", + "dictname": [ + "english_stem" + ] + } + ] + } }, "expected_sql_file": "alter_fts_conf_remove_token.sql", "expected_msql_file": "msql_alter_fts_conf_remove_token.sql" - }, { + }, + { "type": "delete", "name": "Drop FTS Configuration with copy config", "endpoint": "NODE-fts_configuration.delete_id", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json index 3e567fe2769..2e5a12d14d4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/tests/default/tests.json @@ -12,7 +12,7 @@ "options": [], "schema": "public", "schema_id": "", - "owner": "postgres" + "owner": "" }, "expected_sql_file": "create_fts_dictionary.sql", "expected_msql_file": "msql_create_fts_dictionary.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql index 82ce0c5cc9f..ec0c05ca3dd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.msql @@ -1 +1 @@ -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql index 1efff0af6a8..3edd8afe804 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_acl.sql @@ -16,9 +16,9 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql index fa0038a42a1..012280aeba6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_add_parameter.sql @@ -17,4 +17,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.msql index a5c3dd5e5a9..62736d979c5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.msql @@ -1,3 +1,3 @@ -REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres; +REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.sql index 7ed69fc9bb2..056fde13b87 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_change_grantee_acl.sql @@ -16,6 +16,6 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql index 87306d16643..c11500fc701 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_comment.sql @@ -16,7 +16,7 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql index 1393bd7467a..58b1a1823a4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.msql @@ -1,3 +1,3 @@ REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; -REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres; +REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql index 12c8377cb53..24e4d6e027b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_acl.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql index 8e604ad5df2..60b527fcdef 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_delete_parameter.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql index 8ed3f8cd8f9..2ba8d51fc85 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_function_rename.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.msql index 67a549ead4b..271cf907c6f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.msql @@ -8,6 +8,6 @@ select 1; end; $BODY$; -REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM postgres; +REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.sql index 95f96fb41c8..570ee0ea444 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_change_grantee_priv.sql @@ -13,7 +13,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_comment.sql index 6753c2bbdfa..9262f15737d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_comment.sql @@ -12,7 +12,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_param.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_param.sql index 9eca2c4c32c..90935bf0f30 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_param.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_proc_param.sql @@ -13,7 +13,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_comment.sql index e1cfe4ba7de..f33d01d9caa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_comment.sql @@ -14,7 +14,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_1.sql index f9ab870789c..71b5878fa54 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_1.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_1.sql @@ -14,7 +14,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_2.sql index dda2309075f..63170204764 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_2.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_2.sql @@ -16,7 +16,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_3.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_3.sql index ed1e163d0b8..e061a660b08 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_3.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/alter_ptrig_set_3.sql @@ -17,7 +17,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_event_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_event_trigger_full.sql index 50f59804c18..3fc5f686b58 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_event_trigger_full.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_event_trigger_full.sql @@ -16,9 +16,9 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION; +GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO WITH GRANT OPTION; REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql index a7595a1f8a7..29f67e3601e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.msql @@ -11,4 +11,4 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql index 7be119d6a49..3de9ef72b44 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function.sql @@ -16,5 +16,5 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql index a66e41b6561..3ccc0a019a5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.msql @@ -11,4 +11,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql index 12c8377cb53..24e4d6e027b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_function_for_alter.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger.sql index 759c632e9cf..15603af8e17 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger.sql @@ -14,4 +14,4 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger_full.sql index 73040efbd08..8436d4ee8fb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger_full.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_plain_trigger_full.sql @@ -17,9 +17,9 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION; +GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO WITH GRANT OPTION; REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_procedure.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_procedure.sql index 87da57550c2..407b2cc3e2c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_procedure.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/create_procedure.sql @@ -12,4 +12,4 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json index 217330ad9a0..304714dba7f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_function.json @@ -8,7 +8,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -61,8 +61,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -72,7 +71,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -103,7 +102,7 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "name":"Function3_$%{}[]()&*^!@\"'`\\/#" + "name": "Function3_$%{}[]()&*^!@\"'`\\/#" }, "expected_sql_file": "alter_function_rename.sql", "expected_msql_file": "alter_function_rename.msql" @@ -151,8 +150,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -162,7 +160,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -196,8 +194,8 @@ "acl": { "added": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -223,7 +221,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -247,8 +245,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "X", @@ -274,7 +272,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -284,8 +282,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -304,8 +302,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -315,7 +312,7 @@ "name": "Create function with custom return type.", "data": { "name": "Function3_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "table(val character varying)", "lanname": "plpgsql", @@ -351,8 +348,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_procedures.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_procedures.json index cf0996aabd9..90035bb6be3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_procedures.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_procedures.json @@ -8,8 +8,15 @@ "data": { "name": "Proc1_$%{}[]()&*^!@\"'`\\/#", "acl": [], - "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}], - "funcowner": "postgres", + "arguments": [ + { + "argtype": "integer", + "argmode": "IN", + "argname": "i1", + "argdefval": "" + } + ], + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -25,7 +32,8 @@ "probin": "$libdir/" }, "expected_sql_file": "create_procedure.sql" - }, { + }, + { "type": "alter", "name": "Alter procedure comment", "endpoint": "NODE-procedure.obj_id", @@ -35,14 +43,20 @@ }, "expected_sql_file": "alter_proc_comment.sql", "expected_msql_file": "alter_proc_comment_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter procedure param", "endpoint": "NODE-procedure.obj_id", "sql_endpoint": "NODE-procedure.sql_id", "data": { "variables": { - "added": [{"name": "application_name", "value": "pgadmin"}] + "added": [ + { + "name": "application_name", + "value": "pgadmin" + } + ] } }, "expected_sql_file": "alter_proc_param.sql", @@ -58,7 +72,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -68,8 +82,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege": true, @@ -92,7 +106,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -115,8 +129,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege": true, @@ -135,8 +149,7 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_trigger_functions.json index 6abea3d2a72..3d0a0939635 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_trigger_functions.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/11_plus/test_trigger_functions.json @@ -9,7 +9,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -20,7 +20,8 @@ "schema": "public" }, "expected_sql_file": "create_plain_trigger.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function comment", "endpoint": "NODE-trigger_function.obj_id", @@ -29,7 +30,8 @@ "description": "some comment" }, "expected_sql_file": "alter_ptrig_comment.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility", "endpoint": "NODE-trigger_function.obj_id", @@ -41,7 +43,8 @@ "provolatile": "s" }, "expected_sql_file": "alter_ptrig_set_1.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param", "endpoint": "NODE-trigger_function.obj_id", @@ -50,64 +53,76 @@ "procost": "123", "provolatile": "i", "variables": { - "added": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }] + "added": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ] } }, "expected_sql_file": "alter_ptrig_set_2.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 3 - Add Param, Change Param", "endpoint": "NODE-trigger_function.obj_id", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "variables": { - "added": [{ - "name": "application_name", - "value": "appname2" - }], - "changed": [{ - "name": "array_nulls", - "value": true - },{ - "name": "search_path", - "value": "public, pg_catalog" - }] + "added": [ + { + "name": "application_name", + "value": "appname2" + } + ], + "changed": [ + { + "name": "array_nulls", + "value": true + }, + { + "name": "search_path", + "value": "public, pg_catalog" + } + ] } }, "expected_sql_file": "alter_ptrig_set_3.sql" - }, { + }, + { "type": "delete", "name": "Drop trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -122,43 +137,49 @@ "provolatile": "v", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ], "schema": "public" }, "expected_sql_file": "create_plain_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged event trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -173,19 +194,21 @@ "provolatile": "v", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + } + ], "schema": "public" }, "expected_sql_file": "create_event_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged event trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_func_remove_partial_pri.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_func_remove_partial_pri.sql index d31d790cd11..baaa2c4e05d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_func_remove_partial_pri.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_func_remove_partial_pri.sql @@ -16,8 +16,8 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql index 82ce0c5cc9f..ec0c05ca3dd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.msql @@ -1 +1 @@ -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql index 1efff0af6a8..3edd8afe804 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_acl.sql @@ -16,9 +16,9 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql index fa0038a42a1..012280aeba6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_add_parameter.sql @@ -17,4 +17,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.msql index a5c3dd5e5a9..62736d979c5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.msql @@ -1,3 +1,3 @@ -REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres; +REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.sql index 7ed69fc9bb2..056fde13b87 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_change_grantee_acl.sql @@ -16,6 +16,6 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql index 87306d16643..c11500fc701 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_comment.sql @@ -16,7 +16,7 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql index 1393bd7467a..58b1a1823a4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.msql @@ -1,3 +1,3 @@ REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; -REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres; +REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql index 12c8377cb53..24e4d6e027b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_acl.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql index 8e604ad5df2..60b527fcdef 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_delete_parameter.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql index 8ed3f8cd8f9..2ba8d51fc85 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_function_rename.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.msql index 9f6362a8a5d..5585c1eaa9e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.msql @@ -1,3 +1,3 @@ GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; -GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres; \ No newline at end of file +GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO ; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.sql index 8472d26f032..710a64e059b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_add_priv.sql @@ -13,11 +13,11 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; -GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres; +GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.msql index c5055f4c59f..0c6758de7bd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.msql @@ -1,3 +1,3 @@ -REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM postgres; +REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.sql index 95f96fb41c8..570ee0ea444 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_change_grantee_priv.sql @@ -13,7 +13,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql index 6753c2bbdfa..9262f15737d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_comment.sql @@ -12,7 +12,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_delete_priv.sql index 0c429dac9fb..15d468d3767 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_delete_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_delete_priv.sql @@ -13,9 +13,9 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres; +GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO ; REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql index 9eca2c4c32c..90935bf0f30 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_proc_param.sql @@ -13,7 +13,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql index e1cfe4ba7de..f33d01d9caa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_comment.sql @@ -14,7 +14,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql index f9ab870789c..71b5878fa54 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_1.sql @@ -14,7 +14,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql index dda2309075f..63170204764 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_2.sql @@ -16,7 +16,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql index ed1e163d0b8..e061a660b08 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/alter_ptrig_set_3.sql @@ -17,7 +17,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql index 90a6c6db8ce..b16e1a68e38 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_event_trigger_full.sql @@ -16,9 +16,9 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION; +GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO WITH GRANT OPTION; REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql index a7595a1f8a7..29f67e3601e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.msql @@ -11,4 +11,4 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql index 7be119d6a49..3de9ef72b44 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function.sql @@ -16,5 +16,5 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql index a66e41b6561..3ccc0a019a5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.msql @@ -11,4 +11,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql index 12c8377cb53..24e4d6e027b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_function_for_alter.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql index 759c632e9cf..15603af8e17 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger.sql @@ -14,4 +14,4 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql index b07f721c7e5..bc448f6b07e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_plain_trigger_full.sql @@ -17,9 +17,9 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION; +GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO WITH GRANT OPTION; REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.msql index 390e7b822c8..e7c23fd4f56 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.msql @@ -7,4 +7,4 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; \ No newline at end of file + OWNER TO ; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql index 87da57550c2..407b2cc3e2c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/create_procedure.sql @@ -12,4 +12,4 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json index 61f39447433..ac0348d8465 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_function.json @@ -8,7 +8,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -61,8 +61,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -72,7 +71,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -103,7 +102,7 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "name":"Function3_$%{}[]()&*^!@\"'`\\/#" + "name": "Function3_$%{}[]()&*^!@\"'`\\/#" }, "expected_sql_file": "alter_function_rename.sql", "expected_msql_file": "alter_function_rename.msql" @@ -151,8 +150,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -162,7 +160,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -196,8 +194,8 @@ "acl": { "added": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -223,7 +221,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -249,8 +247,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "X", @@ -276,7 +274,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -286,8 +284,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -306,8 +304,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -317,7 +314,7 @@ "name": "Create function with custom return type.", "data": { "name": "Function3_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "table(val character varying)", "lanname": "plpgsql", @@ -353,8 +350,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json index 7a3d54d6468..9550cbb55e3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_procedures.json @@ -9,8 +9,15 @@ "data": { "name": "Proc1_$%{}[]()&*^!@\"'`\\/#", "acl": [], - "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}], - "funcowner": "postgres", + "arguments": [ + { + "argtype": "integer", + "argmode": "IN", + "argname": "i1", + "argdefval": "" + } + ], + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -48,7 +55,12 @@ "msql_endpoint": "NODE-procedure.msql_id", "data": { "variables": { - "added": [{"name": "application_name", "value": "pgadmin"}] + "added": [ + { + "name": "application_name", + "value": "pgadmin" + } + ] } }, "expected_sql_file": "alter_proc_param.sql", @@ -65,7 +77,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -75,8 +87,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege": true, @@ -102,7 +114,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -128,8 +140,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege": true, @@ -148,8 +160,7 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json index a2e9fc70d6d..a8b3b078c32 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/12_plus/test_trigger_functions.json @@ -9,7 +9,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -20,7 +20,8 @@ "schema": "public" }, "expected_sql_file": "create_plain_trigger.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function comment", "endpoint": "NODE-trigger_function.obj_id", @@ -29,7 +30,8 @@ "description": "some comment" }, "expected_sql_file": "alter_ptrig_comment.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility", "endpoint": "NODE-trigger_function.obj_id", @@ -41,7 +43,8 @@ "provolatile": "s" }, "expected_sql_file": "alter_ptrig_set_1.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param", "endpoint": "NODE-trigger_function.obj_id", @@ -50,64 +53,76 @@ "procost": "123", "provolatile": "i", "variables": { - "added": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }] + "added": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ] } }, "expected_sql_file": "alter_ptrig_set_2.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 3 - Add Param, Change Param", "endpoint": "NODE-trigger_function.obj_id", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "variables": { - "added": [{ - "name": "application_name", - "value": "appname2" - }], - "changed": [{ - "name": "array_nulls", - "value": true - },{ - "name": "search_path", - "value": "public, pg_catalog" - }] + "added": [ + { + "name": "application_name", + "value": "appname2" + } + ], + "changed": [ + { + "name": "array_nulls", + "value": true + }, + { + "name": "search_path", + "value": "public, pg_catalog" + } + ] } }, "expected_sql_file": "alter_ptrig_set_3.sql" - }, { + }, + { "type": "delete", "name": "Drop trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -122,43 +137,49 @@ "provolatile": "s", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ], "schema": "public" }, "expected_sql_file": "create_plain_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged event trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -173,19 +194,21 @@ "provolatile": "s", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + } + ], "schema": "public" }, "expected_sql_file": "create_event_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged event trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_function_no_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_function_no_depends.sql index 033b54de620..3a34f8e58d3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_function_no_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_function_no_depends.sql @@ -16,7 +16,7 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_proc_no_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_proc_no_depends.sql index 632073e31b9..d57a09fab70 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_proc_no_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/alter_proc_no_depends.sql @@ -12,7 +12,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) DEPENDS ON EXTENSION plpgsql; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.msql index 418af03ed11..2fe6a04ad36 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.msql @@ -11,7 +11,7 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.sql index 3d54e5da4cf..4e896233133 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_function_on_depends.sql @@ -16,7 +16,7 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.msql index d6bb2b07557..07c2e9739af 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.msql @@ -7,7 +7,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.sql index ddb2b7eb669..8a4316762f5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/create_procedure_on_depends.sql @@ -12,7 +12,7 @@ end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_function.json index 944d1fbcf8f..7b7dd946596 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_function.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_function.json @@ -20,7 +20,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -52,7 +52,10 @@ ], "seclabels": [], "acl": [], - "dependsonextensions": ["plpgsql", "postgres_fdw"], + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ], "schema": "public" }, "expected_sql_file": "create_function_on_depends.sql", @@ -65,7 +68,9 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "expected_sql_file": "alter_function_no_depends.sql", "expected_msql_file": "alter_function_no_depends.msql" @@ -74,15 +79,16 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "delete", "name": "Drop Extension", "endpoint": "NODE-extension.delete", "data": { - "ids": [""] + "ids": [ + "" + ] }, "preprocess_data": true }, @@ -94,7 +100,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -147,8 +153,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -158,7 +163,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -189,7 +194,7 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "name":"Function3_$%{}[]()&*^!@\"'`\\/#" + "name": "Function3_$%{}[]()&*^!@\"'`\\/#" }, "expected_sql_file": "alter_function_rename.sql", "expected_msql_file": "alter_function_rename.msql" @@ -237,8 +242,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -248,7 +252,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -282,8 +286,8 @@ "acl": { "added": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -309,7 +313,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -335,8 +339,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "X", @@ -362,7 +366,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -372,8 +376,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -392,8 +396,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -403,7 +406,7 @@ "name": "Create function with custom return type.", "data": { "name": "Function3_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "table(val character varying)", "lanname": "plpgsql", @@ -439,8 +442,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_procedures.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_procedures.json index b95698ac881..a684930d4c4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_procedures.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/13_plus/test_procedures.json @@ -21,8 +21,15 @@ "data": { "name": "Proc1_$%{}[]()&*^!@\"'`\\/#", "acl": [], - "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}], - "funcowner": "postgres", + "arguments": [ + { + "argtype": "integer", + "argmode": "IN", + "argname": "i1", + "argdefval": "" + } + ], + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -36,7 +43,10 @@ "procost": null, "proleakproof": false, "probin": "$libdir/", - "dependsonextensions": ["plpgsql", "postgres_fdw"] + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ] }, "expected_sql_file": "create_procedure_on_depends.sql", "expected_msql_file": "create_procedure_on_depends.msql" @@ -48,7 +58,9 @@ "sql_endpoint": "NODE-procedure.sql_id", "msql_endpoint": "NODE-procedure.msql_id", "data": { - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "expected_sql_file": "alter_proc_no_depends.sql", "expected_msql_file": "alter_proc_no_depends.msql" @@ -57,15 +69,16 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} }, { "type": "delete", "name": "Drop Extension", "endpoint": "NODE-extension.delete", "data": { - "ids": [""] + "ids": [ + "" + ] }, "preprocess_data": true }, @@ -78,8 +91,15 @@ "data": { "name": "Proc1_$%{}[]()&*^!@\"'`\\/#", "acl": [], - "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}], - "funcowner": "postgres", + "arguments": [ + { + "argtype": "integer", + "argmode": "IN", + "argname": "i1", + "argdefval": "" + } + ], + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -117,7 +137,12 @@ "msql_endpoint": "NODE-procedure.msql_id", "data": { "variables": { - "added": [{"name": "application_name", "value": "pgadmin"}] + "added": [ + { + "name": "application_name", + "value": "pgadmin" + } + ] } }, "expected_sql_file": "alter_proc_param.sql", @@ -134,7 +159,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -144,8 +169,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege": true, @@ -171,7 +196,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -197,8 +222,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege": true, @@ -217,8 +242,7 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.msql index 9f6362a8a5d..5585c1eaa9e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.msql @@ -1,3 +1,3 @@ GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; -GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres; \ No newline at end of file +GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO ; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.sql index 6d2d05f8f78..71734a99136 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_add_priv.sql @@ -12,11 +12,11 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; -GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres; +GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_change_grantee_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_change_grantee_priv.sql index d7b6550a3c7..dc82931cf08 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_change_grantee_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_change_grantee_priv.sql @@ -12,7 +12,7 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_comment.sql index c550c19db4f..3dc7bb338c4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_comment.sql @@ -11,7 +11,7 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_delete_priv.sql index 54ed1a4ce52..c8e64dcb74e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_delete_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_delete_priv.sql @@ -12,9 +12,9 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres; +GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO ; REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_no_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_no_depends.sql index c5ecff1e222..f2bce4e051e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_no_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_no_depends.sql @@ -11,7 +11,7 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) DEPENDS ON EXTENSION plpgsql; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_param.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_param.sql index 74ae1c6b95e..436dda88ff7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_param.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/alter_proc_param.sql @@ -12,7 +12,7 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.msql index 13a0049492b..6ae1da48354 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.msql @@ -9,4 +9,4 @@ begin atomic end; ALTER FUNCTION public."Function4_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.sql index 3218799f080..522525bd19d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_func.sql @@ -14,4 +14,4 @@ BEGIN ATOMIC END; ALTER FUNCTION public."Function4_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; \ No newline at end of file + OWNER TO ; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.msql index 15e27782825..9c60c39a063 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.msql @@ -7,7 +7,7 @@ select 1; end; ALTER PROCEDURE public."Proc3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc3_$%{}[]()&*^!@""'`\/#"() IS 'demo comments'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.sql index 0a0aec7e430..2795acc00c0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_atomic_proc.sql @@ -12,7 +12,7 @@ BEGIN ATOMIC END; ALTER PROCEDURE public."Proc3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON PROCEDURE public."Proc3_$%{}[]()&*^!@""'`\/#"() IS 'demo comments'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.msql index 10f1d3687f9..8b7d166f370 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.msql @@ -6,4 +6,4 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; \ No newline at end of file + OWNER TO ; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.sql index d5dd6b3e59b..f7dd2dcc783 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure.sql @@ -11,4 +11,4 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.msql index fc7d54c28a0..bcc02c4aea7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.msql @@ -6,7 +6,7 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.sql index 82cf5aa3487..14d383d693c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/create_procedure_on_depends.sql @@ -11,7 +11,7 @@ select 1; end; $BODY$; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) - OWNER TO postgres; + OWNER TO ; ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_function.json index 39c720ecd29..a4ce7162496 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_function.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_function.json @@ -10,7 +10,7 @@ "version": "", "relocatable": true }, - "store_object_id": true + "store_object_id": true }, { "type": "create", @@ -20,7 +20,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -52,7 +52,10 @@ ], "seclabels": [], "acl": [], - "dependsonextensions": ["plpgsql", "postgres_fdw"], + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ], "schema": "public" }, "expected_sql_file": "create_function_on_depends.sql", @@ -65,7 +68,9 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "expected_sql_file": "alter_function_no_depends.sql", "expected_msql_file": "alter_function_no_depends.msql" @@ -74,15 +79,16 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "delete", "name": "Drop Extension", "endpoint": "NODE-extension.delete", "data": { - "ids": [""] + "ids": [ + "" + ] }, "preprocess_data": true }, @@ -94,7 +100,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -147,8 +153,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -158,7 +163,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -189,7 +194,7 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "name":"Function3_$%{}[]()&*^!@\"'`\\/#" + "name": "Function3_$%{}[]()&*^!@\"'`\\/#" }, "expected_sql_file": "alter_function_rename.sql", "expected_msql_file": "alter_function_rename.msql" @@ -237,8 +242,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -248,7 +252,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -282,8 +286,8 @@ "acl": { "added": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -309,7 +313,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -335,8 +339,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "X", @@ -362,7 +366,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -372,8 +376,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -392,8 +396,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -404,7 +407,7 @@ "store_object_id": "True", "data": { "name": "Function4_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "numeric", "lanname": "sql", @@ -415,14 +418,14 @@ "options": [], "variables": [], "seclabels": [], - "prosecdef":true, + "prosecdef": true, "acl": [], - "provolatile":"v", - "proisstrict":true, - "proiswindow":true, - "proparallel":"u", - "procost":"100", - "proleakproof":true, + "provolatile": "v", + "proisstrict": true, + "proiswindow": true, + "proparallel": "u", + "procost": "100", + "proleakproof": true, "schema": "public" }, "expected_sql_file": "create_atomic_func.sql", @@ -432,8 +435,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -443,7 +445,7 @@ "name": "Create function with custom return type.", "data": { "name": "Function3_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "table(val character varying)", "lanname": "plpgsql", @@ -479,8 +481,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_procedures.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_procedures.json index 67c1976d5bc..3e4c171f8cc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_procedures.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_procedures.json @@ -21,8 +21,15 @@ "data": { "name": "Proc1_$%{}[]()&*^!@\"'`\\/#", "acl": [], - "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}], - "funcowner": "postgres", + "arguments": [ + { + "argtype": "integer", + "argmode": "IN", + "argname": "i1", + "argdefval": "" + } + ], + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -36,7 +43,10 @@ "procost": null, "proleakproof": false, "probin": "$libdir/", - "dependsonextensions": ["plpgsql", "postgres_fdw"] + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ] }, "expected_sql_file": "create_procedure_on_depends.sql", "expected_msql_file": "create_procedure_on_depends.msql" @@ -48,7 +58,9 @@ "sql_endpoint": "NODE-procedure.sql_id", "msql_endpoint": "NODE-procedure.msql_id", "data": { - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "expected_sql_file": "alter_proc_no_depends.sql", "expected_msql_file": "alter_proc_no_depends.msql" @@ -57,15 +69,16 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} }, { "type": "delete", "name": "Drop Extension", "endpoint": "NODE-extension.delete", "data": { - "ids": [""] + "ids": [ + "" + ] }, "preprocess_data": true }, @@ -78,8 +91,15 @@ "data": { "name": "Proc1_$%{}[]()&*^!@\"'`\\/#", "acl": [], - "arguments": [{"argtype": "integer", "argmode": "IN", "argname": "i1", "argdefval": ""}], - "funcowner": "postgres", + "arguments": [ + { + "argtype": "integer", + "argmode": "IN", + "argname": "i1", + "argdefval": "" + } + ], + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -96,7 +116,8 @@ }, "expected_sql_file": "create_procedure.sql", "expected_msql_file": "create_procedure.msql" - }, { + }, + { "type": "alter", "name": "Alter procedure comment", "endpoint": "NODE-procedure.obj_id", @@ -107,7 +128,8 @@ }, "expected_sql_file": "alter_proc_comment.sql", "expected_msql_file": "alter_proc_comment_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter procedure param", "endpoint": "NODE-procedure.obj_id", @@ -115,7 +137,12 @@ "msql_endpoint": "NODE-procedure.msql_id", "data": { "variables": { - "added": [{"name": "application_name", "value": "pgadmin"}] + "added": [ + { + "name": "application_name", + "value": "pgadmin" + } + ] } }, "expected_sql_file": "alter_proc_param.sql", @@ -132,7 +159,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -142,8 +169,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege": true, @@ -169,7 +196,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege": true, @@ -195,8 +222,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege": true, @@ -215,8 +242,7 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -225,25 +251,30 @@ "sql_endpoint": "NODE-procedure.sql_id", "msql_endpoint": "NODE-procedure.msql", "data": { - "name":"Proc3_$%{}[]()&*^!@\"'`\\/#", - "funcowner":"postgres", - "pronamespace":2200, - "description":"demo comments", - "lanname":"sql", - "provolatile":null, - "proisstrict":false, - "proparallel":null, - "procost":null, - "prorows":0, - "proleakproof":false, - "arguments":[], - "prosrc":"begin atomic\nselect 1;\nend", - "probin":"$libdir/", - "options":[], - "seclabels":[], - "acl":[], + "name": "Proc3_$%{}[]()&*^!@\"'`\\/#", + "funcowner": "", + "pronamespace": 2200, + "description": "demo comments", + "lanname": "sql", + "provolatile": null, + "proisstrict": false, + "proparallel": null, + "procost": null, + "prorows": 0, + "proleakproof": false, + "arguments": [], + "prosrc": "begin atomic\nselect 1;\nend", + "probin": "$libdir/", + "options": [], + "seclabels": [], + "acl": [], "schema": "public", - "variables":[{"name":"application_name","value":"demo"}] + "variables": [ + { + "name": "application_name", + "value": "demo" + } + ] }, "expected_sql_file": "create_atomic_proc.sql", "expected_msql_file": "create_atomic_proc.msql" @@ -252,8 +283,7 @@ "type": "delete", "name": "Drop procedure", "endpoint": "NODE-procedure.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_trigger_functions.json index a2e9fc70d6d..a8b3b078c32 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_trigger_functions.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/14_plus/test_trigger_functions.json @@ -9,7 +9,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -20,7 +20,8 @@ "schema": "public" }, "expected_sql_file": "create_plain_trigger.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function comment", "endpoint": "NODE-trigger_function.obj_id", @@ -29,7 +30,8 @@ "description": "some comment" }, "expected_sql_file": "alter_ptrig_comment.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility", "endpoint": "NODE-trigger_function.obj_id", @@ -41,7 +43,8 @@ "provolatile": "s" }, "expected_sql_file": "alter_ptrig_set_1.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param", "endpoint": "NODE-trigger_function.obj_id", @@ -50,64 +53,76 @@ "procost": "123", "provolatile": "i", "variables": { - "added": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }] + "added": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ] } }, "expected_sql_file": "alter_ptrig_set_2.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 3 - Add Param, Change Param", "endpoint": "NODE-trigger_function.obj_id", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "variables": { - "added": [{ - "name": "application_name", - "value": "appname2" - }], - "changed": [{ - "name": "array_nulls", - "value": true - },{ - "name": "search_path", - "value": "public, pg_catalog" - }] + "added": [ + { + "name": "application_name", + "value": "appname2" + } + ], + "changed": [ + { + "name": "array_nulls", + "value": true + }, + { + "name": "search_path", + "value": "public, pg_catalog" + } + ] } }, "expected_sql_file": "alter_ptrig_set_3.sql" - }, { + }, + { "type": "delete", "name": "Drop trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -122,43 +137,49 @@ "provolatile": "s", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ], "schema": "public" }, "expected_sql_file": "create_plain_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged event trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -173,19 +194,21 @@ "provolatile": "s", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + } + ], "schema": "public" }, "expected_sql_file": "create_event_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged event trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.msql index 82ce0c5cc9f..ec0c05ca3dd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.msql @@ -1 +1 @@ -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.sql index 1efff0af6a8..3edd8afe804 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_acl.sql @@ -16,9 +16,9 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; -GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres; +GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_parameter.sql index fa0038a42a1..012280aeba6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_add_parameter.sql @@ -17,4 +17,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.msql index a5c3dd5e5a9..62736d979c5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.msql @@ -1,3 +1,3 @@ -REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres; +REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.sql index 7ed69fc9bb2..056fde13b87 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_change_grantee_acl.sql @@ -16,6 +16,6 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_comment.sql index 87306d16643..c11500fc701 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_comment.sql @@ -16,7 +16,7 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.msql index 1393bd7467a..58b1a1823a4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.msql @@ -1,3 +1,3 @@ REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; -REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres; +REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.sql index 12c8377cb53..24e4d6e027b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_acl.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_parameter.sql index 8e604ad5df2..60b527fcdef 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_delete_parameter.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_rename.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_rename.sql index 8ed3f8cd8f9..2ba8d51fc85 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_rename.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_function_rename.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_comment.sql index e1cfe4ba7de..f33d01d9caa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_comment.sql @@ -14,7 +14,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_1.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_1.sql index f9ab870789c..71b5878fa54 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_1.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_1.sql @@ -14,7 +14,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_2.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_2.sql index dda2309075f..63170204764 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_2.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_2.sql @@ -16,7 +16,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_3.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_3.sql index ed1e163d0b8..e061a660b08 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_3.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/alter_ptrig_set_3.sql @@ -17,7 +17,7 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() IS 'some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_event_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_event_trigger_full.sql index 50f59804c18..3fc5f686b58 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_event_trigger_full.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_event_trigger_full.sql @@ -16,9 +16,9 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION; +GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO WITH GRANT OPTION; REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.msql index a7595a1f8a7..29f67e3601e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.msql @@ -11,4 +11,4 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.sql index 7be119d6a49..3de9ef72b44 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function.sql @@ -16,5 +16,5 @@ end $BODY$; ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.msql index a66e41b6561..3ccc0a019a5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.msql @@ -11,4 +11,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.sql index 12c8377cb53..24e4d6e027b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_for_alter.sql @@ -16,4 +16,4 @@ end $BODY$; ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.msql index 8257f9079fe..1a91e002351 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.msql @@ -10,4 +10,4 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.sql index 30c4d849366..8a9a595b5de 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_function_with_custom_return.sql @@ -17,5 +17,5 @@ end $BODY$; ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"(character varying) - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger.sql index 759c632e9cf..15603af8e17 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger.sql @@ -14,4 +14,4 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger_full.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger_full.sql index 73040efbd08..8436d4ee8fb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger_full.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/create_plain_trigger_full.sql @@ -17,9 +17,9 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; -GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION; +GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO WITH GRANT OPTION; REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_function.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_function.json index 2834656456d..5ecb2f03e4c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_function.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_function.json @@ -8,7 +8,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function1_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -61,8 +61,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -72,7 +71,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -103,7 +102,7 @@ "msql_endpoint": "NODE-function.msql_id", "sql_endpoint": "NODE-function.sql_id", "data": { - "name":"Function3_$%{}[]()&*^!@\"'`\\/#" + "name": "Function3_$%{}[]()&*^!@\"'`\\/#" }, "expected_sql_file": "alter_function_rename.sql", "expected_msql_file": "alter_function_rename.msql" @@ -151,8 +150,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -162,7 +160,7 @@ "sql_endpoint": "NODE-function.sql_id", "data": { "name": "Function2_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "character varying", "lanname": "plpgsql", @@ -196,8 +194,8 @@ "acl": { "added": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -223,7 +221,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -247,8 +245,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "X", @@ -274,7 +272,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -284,8 +282,8 @@ ] }, { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "X", @@ -304,8 +302,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} }, { "type": "create", @@ -315,7 +312,7 @@ "name": "Create function with custom return type.", "data": { "name": "Function3_$%{}[]()&*^!@\"'`\\/#", - "funcowner": "postgres", + "funcowner": "", "pronamespace": 2200, "prorettypename": "table(val character varying)", "lanname": "plpgsql", @@ -351,8 +348,7 @@ "type": "delete", "name": "Drop function", "endpoint": "NODE-function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_trigger_functions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_trigger_functions.json index 6abea3d2a72..3d0a0939635 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_trigger_functions.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/pg/default/test_trigger_functions.json @@ -9,7 +9,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, @@ -20,7 +20,8 @@ "schema": "public" }, "expected_sql_file": "create_plain_trigger.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function comment", "endpoint": "NODE-trigger_function.obj_id", @@ -29,7 +30,8 @@ "description": "some comment" }, "expected_sql_file": "alter_ptrig_comment.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 1 - Strict, Leakproof, Security of definer, Volatility", "endpoint": "NODE-trigger_function.obj_id", @@ -41,7 +43,8 @@ "provolatile": "s" }, "expected_sql_file": "alter_ptrig_set_1.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 2 - Cost, Volatility, Add Param", "endpoint": "NODE-trigger_function.obj_id", @@ -50,64 +53,76 @@ "procost": "123", "provolatile": "i", "variables": { - "added": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }] + "added": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ] } }, "expected_sql_file": "alter_ptrig_set_2.sql" - }, { + }, + { "type": "alter", "name": "Alter trigger function Set 3 - Add Param, Change Param", "endpoint": "NODE-trigger_function.obj_id", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "variables": { - "added": [{ - "name": "application_name", - "value": "appname2" - }], - "changed": [{ - "name": "array_nulls", - "value": true - },{ - "name": "search_path", - "value": "public, pg_catalog" - }] + "added": [ + { + "name": "application_name", + "value": "appname2" + } + ], + "changed": [ + { + "name": "array_nulls", + "value": true + }, + { + "name": "search_path", + "value": "public, pg_catalog" + } + ] } }, "expected_sql_file": "alter_ptrig_set_3.sql" - }, { + }, + { "type": "delete", "name": "Drop trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -122,43 +137,49 @@ "provolatile": "v", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - },{ - "name": "search_path", - "value": "public, pg_temp" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + }, + { + "name": "search_path", + "value": "public, pg_temp" + } + ], "schema": "public" }, "expected_sql_file": "create_plain_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } - }, { + "data": {} + }, + { "type": "create", "name": "Create full fledged event trigger function", "endpoint": "NODE-trigger_function.obj", "sql_endpoint": "NODE-trigger_function.sql_id", "data": { "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", - "acl": [{ - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege": true, - "privilege_type": "X", - "with_grant": true - } - ] - }], + "acl": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege": true, + "privilege_type": "X", + "with_grant": true + } + ] + } + ], "args": [], "description": "some comment", - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "procost": "1234", @@ -173,19 +194,21 @@ "provolatile": "v", "prosrc": "begin\nselect 1;\nend;", "seclabels": [], - "variables": [{ - "name": "application_name", - "value": "appname" - }], + "variables": [ + { + "name": "application_name", + "value": "appname" + } + ], "schema": "public" }, "expected_sql_file": "create_event_trigger_full.sql" - }, { + }, + { "type": "delete", "name": "Drop full fledged event trigger function", "endpoint": "NODE-trigger_function.delete_id", - "data": { - } + "data": {} } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_logged.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_logged.sql index 5f9d93a42d3..995cb075327 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_logged.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_logged.sql @@ -10,4 +10,4 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_unlogged.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_unlogged.sql index 6a1470849c8..64e55b770d5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_unlogged.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/alter_seq_set_unlogged.sql @@ -10,4 +10,4 @@ CREATE UNLOGGED SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence.sql index 6a1470849c8..64e55b770d5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence.sql @@ -10,4 +10,4 @@ CREATE UNLOGGED SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence_msql.sql index f5aff5aab4e..2a93c12a0bf 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/create_unlogged_sequence_msql.sql @@ -6,4 +6,4 @@ CREATE UNLOGGED SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/test_sequences_pg.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/test_sequences_pg.json index 73147e7cd38..9677904239b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/test_sequences_pg.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/15_plus/test_sequences_pg.json @@ -1,352 +1,396 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Table for Owned By", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "tableforownedby", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "col2", - "cltype": "text" - }, - { - "name": "col3", - "cltype": "integer" - } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true - }, - { - "type": "create", - "name": "Create Sequence", - "endpoint": "NODE-sequence.obj", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", - "schema": "public", - "increment": "5", - "start": "5", - "maximum": "999", - "minimum": "5", - "cache": "1", - "cycled": false, - "relacl": [], - "securities": [] - }, - "expected_sql_file": "create_sequence.sql", - "expected_msql_file": "create_sequence_msql.sql" - },{ - "type": "alter", - "name": "Alter Sequence comment", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "comment": "Some comment" - }, - "expected_sql_file": "alter_seq_comment.sql", - "expected_msql_file": "alter_seq_comment_msql.sql" - },{ - "type": "alter", - "name": "Alter Sequence properties", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "current_value": "7", "increment": "12", "minimum": "2", "maximum": "9992", "cache": "2", "cycled": true - }, - "expected_sql_file": "alter_seq_props.sql", - "expected_msql_file": "alter_seq_props_msql.sql" - },{ - "type": "alter", - "name": "Alter Sequence add privileges", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "sql_endpoint": "NODE-sequence.sql_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relacl": { - "added":[{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] - } - }, - "expected_sql_file": "alter_seq_privs_add.sql", - "expected_msql_file": "alter_seq_privs_add_msql.sql" - },{ - "type": "alter", - "name": "Alter Sequence update privileges", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relacl": { - "changed":[{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] + "scenarios": [ + { + "type": "create", + "name": "Create Table for Owned By", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "tableforownedby", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "col2", + "cltype": "text" + }, + { + "name": "col3", + "cltype": "integer" } - }, - "expected_sql_file": "alter_seq_privs_update.sql", - "expected_msql_file": "alter_seq_privs_update_msql.sql" + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" + }, + "store_object_id": true + }, + { + "type": "create", + "name": "Create Sequence", + "endpoint": "NODE-sequence.obj", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", + "seqowner": "", + "schema": "public", + "increment": "5", + "start": "5", + "maximum": "999", + "minimum": "5", + "cache": "1", + "cycled": false, + "relacl": [], + "securities": [] + }, + "expected_sql_file": "create_sequence.sql", + "expected_msql_file": "create_sequence_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence comment", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "comment": "Some comment" }, - { - "type": "alter", - "name": "Alter Sequence remove partial privileges", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relacl": { - "deleted":[{ + "expected_sql_file": "alter_seq_comment.sql", + "expected_msql_file": "alter_seq_comment_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence properties", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "current_value": "7", + "increment": "12", + "minimum": "2", + "maximum": "9992", + "cache": "2", + "cycled": true + }, + "expected_sql_file": "alter_seq_props.sql", + "expected_msql_file": "alter_seq_props_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence add privileges", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relacl": { + "added": [ + { "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] - } + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "alter", - "name": "Alter Sequence change grantee in privileges", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relacl": { - "changed":[{ + "expected_sql_file": "alter_seq_privs_add.sql", + "expected_msql_file": "alter_seq_privs_add_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence update privileges", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relacl": { + "changed": [ + { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] - } - }, - "expected_sql_file": "alter_seq_change_grantee_privs.sql", - "expected_msql_file": "alter_seq_change_grantee_privs_msql.sql" + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, - { - "type": "alter", - "name": "Alter Sequence remove privileges", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relacl": { - "deleted":[{ + "expected_sql_file": "alter_seq_privs_update.sql", + "expected_msql_file": "alter_seq_privs_update_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence remove partial privileges", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relacl": { + "deleted": [ + { "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] - } - }, - "expected_sql_file": "alter_seq_privs_remove.sql", - "expected_msql_file": "alter_seq_privs_remove_msql.sql" - }, { - "type": "delete", - "name": "Drop sequence", - "endpoint": "NODE-sequence.delete_id", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } - }, { - "type": "create", - "name": "Create Sequence with Negative value", - "endpoint": "NODE-sequence.obj", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", - "schema": "public", - "increment": "-5", - "start": "-30", - "maximum": "-10", - "minimum": "-40", - "cache": "1", - "cycled": false, - "relacl": [], - "securities": [] - }, - "expected_sql_file": "create_negative_sequence.sql", - "expected_msql_file": "create_negative_sequence_msql.sql" - }, { - "type": "alter", - "name": "Alter Sequence properties with negative value", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "increment": "-7", "minimum": "-35", "maximum": "-15" - }, - "expected_sql_file": "alter_neg_seq_props.sql", - "expected_msql_file": "alter_neg_seq_props_msql.sql" - }, { - "type": "delete", - "name": "Drop negative sequence", - "endpoint": "NODE-sequence.delete_id", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "alter", + "name": "Alter Sequence change grantee in privileges", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relacl": { + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Sequence with Owned By", - "endpoint": "NODE-sequence.obj", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", - "schema": "public", - "increment": "5", - "start": "5", - "maximum": "999", - "minimum": "5", - "cache": "1", - "cycled": false, - "owned_table": "tableforownedby", - "owned_column": "col1", - "relacl": [], - "securities": [] - }, - "expected_sql_file": "create_sequence_ownedby.sql", - "expected_msql_file": "create_sequence_ownedby_msql.sql" - }, { - "type": "alter", - "name": "Alter Sequence owned by column", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "owned_column": "col2" - }, - "expected_sql_file": "alter_ownedby_column.sql", - "expected_msql_file": "alter_ownedby_column_msql.sql" - }, { - "type": "alter", - "name": "Alter Sequence remove owned by", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "owned_table": "", - "owned_column": "" - }, - "expected_sql_file": "alter_ownedby_remove.sql", - "expected_msql_file": "alter_ownedby_remove_msql.sql" - }, { - "type": "delete", - "name": "Drop owned by sequence", - "endpoint": "NODE-sequence.delete_id", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" - } - }, { - "type": "create", - "name": "Create unlogged sequence", - "endpoint": "NODE-sequence.obj", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", - "schema": "public", - "increment": "5", - "start": "5", - "maximum": "999", - "minimum": "5", - "cache": "1", - "cycled": false, - "relpersistence": true, - "relacl": [], - "securities": [] - }, - "expected_sql_file": "create_unlogged_sequence.sql", - "expected_msql_file": "create_unlogged_sequence_msql.sql" - }, { - "type": "alter", - "name": "Alter sequence set logged", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relpersistence": false - }, - "expected_sql_file": "alter_seq_set_logged.sql", - "expected_msql_file": "alter_seq_set_logged_msql.sql" - }, { - "type": "alter", - "name": "Alter sequence set unlogged", - "endpoint": "NODE-sequence.obj_id", - "sql_endpoint": "NODE-sequence.sql_id", - "msql_endpoint": "NODE-sequence.msql_id", - "data": { - "relpersistence": true - }, - "expected_sql_file": "alter_seq_set_unlogged.sql", - "expected_msql_file": "alter_seq_set_unlogged_msql.sql" - }, { - "type": "delete", - "name": "Drop unlogged sequence", - "endpoint": "NODE-sequence.delete_id", - "data": { - "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_seq_change_grantee_privs.sql", + "expected_msql_file": "alter_seq_change_grantee_privs_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence remove privileges", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] } + }, + "expected_sql_file": "alter_seq_privs_remove.sql", + "expected_msql_file": "alter_seq_privs_remove_msql.sql" + }, + { + "type": "delete", + "name": "Drop sequence", + "endpoint": "NODE-sequence.delete_id", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Sequence with Negative value", + "endpoint": "NODE-sequence.obj", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", + "seqowner": "", + "schema": "public", + "increment": "-5", + "start": "-30", + "maximum": "-10", + "minimum": "-40", + "cache": "1", + "cycled": false, + "relacl": [], + "securities": [] + }, + "expected_sql_file": "create_negative_sequence.sql", + "expected_msql_file": "create_negative_sequence_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence properties with negative value", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "increment": "-7", + "minimum": "-35", + "maximum": "-15" + }, + "expected_sql_file": "alter_neg_seq_props.sql", + "expected_msql_file": "alter_neg_seq_props_msql.sql" + }, + { + "type": "delete", + "name": "Drop negative sequence", + "endpoint": "NODE-sequence.delete_id", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Sequence with Owned By", + "endpoint": "NODE-sequence.obj", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", + "seqowner": "", + "schema": "public", + "increment": "5", + "start": "5", + "maximum": "999", + "minimum": "5", + "cache": "1", + "cycled": false, + "owned_table": "tableforownedby", + "owned_column": "col1", + "relacl": [], + "securities": [] + }, + "expected_sql_file": "create_sequence_ownedby.sql", + "expected_msql_file": "create_sequence_ownedby_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence owned by column", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "owned_column": "col2" + }, + "expected_sql_file": "alter_ownedby_column.sql", + "expected_msql_file": "alter_ownedby_column_msql.sql" + }, + { + "type": "alter", + "name": "Alter Sequence remove owned by", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "owned_table": "", + "owned_column": "" + }, + "expected_sql_file": "alter_ownedby_remove.sql", + "expected_msql_file": "alter_ownedby_remove_msql.sql" + }, + { + "type": "delete", + "name": "Drop owned by sequence", + "endpoint": "NODE-sequence.delete_id", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create unlogged sequence", + "endpoint": "NODE-sequence.obj", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", + "seqowner": "", + "schema": "public", + "increment": "5", + "start": "5", + "maximum": "999", + "minimum": "5", + "cache": "1", + "cycled": false, + "relpersistence": true, + "relacl": [], + "securities": [] + }, + "expected_sql_file": "create_unlogged_sequence.sql", + "expected_msql_file": "create_unlogged_sequence_msql.sql" + }, + { + "type": "alter", + "name": "Alter sequence set logged", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relpersistence": false + }, + "expected_sql_file": "alter_seq_set_logged.sql", + "expected_msql_file": "alter_seq_set_logged_msql.sql" + }, + { + "type": "alter", + "name": "Alter sequence set unlogged", + "endpoint": "NODE-sequence.obj_id", + "sql_endpoint": "NODE-sequence.sql_id", + "msql_endpoint": "NODE-sequence.msql_id", + "data": { + "relpersistence": true + }, + "expected_sql_file": "alter_seq_set_unlogged.sql", + "expected_msql_file": "alter_seq_set_unlogged_msql.sql" + }, + { + "type": "delete", + "name": "Drop unlogged sequence", + "endpoint": "NODE-sequence.delete_id", + "data": { + "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" } - ] - } + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql index 6a7e36e876e..ef67bf98bb4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql @@ -10,4 +10,4 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_column.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_column.sql index 886aab87a6d..a10cc230589 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_column.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_column.sql @@ -13,4 +13,4 @@ ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" OWNED BY public.tableforownedby.col2; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_remove.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_remove.sql index 5f9d93a42d3..995cb075327 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_remove.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_ownedby_remove.sql @@ -10,4 +10,4 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql index 755e284a14e..4ec0367cf2c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql @@ -11,7 +11,7 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 2; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs_msql.sql index c8347516d44..ce44e77603a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs_msql.sql @@ -1,2 +1,2 @@ -REVOKE ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" FROM postgres; +REVOKE ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" FROM ; GRANT SELECT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql index 7cc89a242e5..6458c187171 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql @@ -10,7 +10,7 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql index 497df663140..0067a6f50ff 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql @@ -11,11 +11,11 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 2; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" IS 'Some comment'; GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql index b4400dd04e0..badbc4f7a58 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql @@ -11,7 +11,7 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 2; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql index 31ad61afb9c..9a3ab5805da 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql @@ -11,11 +11,11 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 2; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" IS 'Some comment'; GRANT SELECT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql index b4400dd04e0..badbc4f7a58 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql @@ -11,7 +11,7 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 2; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" IS 'Some comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql index f609f1331d8..dc7626e1170 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql @@ -10,4 +10,4 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql index f62613c8f30..771aef62ca5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql @@ -6,4 +6,4 @@ CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql index 5f9d93a42d3..995cb075327 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql @@ -10,4 +10,4 @@ CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql index 67e09cd6875..7c2afef7438 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql @@ -6,4 +6,4 @@ CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" CACHE 1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby.sql index 24e23cd0d52..a270d995896 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby.sql @@ -13,4 +13,4 @@ ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" OWNED BY public.tableforownedby.col1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby_msql.sql index 54b4cbc6d8e..c7cf3da7c4f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_ownedby_msql.sql @@ -9,4 +9,4 @@ ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" OWNED BY public.tableforownedby.col1; ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/test_sequences_pg.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/test_sequences_pg.json index be62cffec3b..c99a74bd2e5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/test_sequences_pg.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/test_sequences_pg.json @@ -36,7 +36,7 @@ "msql_endpoint": "NODE-sequence.msql", "data": { "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", + "seqowner": "", "schema": "public", "increment": "5", "start": "5", @@ -49,7 +49,8 @@ }, "expected_sql_file": "create_sequence.sql", "expected_msql_file": "create_sequence_msql.sql" - },{ + }, + { "type": "alter", "name": "Alter Sequence comment", "endpoint": "NODE-sequence.obj_id", @@ -60,7 +61,8 @@ }, "expected_sql_file": "alter_seq_comment.sql", "expected_msql_file": "alter_seq_comment_msql.sql" - },{ + }, + { "type": "alter", "name": "Alter Sequence properties", "endpoint": "NODE-sequence.obj_id", @@ -76,38 +78,44 @@ }, "expected_sql_file": "alter_seq_props.sql", "expected_msql_file": "alter_seq_props_msql.sql" - },{ + }, + { "type": "alter", "name": "Alter Sequence add privileges", "endpoint": "NODE-sequence.obj_id", "sql_endpoint": "NODE-sequence.sql_id", - "sql_endpoint": "NODE-sequence.sql_id", - "sql_endpoint": "NODE-sequence.sql_id", "msql_endpoint": "NODE-sequence.msql_id", "data": { "relacl": { - "added":[{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_seq_privs_add.sql", "expected_msql_file": "alter_seq_privs_add_msql.sql" - },{ + }, + { "type": "alter", "name": "Alter Sequence update privileges", "endpoint": "NODE-sequence.obj_id", @@ -115,15 +123,19 @@ "msql_endpoint": "NODE-sequence.msql_id", "data": { "relacl": { - "changed":[{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_seq_privs_update.sql", @@ -137,16 +149,20 @@ "msql_endpoint": "NODE-sequence.msql_id", "data": { "relacl": { - "changed":[{ - "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_seq_change_grantee_privs.sql", @@ -160,35 +176,43 @@ "msql_endpoint": "NODE-sequence.msql_id", "data": { "relacl": { - "deleted":[{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges":[{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - },{ - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_seq_privs_remove.sql", "expected_msql_file": "alter_seq_privs_remove_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop sequence", "endpoint": "NODE-sequence.delete_id", "data": { "name": "Seq1_$%{}[]()&*^!@\"'`\\/#" } - }, { + }, + { "type": "create", "name": "Create Sequence with Negative value", "endpoint": "NODE-sequence.obj", @@ -196,7 +220,7 @@ "msql_endpoint": "NODE-sequence.msql", "data": { "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", + "seqowner": "", "schema": "public", "increment": "-5", "start": "-30", @@ -209,18 +233,22 @@ }, "expected_sql_file": "create_negative_sequence.sql", "expected_msql_file": "create_negative_sequence_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter Sequence properties with negative value", "endpoint": "NODE-sequence.obj_id", "sql_endpoint": "NODE-sequence.sql_id", "msql_endpoint": "NODE-sequence.msql_id", "data": { - "increment": "-7", "minimum": "-35", "maximum": "-15" + "increment": "-7", + "minimum": "-35", + "maximum": "-15" }, "expected_sql_file": "alter_neg_seq_props.sql", "expected_msql_file": "alter_neg_seq_props_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop negative sequence", "endpoint": "NODE-sequence.delete_id", @@ -236,7 +264,7 @@ "msql_endpoint": "NODE-sequence.msql", "data": { "name": "Seq1_$%{}[]()&*^!@\"'`\\/#", - "seqowner": "postgres", + "seqowner": "", "schema": "public", "increment": "5", "start": "5", @@ -251,7 +279,8 @@ }, "expected_sql_file": "create_sequence_ownedby.sql", "expected_msql_file": "create_sequence_ownedby_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter Sequence owned by column", "endpoint": "NODE-sequence.obj_id", @@ -262,7 +291,8 @@ }, "expected_sql_file": "alter_ownedby_column.sql", "expected_msql_file": "alter_ownedby_column_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter Sequence remove owned by", "endpoint": "NODE-sequence.obj_id", @@ -274,7 +304,8 @@ }, "expected_sql_file": "alter_ownedby_remove.sql", "expected_msql_file": "alter_ownedby_remove_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop owned by sequence", "endpoint": "NODE-sequence.delete_id", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.msql index a7295398997..2d3cc204849 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.msql @@ -1,2 +1,2 @@ -REVOKE ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" FROM postgres; -GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO postgres; +REVOKE ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" FROM ; +GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql index 9db4aa9f566..71f37be005c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql @@ -10,4 +10,4 @@ COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()& GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/test.json index 1a63a6f0c05..50db016084e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/test.json @@ -50,7 +50,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -92,8 +92,8 @@ "attacl": { "changed": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -162,7 +162,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -239,7 +239,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -324,7 +324,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -403,7 +403,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -534,7 +534,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -747,7 +747,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/14_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/14_plus/test.json index 546b41620ce..b974161b977 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/14_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/14_plus/test.json @@ -50,7 +50,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -92,8 +92,8 @@ "attacl": { "changed": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -162,7 +162,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -239,7 +239,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -324,7 +324,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -403,7 +403,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -534,7 +534,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -747,7 +747,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/16_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/16_plus/test.json index f397ec12d0b..d5d8cf5e01d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/16_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/16_plus/test.json @@ -1,972 +1,971 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Table for testing column node (v.12+)", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "table_3_$%{}[]()&*^!@\"'`\\/#", - "is_partitioned": false, - "columns": [], - "schema": "testschema" - }, - "store_object_id": true - }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_1_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "defval": "1" - }, - "expected_sql_file": "create_column_int.sql", - "expected_msql_file": "create_column_int.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 1, - "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "cltype": "real", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "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": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_int.sql", - "expected_msql_file": "alter_column_int.msql" - }, - { - "type": "alter", - "name": "Alter Column (Privilege change)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 1, - "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", - "attacl": { - "changed": [ - { - "grantee": "postgres", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_alt_privilege.sql", - "expected_msql_file": "alter_column_alt_privilege.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column (Character type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_2_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "character varying", - "collspcname": "pg_catalog.\"C\"", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "50", - "attprecision": "", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_char.sql", - "expected_msql_file": "create_column_char.msql" - }, - { - "type": "alter", - "name": "Alter Column (Character type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 2, - "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#", - "attlen": "", - "attstattarget": "5", - "attstorage": "p", - "description": "Comment for alter", - "cltype": "character", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_char.sql", - "expected_msql_file": "alter_column_char.msql" - }, - { - "type": "delete", - "name": "Drop Column (Character type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type) with identity", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_3_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "attidentity": "a", - "seqincrement": "1", - "seqstart": "1", - "seqmin": "1", - "seqmax": "99999", - "seqcache": "10", - "seqcycle": true, - "colconstype": "i" - }, - "expected_sql_file": "create_column_int_identity.sql", - "expected_msql_file": "create_column_int_identity.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) with identity", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 3, - "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_identity.sql", - "expected_msql_file": "alter_column_identity.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) drop identity", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 3, - "colconstype": "n" - }, - "expected_sql_file": "alter_column_drop_identity.sql", - "expected_msql_file": "alter_column_drop_identity.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#" + "scenarios": [ + { + "type": "create", + "name": "Create Table for testing column node (v.12+)", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "table_3_$%{}[]()&*^!@\"'`\\/#", + "is_partitioned": false, + "columns": [], + "schema": "testschema" + }, + "store_object_id": true + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_1_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "defval": "1" + }, + "expected_sql_file": "create_column_int.sql", + "expected_msql_file": "create_column_int.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 1, + "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "cltype": "real", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type) with Generated feature", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_4_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "g", - "genexpr": "1 + 2 + 3", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_int_generated.sql", - "expected_msql_file": "create_column_int_generated.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) with Generated feature", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 4, - "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_generated.sql", - "expected_msql_file": "alter_column_generated.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_column_int.sql", + "expected_msql_file": "alter_column_int.msql" + }, + { + "type": "alter", + "name": "Alter Column (Privilege change)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 1, + "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", + "attacl": { + "changed": [ + { + "grantee": "", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column (Numeric type with Length Precision & Variables)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_5_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "min_val": 0, - "max_val": 1000, - "cltype": "numeric", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "10", - "attprecision": "5", - "attidentity": "a", - "attoptions": [ + "expected_sql_file": "alter_column_alt_privilege.sql", + "expected_msql_file": "alter_column_alt_privilege.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Character type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_2_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "character varying", + "collspcname": "pg_catalog.\"C\"", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "50", + "attprecision": "", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_char.sql", + "expected_msql_file": "create_column_char.msql" + }, + { + "type": "alter", + "name": "Alter Column (Character type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 2, + "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#", + "attlen": "", + "attstattarget": "5", + "attstorage": "p", + "description": "Comment for alter", + "cltype": "character", + "attacl": { + "added": [ { - "name": "n_distinct", - "value": "1" + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] } - ], - "seclabels": [] - }, - "expected_sql_file": "create_column_numeric.sql", - "expected_msql_file": "create_column_numeric.msql" - }, - { - "type": "alter", - "name": "Alter Column (Numeric type with Length Precision & Variables)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#", - "attnum": 5, - "attlen": "15", - "attprecision": "6", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "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": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_numeric.sql", - "expected_msql_file": "alter_column_numeric.msql" - }, - { - "type": "alter", - "name": "Alter Column (Remove Length)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 3, - "attlen": "" - }, - "expected_sql_file": "alter_column_remove_length.sql", - "expected_msql_file": "alter_column_remove_length.msql" - }, - { - "type": "delete", - "name": "Drop Column (Numeric type with Length Precision & Variables)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Dummy Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "dummy1", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "defval": "1" + "expected_sql_file": "alter_column_char.sql", + "expected_msql_file": "alter_column_char.msql" + }, + { + "type": "delete", + "name": "Drop Column (Character type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type) with identity", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_3_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "attidentity": "a", + "seqincrement": "1", + "seqstart": "1", + "seqmin": "1", + "seqmax": "99999", + "seqcache": "10", + "seqcycle": true, + "colconstype": "i" + }, + "expected_sql_file": "create_column_int_identity.sql", + "expected_msql_file": "create_column_int_identity.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) with identity", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 3, + "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Dummy Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "dummy2", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "defval": "1" + "expected_sql_file": "alter_column_identity.sql", + "expected_msql_file": "alter_column_identity.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) drop identity", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 3, + "colconstype": "n" + }, + "expected_sql_file": "alter_column_drop_identity.sql", + "expected_msql_file": "alter_column_drop_identity.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type) with Generated feature", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_4_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "g", + "genexpr": "1 + 2 + 3", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_int_generated.sql", + "expected_msql_file": "create_column_int_generated.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) with Generated feature", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 4, + "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type) with Generated feature with columns", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_8_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "g", - "genexpr": "dummy1 + dummy2", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_int_generated_with_existing_columns.sql", - "expected_msql_file": "create_column_int_generated_with_existing_columns.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) with Generated feature with columns", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 8, - "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#", - "genexpr": "dummy1 - dummy2", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] + "expected_sql_file": "alter_column_generated.sql", + "expected_msql_file": "alter_column_generated.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Numeric type with Length Precision & Variables)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_5_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "min_val": 0, + "max_val": 1000, + "cltype": "numeric", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "10", + "attprecision": "5", + "attidentity": "a", + "attoptions": [ + { + "name": "n_distinct", + "value": "1" } - }, - "expected_sql_file": "alter_column_generated_with_existing_columns.sql", - "expected_msql_file": "alter_column_generated_with_existing_columns.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type) with Generated feature with columns", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#" + ], + "seclabels": [] + }, + "expected_sql_file": "create_column_numeric.sql", + "expected_msql_file": "create_column_numeric.msql" + }, + { + "type": "alter", + "name": "Alter Column (Numeric type with Length Precision & Variables)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#", + "attnum": 5, + "attlen": "15", + "attprecision": "6", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column with identity (Generated by default)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_9_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "attidentity": "d", - "seqincrement": "1", - "seqstart": "1", - "seqmin": "1", - "seqmax": "99999", - "seqcache": "10", - "seqcycle": true, - "colconstype": "i" - }, - "expected_sql_file": "create_column_int_identity_by_default.sql", - "expected_msql_file": "create_column_int_identity_by_default.msql" - }, - { - "type": "alter", - "name": "Alter Column with identity (Generated by default)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 9, - "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "seqincrement": "2", - "seqmax": "200", - "seqcache": "2", - "seqcycle": true, - "seqmin": "1" - }, - "expected_sql_file": "alter_column_identity_by_default.sql", - "expected_msql_file": "alter_column_identity_by_default.msql" - }, - { - "type": "alter", - "name": "Alter Column with drop identity (Generated by default)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 9, - "colconstype": "n" - }, - "expected_sql_file": "alter_column_drop_identity_by_default.sql", - "expected_msql_file": "alter_column_drop_identity_by_default.msql" - }, - { - "type": "delete", - "name": "Drop Column Column with identity (Generated by default)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_column_numeric.sql", + "expected_msql_file": "alter_column_numeric.msql" + }, + { + "type": "alter", + "name": "Alter Column (Remove Length)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 3, + "attlen": "" + }, + "expected_sql_file": "alter_column_remove_length.sql", + "expected_msql_file": "alter_column_remove_length.msql" + }, + { + "type": "delete", + "name": "Drop Column (Numeric type with Length Precision & Variables)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Dummy Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "dummy1", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "defval": "1" + } + }, + { + "type": "create", + "name": "Create Dummy Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "dummy2", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "defval": "1" + } + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type) with Generated feature with columns", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_8_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "g", + "genexpr": "dummy1 + dummy2", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_int_generated_with_existing_columns.sql", + "expected_msql_file": "create_column_int_generated_with_existing_columns.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) with Generated feature with columns", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 8, + "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#", + "genexpr": "dummy1 - dummy2", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column with identity (BY DEFAULT) for combination of identity options & initiate START", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_6_$%{}[]()&*^!@\"'`\\/#", - "cltype": "bigint", - "attacl": [], - "description": "demo comments", - "is_primary_key": false, - "attnotnull": true, - "attlen": null, - "attprecision": null, - "attidentity": "d", - "seqincrement": "1", - "seqstart": "1", - "seqmin": "1", - "seqmax": "10", - "seqcache": "1", - "seqcycle": true, - "colconstype": "i", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_identity_for_restart_seq.sql", - "expected_msql_file": "create_column_identity_for_restart_seq.msql" - }, - { - "type": "alter", - "name": "Alter identity Column (BY DEFAULT) to ALWAYS & Update START", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnotnull": true, - "attidentity": "a", - "seqstart": 2, - "seqcycle": false - }, - "expected_sql_file": "alter_column_identity_for_restart_seq.sql", - "expected_msql_file": "alter_column_identity_for_restart_seq.msql" - }, - { - "type": "alter", - "name": "Alter identity Column (ALWAYS) for combination of identity options & Update START", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 9, - "attidentity": "a", - "seqincrement": "3", - "seqstart": "3", - "seqmin": "3", - "seqmax": "30", - "seqcache": "3", - "seqcycle": true - }, - "expected_sql_file": "alter_column_identity_for_comb_start_seq.sql", - "expected_msql_file": "alter_column_identity_for_comb_start_seq.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col_6_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_column_generated_with_existing_columns.sql", + "expected_msql_file": "alter_column_generated_with_existing_columns.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type) with Generated feature with columns", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with identity (Generated by default)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_9_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "attidentity": "d", + "seqincrement": "1", + "seqstart": "1", + "seqmin": "1", + "seqmax": "99999", + "seqcache": "10", + "seqcycle": true, + "colconstype": "i" + }, + "expected_sql_file": "create_column_int_identity_by_default.sql", + "expected_msql_file": "create_column_int_identity_by_default.msql" + }, + { + "type": "alter", + "name": "Alter Column with identity (Generated by default)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 9, + "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "seqincrement": "2", + "seqmax": "200", + "seqcache": "2", + "seqcycle": true, + "seqmin": "1" + }, + "expected_sql_file": "alter_column_identity_by_default.sql", + "expected_msql_file": "alter_column_identity_by_default.msql" + }, + { + "type": "alter", + "name": "Alter Column with drop identity (Generated by default)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 9, + "colconstype": "n" + }, + "expected_sql_file": "alter_column_drop_identity_by_default.sql", + "expected_msql_file": "alter_column_drop_identity_by_default.msql" + }, + { + "type": "delete", + "name": "Drop Column Column with identity (Generated by default)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with identity (BY DEFAULT) for combination of identity options & initiate START", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_6_$%{}[]()&*^!@\"'`\\/#", + "cltype": "bigint", + "attacl": [], + "description": "demo comments", + "is_primary_key": false, + "attnotnull": true, + "attlen": null, + "attprecision": null, + "attidentity": "d", + "seqincrement": "1", + "seqstart": "1", + "seqmin": "1", + "seqmax": "10", + "seqcache": "1", + "seqcycle": true, + "colconstype": "i", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_identity_for_restart_seq.sql", + "expected_msql_file": "create_column_identity_for_restart_seq.msql" + }, + { + "type": "alter", + "name": "Alter identity Column (BY DEFAULT) to ALWAYS & Update START", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnotnull": true, + "attidentity": "a", + "seqstart": 2, + "seqcycle": false + }, + "expected_sql_file": "alter_column_identity_for_restart_seq.sql", + "expected_msql_file": "alter_column_identity_for_restart_seq.msql" + }, + { + "type": "alter", + "name": "Alter identity Column (ALWAYS) for combination of identity options & Update START", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 9, + "attidentity": "a", + "seqincrement": "3", + "seqstart": "3", + "seqmin": "3", + "seqmax": "30", + "seqcache": "3", + "seqcycle": true + }, + "expected_sql_file": "alter_column_identity_for_comb_start_seq.sql", + "expected_msql_file": "alter_column_identity_for_comb_start_seq.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col_6_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with text & default value", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col__1_$%{}[]()&*^!@\"'`\\/#", + "cltype": "text", + "attacl": [], + "description": "test comment", + "is_primary_key": false, + "attnotnull": false, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [], + "defval": "'xyz'" + }, + "expected_sql_file": "create_column_text_with_default_value.sql", + "expected_msql_file": "create_column_text_with_default_value.msql" + }, + { + "type": "alter", + "name": "Alter Column with text & update default value", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col__1_$%{}[]()&*^!@\"'`\\/#", + "defval": "'changed default value'", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column with text & default value", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col__1_$%{}[]()&*^!@\"'`\\/#", - "cltype": "text", - "attacl": [], - "description": "test comment", - "is_primary_key": false, - "attnotnull": false, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [], - "defval": "'xyz'" - }, - "expected_sql_file": "create_column_text_with_default_value.sql", - "expected_msql_file": "create_column_text_with_default_value.msql" - }, - { - "type": "alter", - "name": "Alter Column with text & update default value", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col__1_$%{}[]()&*^!@\"'`\\/#", - "defval": "'changed default value'", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] - } - ] + "expected_sql_file": "alter_column_text_with_default_value.sql", + "expected_msql_file": "alter_column_text_with_default_value.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col__1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with time with time zone & default value using function", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col__2_$%{}[]()&*^!@\"'`\\/#", + "cltype": "time with time zone", + "attacl": [], + "description": "test comment", + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": "4", + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [], + "defval": "now()" + }, + "expected_sql_file": "create_column_timestamp_with_default_value_using_function.sql", + "expected_msql_file": "create_column_timestamp_with_default_value_using_function.msql" + }, + { + "type": "alter", + "name": "Alter Column with time with time zone & update length", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col__2_$%{}[]()&*^!@\"'`\\/#", + "attlen": "6", + "attnotnull": true, + "description": "test comment modification" + }, + "expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql", + "expected_msql_file": "alter_column_timestamp_with_default_value_using_function.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col__2_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with interger_array and options", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col__3_$%{}[]()&*^!@\"'`\\/#", + "cltype": "integer[]", + "attacl": [], + "description": "comment", + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "n", + "attoptions": [ + { + "name": "n_distinct", + "value": "1" } - }, - "expected_sql_file": "alter_column_text_with_default_value.sql", - "expected_msql_file": "alter_column_text_with_default_value.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col__1_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column with time with time zone & default value using function", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col__2_$%{}[]()&*^!@\"'`\\/#", - "cltype": "time with time zone", - "attacl": [], - "description": "test comment", - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": "4", - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [], - "defval": "now()" - }, - "expected_sql_file": "create_column_timestamp_with_default_value_using_function.sql", - "expected_msql_file": "create_column_timestamp_with_default_value_using_function.msql" - }, - { - "type": "alter", - "name": "Alter Column with time with time zone & update length", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col__2_$%{}[]()&*^!@\"'`\\/#", - "attlen": "6", - "attnotnull": true, - "description": "test comment modification" - }, - "expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql", - "expected_msql_file": "alter_column_timestamp_with_default_value_using_function.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col__2_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column with interger_array and options", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col__3_$%{}[]()&*^!@\"'`\\/#", - "cltype": "integer[]", - "attacl": [], - "description": "comment", - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "n", - "attoptions": [ + ], + "seclabels": [] + }, + "expected_sql_file": "create_column_with_interger_array_and_options.sql", + "expected_msql_file": "create_column_with_interger_array_and_options.msql" + }, + { + "type": "alter", + "name": "Alter Column with interger_array and options", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col__3_$%{}[]()&*^!@\"'`\\/#", + "attoptions": { + "changed": [ { "name": "n_distinct", - "value": "1" + "value": "2" } - ], - "seclabels": [] - }, - "expected_sql_file": "create_column_with_interger_array_and_options.sql", - "expected_msql_file": "create_column_with_interger_array_and_options.msql" - }, - { - "type": "alter", - "name": "Alter Column with interger_array and options", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col__3_$%{}[]()&*^!@\"'`\\/#", - "attoptions": { - "changed": [ - { - "name": "n_distinct", - "value": "2" - } - ] - } - }, - "expected_sql_file": "alter_column_with_interger_array_and_options.sql", - "expected_msql_file": "alter_column_with_interger_array_and_options.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col__3_$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Column with compression", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", - "cltype": "character varying", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attcompression": "pglz", - "attoptions": [], - "seclabels": [], - "defval": "1" - }, - "expected_sql_file": "create_column_comp.sql", - "expected_msql_file": "create_column_comp.msql" - }, - { - "type": "alter", - "name": "Alter Column compression type", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", - "attcompression": "lz4" - }, - "expected_sql_file": "alter_column_compression.sql", - "expected_msql_file": "alter_column_compression.msql" - }, - { - "type": "delete", - "name": "Drop Column with compression", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col_comp_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column with storage", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "character varying", - "collspcname": "pg_catalog.\"C\"", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "50", - "attstorage": "m", - "attprecision": "", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_with_storage.sql", - "expected_msql_file": "create_column_with_storage.msql" - }, - { - "type": "alter", - "name": "Alter Column storage type", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", - "attstorage": "p" - }, - "expected_sql_file": "alter_column_storage.sql", - "expected_msql_file": "alter_column_storage.msql" - }, - { - "type": "delete", - "name": "Drop Column with storage", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col_1111_$%{}[]()&*^!@\"'`\\/#" - } + "expected_sql_file": "alter_column_with_interger_array_and_options.sql", + "expected_msql_file": "alter_column_with_interger_array_and_options.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col__3_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with compression", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", + "cltype": "character varying", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attcompression": "pglz", + "attoptions": [], + "seclabels": [], + "defval": "1" + }, + "expected_sql_file": "create_column_comp.sql", + "expected_msql_file": "create_column_comp.msql" + }, + { + "type": "alter", + "name": "Alter Column compression type", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", + "attcompression": "lz4" + }, + "expected_sql_file": "alter_column_compression.sql", + "expected_msql_file": "alter_column_compression.msql" + }, + { + "type": "delete", + "name": "Drop Column with compression", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col_comp_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with storage", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "character varying", + "collspcname": "pg_catalog.\"C\"", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "50", + "attstorage": "m", + "attprecision": "", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_with_storage.sql", + "expected_msql_file": "create_column_with_storage.msql" + }, + { + "type": "alter", + "name": "Alter Column storage type", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", + "attstorage": "p" + }, + "expected_sql_file": "alter_column_storage.sql", + "expected_msql_file": "alter_column_storage.msql" + }, + { + "type": "delete", + "name": "Drop Column with storage", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col_1111_$%{}[]()&*^!@\"'`\\/#" } - ] - } - \ No newline at end of file + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.msql index 63674778fdb..766d8f688d6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.msql @@ -1,2 +1,2 @@ -REVOKE ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" FROM postgres; -GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO postgres; +REVOKE ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" FROM ; +GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql index 2efcafa64ea..cb6029d5598 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql @@ -10,4 +10,4 @@ COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()& GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT INSERT("new_col_1_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/test.json index 37db613cb71..a3f6d6b82ad 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/test.json @@ -50,7 +50,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -93,8 +93,8 @@ "attacl": { "changed": [ { - "grantee": "postgres", - "grantor": "postgres", + "grantee": "", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -163,7 +163,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -240,7 +240,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -332,7 +332,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -563,7 +563,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/14_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/14_plus/test.json index 4807aebfa9c..33fb94612c3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/14_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/14_plus/test.json @@ -747,7 +747,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/16_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/16_plus/test.json index 8e1b4080271..ce4907e6129 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/16_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/16_plus/test.json @@ -1,972 +1,971 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Table for testing column node (v.12+)", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "table_3_$%{}[]()&*^!@\"'`\\/#", - "is_partitioned": false, - "columns": [], - "schema": "testschema" - }, - "store_object_id": true - }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_1_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "defval": "1" - }, - "expected_sql_file": "create_column_int.sql", - "expected_msql_file": "create_column_int.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 1, - "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "cltype": "real", - "attacl": { - "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": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_int.sql", - "expected_msql_file": "alter_column_int.msql" - }, - { - "type": "alter", - "name": "Alter Column (Privilege change)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 1, - "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", - "attacl": { - "changed": [ - { - "grantee": "enterprisedb", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_alt_privilege.sql", - "expected_msql_file": "alter_column_alt_privilege.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column (Character type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_2_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "character varying", - "collspcname": "pg_catalog.\"C\"", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "50", - "attprecision": "", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_char.sql", - "expected_msql_file": "create_column_char.msql" - }, - { - "type": "alter", - "name": "Alter Column (Character type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 2, - "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#", - "attlen": null, - "attstattarget": "5", - "attstorage": "p", - "description": "Comment for alter", - "cltype": "character", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_char.sql", - "expected_msql_file": "alter_column_char.msql" - }, - { - "type": "delete", - "name": "Drop Column (Character type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type) with identity", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_3_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "attidentity": "a", - "seqincrement": "1", - "seqstart": "1", - "seqmin": "1", - "seqmax": "99999", - "seqcache": "10", - "seqcycle": true, - "colconstype": "i" - }, - "expected_sql_file": "create_column_int_identity.sql", - "expected_msql_file": "create_column_int_identity.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) with identity", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 3, - "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_identity.sql", - "expected_msql_file": "alter_column_identity.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) drop identity", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 3, - "colconstype": "n" - }, - "expected_sql_file": "alter_column_drop_identity.sql", - "expected_msql_file": "alter_column_drop_identity.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#" + "scenarios": [ + { + "type": "create", + "name": "Create Table for testing column node (v.12+)", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "table_3_$%{}[]()&*^!@\"'`\\/#", + "is_partitioned": false, + "columns": [], + "schema": "testschema" + }, + "store_object_id": true + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_1_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "defval": "1" + }, + "expected_sql_file": "create_column_int.sql", + "expected_msql_file": "create_column_int.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 1, + "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "cltype": "real", + "attacl": { + "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": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type) with Generated feature", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_4_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "g", - "genexpr": "1 + 2 + 3", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_int_generated.sql", - "expected_msql_file": "create_column_int_generated.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) with Generated feature", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 4, - "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_generated.sql", - "expected_msql_file": "alter_column_generated.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_column_int.sql", + "expected_msql_file": "alter_column_int.msql" + }, + { + "type": "alter", + "name": "Alter Column (Privilege change)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 1, + "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#", + "attacl": { + "changed": [ + { + "grantee": "enterprisedb", + "grantor": "enterprisedb", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column (Numeric type with Length Precision & Variables)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_5_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "min_val": 0, - "max_val": 1000, - "cltype": "numeric", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "10", - "attprecision": "5", - "attidentity": "a", - "attoptions": [ + "expected_sql_file": "alter_column_alt_privilege.sql", + "expected_msql_file": "alter_column_alt_privilege.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Character type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_2_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "character varying", + "collspcname": "pg_catalog.\"C\"", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "50", + "attprecision": "", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_char.sql", + "expected_msql_file": "create_column_char.msql" + }, + { + "type": "alter", + "name": "Alter Column (Character type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 2, + "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#", + "attlen": null, + "attstattarget": "5", + "attstorage": "p", + "description": "Comment for alter", + "cltype": "character", + "attacl": { + "added": [ { - "name": "n_distinct", - "value": "1" + "grantee": "PUBLIC", + "grantor": "enterprisedb", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] } - ], - "seclabels": [] - }, - "expected_sql_file": "create_column_numeric.sql", - "expected_msql_file": "create_column_numeric.msql" - }, - { - "type": "alter", - "name": "Alter Column (Numeric type with Length Precision & Variables)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#", - "attnum": 5, - "attlen": "15", - "attprecision": "6", - "description": "Comment for alter", - "attacl": { - "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": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "expected_sql_file": "alter_column_numeric.sql", - "expected_msql_file": "alter_column_numeric.msql" - }, - { - "type": "alter", - "name": "Alter Column (Remove Length)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 3, - "attlen": "" - }, - "expected_sql_file": "alter_column_remove_length.sql", - "expected_msql_file": "alter_column_remove_length.msql" - }, - { - "type": "delete", - "name": "Drop Column (Numeric type with Length Precision & Variables)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Dummy Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "dummy1", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "defval": "1" + "expected_sql_file": "alter_column_char.sql", + "expected_msql_file": "alter_column_char.msql" + }, + { + "type": "delete", + "name": "Drop Column (Character type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_2_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type) with identity", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_3_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "attidentity": "a", + "seqincrement": "1", + "seqstart": "1", + "seqmin": "1", + "seqmax": "99999", + "seqcache": "10", + "seqcycle": true, + "colconstype": "i" + }, + "expected_sql_file": "create_column_int_identity.sql", + "expected_msql_file": "create_column_int_identity.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) with identity", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 3, + "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "enterprisedb", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Dummy Column (Integer/Numeric type)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "dummy2", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "defval": "1" + "expected_sql_file": "alter_column_identity.sql", + "expected_msql_file": "alter_column_identity.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) drop identity", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 3, + "colconstype": "n" + }, + "expected_sql_file": "alter_column_drop_identity.sql", + "expected_msql_file": "alter_column_drop_identity.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_3_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type) with Generated feature", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_4_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "g", + "genexpr": "1 + 2 + 3", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_int_generated.sql", + "expected_msql_file": "create_column_int_generated.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) with Generated feature", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 4, + "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "enterprisedb", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column (Integer/Numeric type) with Generated feature with columns", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_8_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "g", - "genexpr": "dummy1 + dummy2", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_int_generated_with_existing_columns.sql", - "expected_msql_file": "create_column_int_generated_with_existing_columns.msql" - }, - { - "type": "alter", - "name": "Alter Column (Integer/Numeric type) with Generated feature with columns", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 8, - "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#", - "genexpr": "dummy1 - dummy2", - "description": "Comment for alter", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "enterprisedb", - "privileges": [ - { - "privilege_type": "a", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, - { - "privilege_type": "x", - "privilege": true, - "with_grant": false - } - ] - } - ] + "expected_sql_file": "alter_column_generated.sql", + "expected_msql_file": "alter_column_generated.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_4_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column (Numeric type with Length Precision & Variables)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_5_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "min_val": 0, + "max_val": 1000, + "cltype": "numeric", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "10", + "attprecision": "5", + "attidentity": "a", + "attoptions": [ + { + "name": "n_distinct", + "value": "1" } - }, - "expected_sql_file": "alter_column_generated_with_existing_columns.sql", - "expected_msql_file": "alter_column_generated_with_existing_columns.msql" - }, - { - "type": "delete", - "name": "Drop Column (Integer/Numeric type) with Generated feature with columns", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#" + ], + "seclabels": [] + }, + "expected_sql_file": "create_column_numeric.sql", + "expected_msql_file": "create_column_numeric.msql" + }, + { + "type": "alter", + "name": "Alter Column (Numeric type with Length Precision & Variables)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#", + "attnum": 5, + "attlen": "15", + "attprecision": "6", + "description": "Comment for alter", + "attacl": { + "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": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column with identity (Generated by default)", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_9_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attoptions": [], - "seclabels": [], - "attidentity": "d", - "seqincrement": "1", - "seqstart": "1", - "seqmin": "1", - "seqmax": "99999", - "seqcache": "10", - "seqcycle": true, - "colconstype": "i" - }, - "expected_sql_file": "create_column_int_identity_by_default.sql", - "expected_msql_file": "create_column_int_identity_by_default.msql" - }, - { - "type": "alter", - "name": "Alter Column with identity (Generated by default)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 9, - "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for alter", - "seqincrement": "2", - "seqmax": "200", - "seqcache": "2", - "seqcycle": true, - "seqmin": "1" - }, - "expected_sql_file": "alter_column_identity_by_default.sql", - "expected_msql_file": "alter_column_identity_by_default.msql" - }, - { - "type": "alter", - "name": "Alter Column with drop identity (Generated by default)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 9, - "colconstype": "n" - }, - "expected_sql_file": "alter_column_drop_identity_by_default.sql", - "expected_msql_file": "alter_column_drop_identity_by_default.msql" - }, - { - "type": "delete", - "name": "Drop Column Column with identity (Generated by default)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_column_numeric.sql", + "expected_msql_file": "alter_column_numeric.msql" + }, + { + "type": "alter", + "name": "Alter Column (Remove Length)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 3, + "attlen": "" + }, + "expected_sql_file": "alter_column_remove_length.sql", + "expected_msql_file": "alter_column_remove_length.msql" + }, + { + "type": "delete", + "name": "Drop Column (Numeric type with Length Precision & Variables)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_5_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Dummy Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "dummy1", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "defval": "1" + } + }, + { + "type": "create", + "name": "Create Dummy Column (Integer/Numeric type)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "dummy2", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "defval": "1" + } + }, + { + "type": "create", + "name": "Create Column (Integer/Numeric type) with Generated feature with columns", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_8_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "g", + "genexpr": "dummy1 + dummy2", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_int_generated_with_existing_columns.sql", + "expected_msql_file": "create_column_int_generated_with_existing_columns.msql" + }, + { + "type": "alter", + "name": "Alter Column (Integer/Numeric type) with Generated feature with columns", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 8, + "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#", + "genexpr": "dummy1 - dummy2", + "description": "Comment for alter", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "enterprisedb", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "x", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column with identity (BY DEFAULT) for combination of identity options & initiate START", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_6_$%{}[]()&*^!@\"'`\\/#", - "cltype": "bigint", - "attacl": [], - "description": "demo comments", - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attidentity": "d", - "seqincrement": "1", - "seqstart": "1", - "seqmin": "1", - "seqmax": "10", - "seqcache": "1", - "seqcycle": true, - "colconstype": "i", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_identity_for_restart_seq.sql", - "expected_msql_file": "create_column_identity_for_restart_seq.msql" - }, - { - "type": "alter", - "name": "Alter identity Column (BY DEFAULT) to ALWAYS & Update START", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnotnull": true, - "attidentity": "a", - "seqstart": 2, - "seqcycle": false - }, - "expected_sql_file": "alter_column_identity_for_restart_seq.sql", - "expected_msql_file": "alter_column_identity_for_restart_seq.msql" - }, - { - "type": "alter", - "name": "Alter identity Column (ALWAYS) for combination of identity options & Update START", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "attnum": 9, - "attidentity": "a", - "seqincrement": "3", - "seqstart": "3", - "seqmin": "3", - "seqmax": "30", - "seqcache": "3", - "seqcycle": true - }, - "expected_sql_file": "alter_column_identity_for_comb_start_seq.sql", - "expected_msql_file": "alter_column_identity_for_comb_start_seq.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col_6_$%{}[]()&*^!@\"'`\\/#" + "expected_sql_file": "alter_column_generated_with_existing_columns.sql", + "expected_msql_file": "alter_column_generated_with_existing_columns.msql" + }, + { + "type": "delete", + "name": "Drop Column (Integer/Numeric type) with Generated feature with columns", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_8_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with identity (Generated by default)", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_9_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attoptions": [], + "seclabels": [], + "attidentity": "d", + "seqincrement": "1", + "seqstart": "1", + "seqmin": "1", + "seqmax": "99999", + "seqcache": "10", + "seqcycle": true, + "colconstype": "i" + }, + "expected_sql_file": "create_column_int_identity_by_default.sql", + "expected_msql_file": "create_column_int_identity_by_default.msql" + }, + { + "type": "alter", + "name": "Alter Column with identity (Generated by default)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 9, + "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for alter", + "seqincrement": "2", + "seqmax": "200", + "seqcache": "2", + "seqcycle": true, + "seqmin": "1" + }, + "expected_sql_file": "alter_column_identity_by_default.sql", + "expected_msql_file": "alter_column_identity_by_default.msql" + }, + { + "type": "alter", + "name": "Alter Column with drop identity (Generated by default)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 9, + "colconstype": "n" + }, + "expected_sql_file": "alter_column_drop_identity_by_default.sql", + "expected_msql_file": "alter_column_drop_identity_by_default.msql" + }, + { + "type": "delete", + "name": "Drop Column Column with identity (Generated by default)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "new_col_9_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with identity (BY DEFAULT) for combination of identity options & initiate START", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_6_$%{}[]()&*^!@\"'`\\/#", + "cltype": "bigint", + "attacl": [], + "description": "demo comments", + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attidentity": "d", + "seqincrement": "1", + "seqstart": "1", + "seqmin": "1", + "seqmax": "10", + "seqcache": "1", + "seqcycle": true, + "colconstype": "i", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_identity_for_restart_seq.sql", + "expected_msql_file": "create_column_identity_for_restart_seq.msql" + }, + { + "type": "alter", + "name": "Alter identity Column (BY DEFAULT) to ALWAYS & Update START", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnotnull": true, + "attidentity": "a", + "seqstart": 2, + "seqcycle": false + }, + "expected_sql_file": "alter_column_identity_for_restart_seq.sql", + "expected_msql_file": "alter_column_identity_for_restart_seq.msql" + }, + { + "type": "alter", + "name": "Alter identity Column (ALWAYS) for combination of identity options & Update START", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "attnum": 9, + "attidentity": "a", + "seqincrement": "3", + "seqstart": "3", + "seqmin": "3", + "seqmax": "30", + "seqcache": "3", + "seqcycle": true + }, + "expected_sql_file": "alter_column_identity_for_comb_start_seq.sql", + "expected_msql_file": "alter_column_identity_for_comb_start_seq.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col_6_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with text & default value", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col__1_$%{}[]()&*^!@\"'`\\/#", + "cltype": "text", + "attacl": [], + "description": "test comment", + "is_primary_key": false, + "attnotnull": false, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [], + "defval": "'xyz'" + }, + "expected_sql_file": "create_column_text_with_default_value.sql", + "expected_msql_file": "create_column_text_with_default_value.msql" + }, + { + "type": "alter", + "name": "Alter Column with text & update default value", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col__1_$%{}[]()&*^!@\"'`\\/#", + "defval": "'changed default value'", + "attacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, - { - "type": "create", - "name": "Create Column with text & default value", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col__1_$%{}[]()&*^!@\"'`\\/#", - "cltype": "text", - "attacl": [], - "description": "test comment", - "is_primary_key": false, - "attnotnull": false, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [], - "defval": "'xyz'" - }, - "expected_sql_file": "create_column_text_with_default_value.sql", - "expected_msql_file": "create_column_text_with_default_value.msql" - }, - { - "type": "alter", - "name": "Alter Column with text & update default value", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col__1_$%{}[]()&*^!@\"'`\\/#", - "defval": "'changed default value'", - "attacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] - } - ] + "expected_sql_file": "alter_column_text_with_default_value.sql", + "expected_msql_file": "alter_column_text_with_default_value.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col__1_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with time with time zone & default value using function", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col__2_$%{}[]()&*^!@\"'`\\/#", + "cltype": "time with time zone", + "attacl": [], + "description": "test comment", + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": "4", + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [], + "defval": "now()" + }, + "expected_sql_file": "create_column_timestamp_with_default_value_using_function.sql", + "expected_msql_file": "create_column_timestamp_with_default_value_using_function.msql" + }, + { + "type": "alter", + "name": "Alter Column with time with time zone & update length", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col__2_$%{}[]()&*^!@\"'`\\/#", + "attlen": "6", + "attnotnull": true, + "description": "test comment modification" + }, + "expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql", + "expected_msql_file": "alter_column_timestamp_with_default_value_using_function.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col__2_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with interger_array and options", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col__3_$%{}[]()&*^!@\"'`\\/#", + "cltype": "integer[]", + "attacl": [], + "description": "comment", + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attidentity": "a", + "colconstype": "n", + "attoptions": [ + { + "name": "n_distinct", + "value": "1" } - }, - "expected_sql_file": "alter_column_text_with_default_value.sql", - "expected_msql_file": "alter_column_text_with_default_value.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col__1_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column with time with time zone & default value using function", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col__2_$%{}[]()&*^!@\"'`\\/#", - "cltype": "time with time zone", - "attacl": [], - "description": "test comment", - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": "4", - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [], - "defval": "now()" - }, - "expected_sql_file": "create_column_timestamp_with_default_value_using_function.sql", - "expected_msql_file": "create_column_timestamp_with_default_value_using_function.msql" - }, - { - "type": "alter", - "name": "Alter Column with time with time zone & update length", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col__2_$%{}[]()&*^!@\"'`\\/#", - "attlen": "6", - "attnotnull": true, - "description": "test comment modification" - }, - "expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql", - "expected_msql_file": "alter_column_timestamp_with_default_value_using_function.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col__2_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column with interger_array and options", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col__3_$%{}[]()&*^!@\"'`\\/#", - "cltype": "integer[]", - "attacl": [], - "description": "comment", - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attidentity": "a", - "colconstype": "n", - "attoptions": [ + ], + "seclabels": [] + }, + "expected_sql_file": "create_column_with_interger_array_and_options.sql", + "expected_msql_file": "create_column_with_interger_array_and_options.msql" + }, + { + "type": "alter", + "name": "Alter Column with interger_array and options", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col__3_$%{}[]()&*^!@\"'`\\/#", + "attoptions": { + "changed": [ { "name": "n_distinct", - "value": "1" + "value": "2" } - ], - "seclabels": [] - }, - "expected_sql_file": "create_column_with_interger_array_and_options.sql", - "expected_msql_file": "create_column_with_interger_array_and_options.msql" - }, - { - "type": "alter", - "name": "Alter Column with interger_array and options", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col__3_$%{}[]()&*^!@\"'`\\/#", - "attoptions": { - "changed": [ - { - "name": "n_distinct", - "value": "2" - } - ] - } - }, - "expected_sql_file": "alter_column_with_interger_array_and_options.sql", - "expected_msql_file": "alter_column_with_interger_array_and_options.msql" - }, - { - "type": "delete", - "name": "Drop Column with identity (ALWAYS)", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col__3_$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Column with compression", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", - "cltype": "character varying", - "attacl": [], - "is_primary_key": false, - "attnotnull": true, - "attlen": "", - "attprecision": "", - "attcompression": "pglz", - "attoptions": [], - "seclabels": [], - "defval": "1" - }, - "expected_sql_file": "create_column_comp.sql", - "expected_msql_file": "create_column_comp.msql" - }, - { - "type": "alter", - "name": "Alter Column compression type", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", - "attcompression": "lz4" - }, - "expected_sql_file": "alter_column_compression.sql", - "expected_msql_file": "alter_column_compression.msql" - }, - { - "type": "delete", - "name": "Drop Column with compression", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col_comp_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Column with storage", - "endpoint": "NODE-column.obj", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql", - "data": { - "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", - "description": "Comment for create", - "cltype": "character varying", - "collspcname": "pg_catalog.\"C\"", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": "50", - "attstorage": "m", - "attprecision": "", - "attoptions": [], - "seclabels": [] - }, - "expected_sql_file": "create_column_with_storage.sql", - "expected_msql_file": "create_column_with_storage.msql" - }, - { - "type": "alter", - "name": "Alter Column storage type", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "msql_endpoint": "NODE-column.msql_id", - "data": { - "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", - "attstorage": "p" - }, - "expected_sql_file": "alter_column_storage.sql", - "expected_msql_file": "alter_column_storage.msql" - }, - { - "type": "delete", - "name": "Drop Column with storage", - "endpoint": "NODE-column.obj_id", - "sql_endpoint": "NODE-column.sql_id", - "data": { - "name": "col_1111_$%{}[]()&*^!@\"'`\\/#" - } + "expected_sql_file": "alter_column_with_interger_array_and_options.sql", + "expected_msql_file": "alter_column_with_interger_array_and_options.msql" + }, + { + "type": "delete", + "name": "Drop Column with identity (ALWAYS)", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col__3_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with compression", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", + "cltype": "character varying", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": "", + "attprecision": "", + "attcompression": "pglz", + "attoptions": [], + "seclabels": [], + "defval": "1" + }, + "expected_sql_file": "create_column_comp.sql", + "expected_msql_file": "create_column_comp.msql" + }, + { + "type": "alter", + "name": "Alter Column compression type", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col_comp_$%{}[]()&*^!@\"'`\\/#", + "attcompression": "lz4" + }, + "expected_sql_file": "alter_column_compression.sql", + "expected_msql_file": "alter_column_compression.msql" + }, + { + "type": "delete", + "name": "Drop Column with compression", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col_comp_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Column with storage", + "endpoint": "NODE-column.obj", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql", + "data": { + "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", + "description": "Comment for create", + "cltype": "character varying", + "collspcname": "pg_catalog.\"C\"", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": "50", + "attstorage": "m", + "attprecision": "", + "attoptions": [], + "seclabels": [] + }, + "expected_sql_file": "create_column_with_storage.sql", + "expected_msql_file": "create_column_with_storage.msql" + }, + { + "type": "alter", + "name": "Alter Column storage type", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "msql_endpoint": "NODE-column.msql_id", + "data": { + "name": "col_1111_$%{}[]()&*^!@\"'`\\/#", + "attstorage": "p" + }, + "expected_sql_file": "alter_column_storage.sql", + "expected_msql_file": "alter_column_storage.msql" + }, + { + "type": "delete", + "name": "Drop Column with storage", + "endpoint": "NODE-column.obj_id", + "sql_endpoint": "NODE-column.sql_id", + "data": { + "name": "col_1111_$%{}[]()&*^!@\"'`\\/#" } - ] - } - \ No newline at end of file + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql index 829d32837e4..ebe27cc92cd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ) PARTITION BY RANGE (m_col); ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" IS 'comment_01'; @@ -20,4 +20,4 @@ CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public." TABLESPACE pg_default; ALTER TABLE IF EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql index 8cab6c9420e..10fef1222fa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" ) PARTITION BY RANGE (m_col); ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" IS 'comment_01'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql index 751d2ec2540..1d407e3f689 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql @@ -4,7 +4,7 @@ CREATE TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" ) PARTITION BY RANGE (m_col); ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" IS 'comment_01'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/test_partitions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/test_partitions.json index 4683ecbf961..b740a3ea1ac 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/test_partitions.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/test_partitions.json @@ -8,7 +8,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "test_table_$%{}[]()&*^!@\"\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "comment_01", "coll_inherits": "[]", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/alter_table_add_partition.sql index 6927f6d3e60..6252a41e07d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/alter_table_add_partition.sql @@ -12,7 +12,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" IS 'comment_01'; @@ -24,4 +24,4 @@ CREATE TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public." TABLESPACE pg_default; ALTER TABLE IF EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition.sql index bff95812efb..9b7c48eb501 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition.sql @@ -12,7 +12,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" IS 'comment_01'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition_msql.sql index 7dab015eeb3..ad4aa3de5d8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/create_table_with_partition_msql.sql @@ -7,7 +7,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#" IS 'comment_01'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/test_partitions.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/test_partitions.json index 4683ecbf961..b740a3ea1ac 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/test_partitions.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/default/test_partitions.json @@ -8,7 +8,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "test_table_$%{}[]()&*^!@\"\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "comment_01", "coll_inherits": "[]", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql index 70c567d27bc..a09505553c2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql @@ -27,7 +27,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate.sql index 413d6bc2eca..698694eae0b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" IS 'partition table'; @@ -26,4 +26,4 @@ CREATE TABLE public.cust_arr_small PARTITION OF public."partition_table_with_col TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_arr_small - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate_msql.sql index 12b54c5ee3b..8583dcbdf67 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_partition_table_with_collate_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" IS 'partition table'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql index 0db6496d278..20fdc987e94 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" IS 'hash partition'; @@ -26,4 +26,4 @@ CREATE TABLE public.cust_part11 PARTITION OF public."table_with_hash_patition_$% TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_part11 - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql index 09538ed95d6..610b23645a8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" IS 'hash partition'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/test.json index 7cf2e8d7979..199cd98094a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/test.json @@ -8,7 +8,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -287,7 +287,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -526,7 +526,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "create table comment", "coll_inherits": "[]", @@ -661,7 +661,8 @@ "store_object_id": true, "expected_sql_file": "create_table_with_pk_chk.sql", "expected_msql_file": "create_table_with_pk_chk_msql.sql" - },{ + }, + { "type": "alter", "name": "Alter Table add unique constraint", "endpoint": "NODE-table.obj_id", @@ -794,7 +795,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -1018,7 +1019,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "custom auto vacuum", "coll_inherits": "[]", @@ -1205,7 +1206,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "relhasoids": true, "description": "test comment", @@ -1335,7 +1336,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", @@ -1412,7 +1413,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test ", "coll_inherits": "[]", @@ -1514,7 +1515,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", @@ -1673,7 +1674,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "coll_inherits": "[]", "hastoasttable": true, @@ -1832,7 +1833,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "hash partition", "coll_inherits": "[]", @@ -1990,7 +1991,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql index 5aae1bd9e5d..0d79c007357 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql @@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/# TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql index 7f437e5d092..a5564eebc9f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql @@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql index f25f7444fb1..90728cf2b7b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql @@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/# TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql index be1620fe125..57fe64a0283 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql index fbd26e60934..183795c93ad 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" ) PARTITION BY LIST (status); ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#" IS 'partition table'; @@ -21,14 +21,14 @@ CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_pa FOR VALUES IN ('ACTIVE'); ALTER TABLE IF EXISTS public.cust_active - OWNER to postgres; + OWNER to ; CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#" FOR VALUES IN ('ACTIVE'); ALTER TABLE IF EXISTS public.cust_active - OWNER to postgres; + OWNER to ; CREATE TABLE IF NOT EXISTS public.cust_archived PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#" FOR VALUES IN ('EXPIRED'); ALTER TABLE public.cust_archived - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql index 28d04c67318..35522cab9f1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql index 8197a80f10d..d082d1d31c9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql @@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""' TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql index 51b969907e3..56b1874b7f9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql index fb8c64a4b0e..5c5f52eb025 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql @@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql index ae03929befb..101d0ca4aa4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql @@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""' TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql index d3eb152c986..afadbb0740b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql @@ -14,13 +14,13 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; REVOKE ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" FROM PUBLIC; GRANT SELECT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO ; COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql index 1ae90fa6a90..39d22ab3cf8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql @@ -27,7 +27,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate.sql index 4c61edc1f01..8bd88163d3f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""' ) PARTITION BY RANGE (status COLLATE "C" text_pattern_ops); ALTER TABLE IF EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" IS 'partition table'; @@ -22,4 +22,4 @@ CREATE TABLE public.cust_arr_small PARTITION OF public."partition_table_with_col TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_arr_small - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate_msql.sql index a9b93c36ebb..d03cbc5f26e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_partition_table_with_collate_msql.sql @@ -6,7 +6,7 @@ CREATE TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" ) PARTITION BY RANGE (status COLLATE "C" text_pattern_ops); ALTER TABLE IF EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" IS 'partition table'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql index 525a83eb1e1..af813fb5c1f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" ENABLE ROW LEVEL SECURITY; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql index 6ea6d942c6d..31f3173803c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" ENABLE ROW LEVEL SECURITY; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql index 7d1736fd33d..f19ca73151c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql @@ -23,7 +23,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql index 5afb6094796..2b49a51028d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql @@ -18,7 +18,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql index 9f3323692bc..c815289dee9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql @@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/# TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql index 5c1161e5348..429ab68d37b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql @@ -12,7 +12,7 @@ CREATE TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql index eb72d2770aa..457b7853462 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\ ) PARTITION BY HASH (id); ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" IS 'hash partition'; @@ -22,4 +22,4 @@ CREATE TABLE public.cust_part11 PARTITION OF public."table_with_hash_patition_$% TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_part11 - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql index 9a9351da64a..9a1c6c049a6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql @@ -6,7 +6,7 @@ CREATE TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" ) PARTITION BY HASH (id); ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#" IS 'hash partition'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql index 29ff52efd38..d4a2b173cff 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql @@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" IS 'test '; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql index 19ac43efd4b..8b82e3dbf5a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql @@ -13,7 +13,7 @@ CREATE TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" IS 'test '; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql index 9e88970ece9..f281bf0dbea 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" ) PARTITION BY LIST (status); ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#" IS 'partition table'; @@ -22,4 +22,4 @@ CREATE TABLE public.cust_active PARTITION OF public."table_with_patition_$%{}[]( TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_active - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql index 62b276645d0..6c22990ffff 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql @@ -6,7 +6,7 @@ CREATE TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#" ) PARTITION BY LIST (status); ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#" IS 'partition table'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql index ed5b924ecbe..95bd2896138 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql index c0124d15720..8db3c072f97 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""' TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql index a5399ac19d7..2b4db7c91bc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql @@ -9,7 +9,7 @@ CREATE TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql index 0330073f65f..0e778cd33ae 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql @@ -6,7 +6,7 @@ CREATE TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql index b8adf5aad26..99c116880a6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/ ) PARTITION BY RANGE (arr); ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; -- Partitions SQL @@ -19,4 +19,4 @@ CREATE TABLE public."cust_arr_small PARTITION" PARTITION OF public."table_with_r TABLESPACE pg_default; ALTER TABLE IF EXISTS public."cust_arr_small PARTITION" - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql index dd0c233e337..5b96cb8e833 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql @@ -6,7 +6,7 @@ CREATE TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" ) PARTITION BY RANGE (arr); ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; CREATE TABLE public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" FOR VALUES FROM (20) TO (25); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql index 903bad0f5ea..5a3a5cd5c0d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql index da9e9be7bba..77f89653220 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql @@ -9,7 +9,7 @@ CREATE TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/test.json index 2b375e96560..3cb0020bb48 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/test.json @@ -8,7 +8,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -288,7 +288,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -528,7 +528,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "create table comment", "coll_inherits": "[]", @@ -664,7 +664,8 @@ "store_object_id": true, "expected_sql_file": "create_table_with_pk_chk.sql", "expected_msql_file": "create_table_with_pk_chk_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter Table add unique constraint", "endpoint": "NODE-table.obj_id", @@ -797,7 +798,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -1021,7 +1022,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "custom auto vacuum", "coll_inherits": "[]", @@ -1208,7 +1209,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "relhasoids": true, "description": "test comment", @@ -1338,7 +1339,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", @@ -1361,7 +1362,8 @@ "data": { "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" } - },{ + }, + { "type": "create", "name": "Create Table for like table", "endpoint": "NODE-table.obj", @@ -1405,7 +1407,8 @@ "spcname": "pg_default" }, "store_object_id": true - },{ + }, + { "type": "create", "name": "Create Table using like table", "endpoint": "NODE-table.obj", @@ -1413,7 +1416,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test ", "coll_inherits": "[]", @@ -1499,14 +1502,16 @@ "preprocess_data": true, "expected_sql_file": "create_table_with_lik_tbl.sql", "expected_msql_file": "create_table_with_lik_tbl_msql.sql" - },{ + }, + { "type": "delete", "name": "Delete Table with advanced options", "endpoint": "NODE-table.obj_id", "data": { "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" } - },{ + }, + { "type": "create", "name": "Create Table with list partition", "endpoint": "NODE-table.obj", @@ -1514,7 +1519,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", @@ -1674,7 +1679,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "coll_inherits": "[]", "hastoasttable": true, @@ -1834,7 +1839,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "hash partition", "coll_inherits": "[]", @@ -1992,7 +1997,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_comp.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_comp.sql index 5ff189b1e70..07747f501e7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_comp.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_comp.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_comp_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_type_comp.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_type_comp.sql index 96a04d63ef5..7027b708e8b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_type_comp.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/alter_table_change_col_type_comp.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_comp_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression.sql index 1e24b82ef31..40750cb43ad 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_comp_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression_msql.sql index 69d095b1219..473cbf6c9bb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_column_compression_msql.sql @@ -6,7 +6,7 @@ CREATE TABLE public."simple_table_comp_$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."simple_table_comp_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_comp_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_lik_tbl_msql.sql index 5c14ad797dc..fb94c33d49e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_lik_tbl_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/create_table_with_lik_tbl_msql.sql @@ -14,7 +14,7 @@ CREATE TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" IS 'test '; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/test.json index 4c9136fddcf..72ea22aa144 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/14_plus/test.json @@ -8,7 +8,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -289,7 +289,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -530,7 +530,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "create table comment", "coll_inherits": "[]", @@ -667,7 +667,8 @@ "store_object_id": true, "expected_sql_file": "create_table_with_pk_chk.sql", "expected_msql_file": "create_table_with_pk_chk_msql.sql" - }, { + }, + { "type": "alter", "name": "Alter Table add unique constraint", "endpoint": "NODE-table.obj_id", @@ -800,7 +801,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -1024,7 +1025,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "custom auto vacuum", "coll_inherits": "[]", @@ -1211,7 +1212,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "relhasoids": true, "description": "test comment", @@ -1341,7 +1342,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", @@ -1364,7 +1365,8 @@ "data": { "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" } - },{ + }, + { "type": "create", "name": "Create Table for like table", "endpoint": "NODE-table.obj", @@ -1408,7 +1410,8 @@ "spcname": "pg_default" }, "store_object_id": true - },{ + }, + { "type": "create", "name": "Create Table using like table", "endpoint": "NODE-table.obj", @@ -1416,7 +1419,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test ", "coll_inherits": "[]", @@ -1503,14 +1506,16 @@ "preprocess_data": true, "expected_sql_file": "create_table_with_lik_tbl.sql", "expected_msql_file": "create_table_with_lik_tbl_msql.sql" - },{ + }, + { "type": "delete", "name": "Delete Table with advanced options", "endpoint": "NODE-table.obj_id", "data": { "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" } - },{ + }, + { "type": "create", "name": "Create Table with list partition", "endpoint": "NODE-table.obj", @@ -1518,7 +1523,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", @@ -1679,7 +1684,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "coll_inherits": "[]", "hastoasttable": true, @@ -1840,7 +1845,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "hash partition", "coll_inherits": "[]", @@ -1998,7 +2003,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", @@ -2162,7 +2167,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage.sql index 06d16132a61..85ed3a3b4a4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_storage_$%{}[]()&*^!@""'`\/#" TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_storage_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_storage_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage_msql.sql index d386e8c16e5..ece8ec22d9d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/create_table_with_column_storage_msql.sql @@ -4,7 +4,7 @@ CREATE TABLE public."simple_table_storage_$%{}[]()&*^!@""'`\/#" ); ALTER TABLE IF EXISTS public."simple_table_storage_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_storage_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/test.json index e60271b4a02..25d8d08a8d7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/16_plus/test.json @@ -1,82 +1,428 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Table without primary key", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col3", - "cltype": "boolean", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "scenarios": [ + { + "type": "create", + "name": "Create Table without primary key", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col3", + "cltype": "boolean", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col4", + "cltype": "character varying", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 30, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col5", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": 20, + "attprecision": 10, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col6", + "cltype": "timestamp with time zone", + "attacl": [], + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": 5, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_without_primary_key.sql", + "expected_msql_file": "create_table_without_primary_key_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table to change column data types", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ + { + "attnum": 1, + "cltype": "bigint" }, { - "name": "col4", - "cltype": "character varying", - "attacl": [], + "attnum": 2, "min_val_attlen": 1, "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 30, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "cltype": "character varying" }, { - "name": "col5", + "attnum": 6, + "attlen": null, + "cltype": "time without time zone" + } + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_change_col_data_type.sql", + "expected_msql_file": "alter_table_change_col_data_type_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add pk", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ + { + "attnum": 1, + "attnotnull": true, + "is_primary_key": true + } + ] + }, + "primary_key": { + "added": [ + { + "columns": [ + { + "column": "col1" + } + ], + "include": [] + } + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_add_pk_not_null_constraint.sql", + "expected_msql_file": "alter_table_add_pk_not_null_constraint_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add null constraint, rename column", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ + { + "attnum": 1, + "name": "col1_rename", + "is_primary_key": false + }, + { + "attnum": 4, + "attnotnull": true + } + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_add_null_constraint_rename_col.sql", + "expected_msql_file": "alter_table_add_null_constraint_rename_col_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table add pk", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with primary key", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [ + { + "columns": [ + { + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" + } + ], + "include": [] + } + ], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "integer", + "attacl": [], + "is_primary_key": true, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "json", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_pk.sql", + "expected_msql_file": "create_table_with_pk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add columns", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "columns": { + "added": [ + { + "name": "col3_$%{}[]()&*^!@\\\"'`\\\\/#", "cltype": "numeric", "attacl": [], "min_val_attlen": 1, @@ -85,465 +431,256 @@ "max_val_attprecision": 1000, "is_primary_key": false, "attnotnull": false, - "attlen": 20, - "attprecision": 10, + "attlen": 10, + "attprecision": 5, "attidentity": "a", "colconstype": "n", "attoptions": [], "seclabels": [] }, { - "name": "col6", - "cltype": "timestamp with time zone", + "name": "col4_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "text", "attacl": [], - "min_val_attlen": 0, - "max_val_attlen": 6, "is_primary_key": false, "attnotnull": false, - "attlen": 5, + "attlen": null, "attprecision": null, "attidentity": "a", "colconstype": "n", "attoptions": [], "seclabels": [] } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_without_primary_key.sql", - "expected_msql_file": "create_table_without_primary_key_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table to change column data types", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "cltype": "bigint" - }, - { - "attnum": 2, - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "cltype": "character varying" - }, - { - "attnum": 6, - "attlen": null, - "cltype": "time without time zone" - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_change_col_data_type.sql", - "expected_msql_file": "alter_table_change_col_data_type_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add pk", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "attnotnull": true, - "is_primary_key": true - } - ] - }, - "primary_key": { - "added": [ - { - "columns": [ - { - "column": "col1" - } - ], - "include": [] - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_pk_not_null_constraint.sql", - "expected_msql_file": "alter_table_add_pk_not_null_constraint_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add null constraint, rename column", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "name": "col1_rename", - "is_primary_key": false - }, - { - "attnum": 4, - "attnotnull": true - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_null_constraint_rename_col.sql", - "expected_msql_file": "alter_table_add_null_constraint_rename_col_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table add pk", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Table with primary key", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [ - { - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] - } - ], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ + "store_object_id": true, + "expected_sql_file": "alter_table_add_cols.sql", + "expected_msql_file": "alter_table_add_cols_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table delete columns", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "columns": { + "deleted": [ { - "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "integer", - "attacl": [], - "is_primary_key": true, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", "attoptions": [], - "seclabels": [] - }, - { + "attacl": [], + "seclabels": [], "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", + "atttypid": 114, + "attnum": 2, "cltype": "json", - "attacl": [], + "collspcname": "", + "description": null, + "edit_types": [ + "json", + "jsonb" + ], "is_primary_key": false, + "attstattarget": -1, "attnotnull": true, "attlen": null, "attprecision": null, "attidentity": "a", "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" + "attndims": 0, + "atttypmod": -1, + "attstorage": "x", + "defval": null, + "typname": "json", + "displaytypname": "json", + "elemoid": 114, + "typnspname": "pg_catalog", + "defaultstorage": "x", + "indkey": "1", + "isdup": false, + "is_fk": false, + "is_sys_column": false, + "relname": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "is_view_only": false, + "is_pk": false, + "old_attidentity": "a" } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_pk.sql", - "expected_msql_file": "create_table_with_pk_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table add columns", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "columns": { - "added": [ - { - "name": "col3_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": 10, - "attprecision": 5, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, + "store_object_id": true, + "expected_sql_file": "alter_table_delete_cols.sql", + "expected_msql_file": "alter_table_delete_cols_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table delete columns", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with pk & check constraint", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "create table comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [ + { + "name": "custom_pk", + "comment": "custom pk created", + "fillfactor": "11", + "condeferrable": true, + "condeferred": true, + "columns": [ { - "name": "col4_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_cols.sql", - "expected_msql_file": "alter_table_add_cols_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table delete columns", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "columns": { - "deleted": [ - { - "attoptions": [], - "attacl": [], - "seclabels": [], - "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", - "atttypid": 114, - "attnum": 2, - "cltype": "json", - "collspcname": "", - "description": null, - "edit_types": [ - "json", - "jsonb" - ], - "is_primary_key": false, - "attstattarget": -1, - "attnotnull": true, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attndims": 0, - "atttypmod": -1, - "attstorage": "x", - "defval": null, - "typname": "json", - "displaytypname": "json", - "elemoid": 114, - "typnspname": "pg_catalog", - "defaultstorage": "x", - "indkey": "1", - "isdup": false, - "is_fk": false, - "is_sys_column": false, - "relname": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "is_view_only": false, - "is_pk": false, - "old_attidentity": "a" - } - ] + ], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "time with time zone", + "attacl": [], + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": 5, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "character", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 12, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_delete_cols.sql", - "expected_msql_file": "alter_table_delete_cols_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table delete columns", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#" - } + ], + "foreign_key": [], + "check_constraint": [ + { + "name": "chk_const", + "consrc": "col2 != null", + "convalidated": false, + "comment": "chk const comment" + } + ], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table with pk & check constraint", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "create table comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [ - { - "name": "custom_pk", - "comment": "custom pk created", - "fillfactor": "11", - "condeferrable": true, - "condeferred": true, + "store_object_id": true, + "expected_sql_file": "create_table_with_pk_chk.sql", + "expected_msql_file": "create_table_with_pk_chk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add unique constraint", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "unique_constraint": { + "added": [ + { + "name": "unique", + "fillfactor": "13", "columns": [ { "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" @@ -551,1789 +688,1656 @@ ], "include": [] } - ], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "time with time zone", - "attacl": [], - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": 5, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "character", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 12, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [ + ] + } + }, + "expected_sql_file": "alter_table_add_unique_const.sql", + "expected_msql_file": "alter_table_add_unique_const_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table delete constraints", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "check_constraint": { + "deleted": [ { "name": "chk_const", - "consrc": "col2 != null", + "consrc": "col2 <> NULL::bpchar", + "connoinherit": false, "convalidated": false, - "comment": "chk const comment" - } - ], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" + "relname": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "nspname": "public", + "comment": "chk const comment", + "conislocal": true } - ], - "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" - }, + ] + }, + "unique_constraint": { + "deleted": [ { - "name": "autovacuum_freeze_table_age" + "columns": [ + { + "column": "col1_$%{}[]()&*^!@\\\"\"'`\\\\/#" + } + ], + "name": "unique", + "comment": null, + "spcname": "pg_default", + "fillfactor": "13", + "condeferrable": false, + "condeferred": false, + "include": [], + "col_count": 1, + "conislocal": true } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_pk_chk.sql", - "expected_msql_file": "create_table_with_pk_chk_msql.sql" - }, { - "type": "alter", - "name": "Alter Table add unique constraint", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "unique_constraint": { - "added": [ + ] + } + }, + "expected_sql_file": "alter_table_delete_constraints.sql", + "expected_msql_file": "alter_table_delete_constraints_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with pk & chk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table for FK reference", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "fk_reference_tbl", + "columns": [ + { + "name": "id", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "name", + "cltype": "bigint" + } + ], + "primary_key": [ + { + "columns": [ { - "name": "unique", - "fillfactor": "13", - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] + "column": "id" } - ] + ], + "include": [] } - }, - "expected_sql_file": "alter_table_add_unique_const.sql", - "expected_msql_file": "alter_table_add_unique_const_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table delete constraints", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "check_constraint": { - "deleted": [ + ], + "unique_constraint": [ + { + "name": "", + "columns": [ { - "name": "chk_const", - "consrc": "col2 <> NULL::bpchar", - "connoinherit": false, - "convalidated": false, - "relname": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "nspname": "public", - "comment": "chk const comment", - "conislocal": true + "column": "name" } - ] + ], + "include": [] + } + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" + }, + "store_object_id": true + }, + { + "type": "create", + "name": "Create Table with fk constraint", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "unique_constraint": { - "deleted": [ + { + "name": "col2", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col3", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [ + { + "name": "fk_test", + "comment": "fk comment", + "condeferrable": true, + "confmatchtype": true, + "columns": [ { - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"\"'`\\\\/#" - } - ], - "name": "unique", - "comment": null, - "spcname": "pg_default", - "fillfactor": "13", - "condeferrable": false, - "condeferred": false, - "include": [], - "col_count": 1, - "conislocal": true + "local_column": "col1", + "references": "", + "referenced": "id" } - ] + ], + "confupdtype": "a", + "confdeltype": "a", + "autoindex": false, + "coveringindex": null } - }, - "expected_sql_file": "alter_table_delete_constraints.sql", - "expected_msql_file": "alter_table_delete_constraints_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with pk & chk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#" - } + ], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false }, - { - "type": "create", - "name": "Create Table for FK reference", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "fk_reference_tbl", - "columns": [ - { - "name": "id", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "name", - "cltype": "bigint" - } - ], - "primary_key": [ - { + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "create_table_with_fk.sql", + "expected_msql_file": "create_table_with_fk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add one more fk", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "foreign_key": { + "added": [ + { + "name": "fk2", "columns": [ { - "column": "id" + "local_column": "col2", + "references": "", + "referenced": "name" } ], - "include": [] + "confupdtype": "a", + "confdeltype": "a", + "autoindex": false, + "coveringindex": null } - ], - "unique_constraint": [ - { - "name": "", + ] + } + }, + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "alter_table_add_another_fk.sql", + "expected_msql_file": "alter_table_add_another_fk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add exclude constraint", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "exclude_constraint": { + "added": [ + { + "name": "ex_constr", + "amname": "btree", "columns": [ { - "column": "name" + "column": "col1", + "is_exp": false, + "order": false, + "nulls_order": false, + "operator": "=", + "is_sort_nulls_applicable": false } ], "include": [] } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true + ] + } }, - { - "type": "create", - "name": "Create Table with fk constraint", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "alter_table_add_exclude_constraint.sql", + "expected_msql_file": "alter_table_add_exclude_constraint_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with fk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with custom auto-vacuum", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "custom auto vacuum", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "t", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "character varying[]", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 10, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "date", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "vacuum_table": [ + { + "name": "autovacuum_analyze_scale_factor", + "value": 0.2 + }, + { + "name": "autovacuum_analyze_threshold", + "value": 55 + }, + { + "name": "autovacuum_freeze_max_age", + "value": 20000000 + }, + { + "name": "autovacuum_vacuum_cost_delay", + "value": 25 + }, + { + "name": "autovacuum_vacuum_cost_limit", + "value": 10 + }, + { + "name": "autovacuum_vacuum_scale_factor", + "value": 0.3 + }, + { + "name": "autovacuum_vacuum_threshold", + "value": 60 + }, + { + "name": "autovacuum_freeze_min_age", + "value": 500000 + }, + { + "name": "autovacuum_freeze_table_age", + "value": 1300000 + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "autovacuum_custom": true + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_custom_autovacuum.sql", + "expected_msql_file": "create_table_with_custom_autovacuum_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add toast table", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", + "autovacuum_enabled": "x", + "toast_autovacuum": true, + "toast_autovacuum_enabled": "f", + "vacuum_table": { + "changed": [ { - "name": "col2", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "name": "autovacuum_analyze_threshold", + "value": 60 }, { - "name": "col3", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [ - { - "name": "fk_test", - "comment": "fk comment", - "condeferrable": true, - "confmatchtype": true, - "columns": [ - { - "local_column": "col1", - "references": "", - "referenced": "id" - } - ], - "confupdtype": "a", - "confdeltype": "a", - "autoindex": false, - "coveringindex": null + "name": "autovacuum_vacuum_cost_limit", + "value": 100 } - ], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - }, + ] + }, + "vacuum_toast": { + "changed": [ { - "name": "autovacuum_vacuum_scale_factor" + "name": "autovacuum_freeze_max_age", + "value": 2000000 }, { - "name": "autovacuum_vacuum_threshold" + "name": "autovacuum_vacuum_cost_delay", + "value": 50 }, { - "name": "autovacuum_freeze_min_age" + "name": "autovacuum_vacuum_cost_limit", + "value": 13 }, { - "name": "autovacuum_freeze_table_age" + "name": "autovacuum_vacuum_threshold", + "value": 70 } - ], - "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" + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_with_toast_table.sql", + "expected_msql_file": "alter_table_with_toast_table_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with fk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with advanced options", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "relhasoids": true, + "description": "test comment", + "relpersistence": true, + "fillfactor": "50", + "parallel_workers": "", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "double precision", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "numrange", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": true, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "rlspolicy": true + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_advanced_options.sql", + "expected_msql_file": "create_table_with_advanced_options_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table update grants", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", + "rlspolicy": false, + "forcerlspolicy": false, + "relacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "create_table_with_fk.sql", - "expected_msql_file": "create_table_with_fk_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table add one more fk", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "foreign_key": { - "added": [ + "store_object_id": true, + "expected_sql_file": "alter_table_update_grants.sql", + "expected_msql_file": "alter_table_update_grants_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with advanced options", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table for like table", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "like_tbl", + "columns": [ + { + "name": "id", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "name", + "cltype": "text" + } + ], + "primary_key": [ + { + "columns": [ { - "name": "fk2", - "columns": [ - { - "local_column": "col2", - "references": "", - "referenced": "name" - } - ], - "confupdtype": "a", - "confdeltype": "a", - "autoindex": false, - "coveringindex": null + "column": "id" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "alter_table_add_another_fk.sql", - "expected_msql_file": "alter_table_add_another_fk_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add exclude constraint", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "exclude_constraint": { - "added": [ + ], + "unique_constraint": [ + { + "name": "", + "columns": [ { - "name": "ex_constr", - "amname": "btree", - "columns": [ - { - "column": "col1", - "is_exp": false, - "order": false, - "nulls_order": false, - "operator": "=", - "is_sort_nulls_applicable": false - } - ], - "include": [] + "column": "name" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "alter_table_add_exclude_constraint.sql", - "expected_msql_file": "alter_table_add_exclude_constraint_msql.sql" + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" }, - { - "type": "delete", - "name": "Delete Table with fk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#" - } + "store_object_id": true + }, + { + "type": "create", + "name": "Create Table using like table", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "test ", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": true, + "like_constraints": true, + "like_indexes": true, + "like_storage": true, + "like_comments": true, + "like_identity": true, + "like_statistics": true, + "like_generated": true, + "like_compression": true, + "like_relation": "public.like_tbl" }, - { - "type": "create", - "name": "Create Table with custom auto-vacuum", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "custom auto vacuum", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "t", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "character varying[]", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 10, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "date", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "vacuum_table": [ - { - "name": "autovacuum_analyze_scale_factor", - "value": 0.2 - }, - { - "name": "autovacuum_analyze_threshold", - "value": 55 - }, - { - "name": "autovacuum_freeze_max_age", - "value": 20000000 - }, - { - "name": "autovacuum_vacuum_cost_delay", - "value": 25 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 10 - }, - { - "name": "autovacuum_vacuum_scale_factor", - "value": 0.3 - }, - { - "name": "autovacuum_vacuum_threshold", - "value": 60 - }, - { - "name": "autovacuum_freeze_min_age", - "value": 500000 - }, - { - "name": "autovacuum_freeze_table_age", - "value": 1300000 - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "autovacuum_custom": true - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_custom_autovacuum.sql", - "expected_msql_file": "create_table_with_custom_autovacuum_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add toast table", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "autovacuum_enabled": "x", - "toast_autovacuum": true, - "toast_autovacuum_enabled": "f", - "vacuum_table": { - "changed": [ - { - "name": "autovacuum_analyze_threshold", - "value": 60 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 100 - } - ] - }, - "vacuum_toast": { - "changed": [ - { - "name": "autovacuum_freeze_max_age", - "value": 2000000 - }, - { - "name": "autovacuum_vacuum_cost_delay", - "value": 50 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 13 - }, - { - "name": "autovacuum_vacuum_threshold", - "value": 70 - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_with_toast_table.sql", - "expected_msql_file": "alter_table_with_toast_table_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with fk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Table with advanced options", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "relhasoids": true, - "description": "test comment", - "relpersistence": true, - "fillfactor": "50", - "parallel_workers": "", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "double precision", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "numrange", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": true, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "rlspolicy": true - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_advanced_options.sql", - "expected_msql_file": "create_table_with_advanced_options_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table update grants", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "rlspolicy": false, - "forcerlspolicy": false, - "relacl": { - "added": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_update_grants.sql", - "expected_msql_file": "alter_table_update_grants_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with advanced options", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" - } - },{ - "type": "create", - "name": "Create Table for like table", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "like_tbl", - "columns": [ - { - "name": "id", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "name", - "cltype": "text" - } - ], - "primary_key": [ - { - "columns": [ - { - "column": "id" - } - ], - "include": [] - } - ], - "unique_constraint": [ - { - "name": "", - "columns": [ - { - "column": "name" - } - ], - "include": [] - } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true - },{ - "type": "create", - "name": "Create Table using like table", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "test ", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": true, - "like_constraints": true, - "like_indexes": true, - "like_storage": true, - "like_comments": true, - "like_identity": true, - "like_statistics": true, - "like_generated": true, - "like_compression": true, - "like_relation": "public.like_tbl" - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "create_table_with_lik_tbl.sql", - "expected_msql_file": "create_table_with_lik_tbl_msql.sql" - },{ - "type": "delete", - "name": "Delete Table with advanced options", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" - } - },{ - "type": "create", - "name": "Create Table with list partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "partition table", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_active", - "values_in": "'ACTIVE'", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "list", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "status" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_partition.sql", - "expected_msql_file": "create_table_with_partition_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with list partition", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Table with range partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_arr_small PARTITION", - "values_from": "20", - "values_to": "25", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "range", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "arr" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_range_partition.sql", - "expected_msql_file": "create_table_with_range_partition_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with range partition", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Table with hash partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", - "relowner": "postgres", - "relacl": [], - "description": "hash partition", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_part11", - "values_modulus": "2", - "values_remainder": "1", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "hash", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "name", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "id" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_hash_partition.sql", - "expected_msql_file": "create_table_with_hash_partition_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with hash partition", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#" - } - }, - { - "type": "create", - "name": "Create Table with range partition with collate and opclass", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "partition table", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_arr_small", - "values_from": "'20'", - "values_to": "'25'", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "range", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "status", - "collationame": "\"C\"", - "op_class": "text_pattern_ops" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_partition_table_with_collate.sql", - "expected_msql_file": "create_partition_table_with_collate_msql.sql" + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "create_table_with_lik_tbl.sql", + "expected_msql_file": "create_table_with_lik_tbl_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with advanced options", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with list partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "partition table", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_active", + "values_in": "'ACTIVE'", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "list", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "status" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false }, - { - "type": "delete", - "name": "Delete Table ", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#" - } + "store_object_id": true, + "expected_sql_file": "create_table_with_partition.sql", + "expected_msql_file": "create_table_with_partition_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with list partition", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with range partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_arr_small PARTITION", + "values_from": "20", + "values_to": "25", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "range", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "arr" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false }, - { - "type": "create", - "name": "Create Table with compression columns", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col4", - "cltype": "character varying", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 30, - "attprecision": null, - "attidentity": "a", - "attcompression": "pglz", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col5", - "cltype": "bit", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attidentity": "a", - "attcompression": "lz4", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col6", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [] - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_column_compression.sql", - "expected_msql_file": "create_table_with_column_compression_msql.sql" + "store_object_id": true, + "expected_sql_file": "create_table_with_range_partition.sql", + "expected_msql_file": "create_table_with_range_partition_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with range partition", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with hash partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", + "relowner": "", + "relacl": [], + "description": "hash partition", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_part11", + "values_modulus": "2", + "values_remainder": "1", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "hash", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "name", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "id" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "autovacuum_custom": false }, - { - "type": "alter", - "name": "Alter Table to change column compression type", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "attcompression": "lz4" - }, - { - "attnum": 2, - "attcompression": "pglz" - } - ] + "store_object_id": true, + "expected_sql_file": "create_table_with_hash_partition.sql", + "expected_msql_file": "create_table_with_hash_partition_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with hash partition", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#" + } + }, + { + "type": "create", + "name": "Create Table with range partition with collate and opclass", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "partition table", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_arr_small", + "values_from": "'20'", + "values_to": "'25'", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_change_col_comp.sql", - "expected_msql_file": "alter_table_change_col_comp_msql.sql" + ], + "partition_type": "range", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "status", + "collationame": "\"C\"", + "op_class": "text_pattern_ops" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false }, - { - "type": "alter", - "name": "Alter Table to change column data type and compression type", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 3, - "cltype": "character varying", - "attcompression": "lz4" - } - ] + "store_object_id": true, + "expected_sql_file": "create_partition_table_with_collate.sql", + "expected_msql_file": "create_partition_table_with_collate_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table ", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with compression columns", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col4", + "cltype": "character varying", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 30, + "attprecision": null, + "attidentity": "a", + "attcompression": "pglz", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col5", + "cltype": "bit", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attidentity": "a", + "attcompression": "lz4", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col6", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_change_col_type_comp.sql", - "expected_msql_file": "alter_table_change_col_type_comp_msql.sql" + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [] }, - { - "type": "delete", - "name": "Delete Table ", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#" + "store_object_id": true, + "expected_sql_file": "create_table_with_column_compression.sql", + "expected_msql_file": "create_table_with_column_compression_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table to change column compression type", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ + { + "attnum": 1, + "attcompression": "lz4" + }, + { + "attnum": 2, + "attcompression": "pglz" + } + ] } }, - { - "type": "create", - "name": "Create Table with column storage", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col4", + "store_object_id": true, + "expected_sql_file": "alter_table_change_col_comp.sql", + "expected_msql_file": "alter_table_change_col_comp_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table to change column data type and compression type", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ + { + "attnum": 3, "cltype": "character varying", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 30, - "attprecision": null, - "attidentity": "a", - "attstorage": "e", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "attcompression": "lz4" } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [] - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_column_storage.sql", - "expected_msql_file": "create_table_with_column_storage_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table ", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#" + ] } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_change_col_type_comp.sql", + "expected_msql_file": "alter_table_change_col_type_comp_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table ", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with column storage", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#", + "relowner": "", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col4", + "cltype": "character varying", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 30, + "attprecision": null, + "attidentity": "a", + "attstorage": "e", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [] + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_column_storage.sql", + "expected_msql_file": "create_table_with_column_storage_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table ", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#" } - ] - } - \ No newline at end of file + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql index cb7f2d7a113..18c58e9c322 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql @@ -24,7 +24,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql index c38552f6656..7382411de64 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql @@ -16,7 +16,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql index b60897b3f4e..7f0b5111ceb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql @@ -27,7 +27,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql index 883ee07a01e..49bc85c710e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql @@ -18,7 +18,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql index 92798ecf35a..756cb8c1548 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql @@ -18,7 +18,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql index 9073ae41a51..67667f8a140 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql @@ -19,7 +19,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql index 5ed38dd5cf0..fcc7e3c0cf7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql @@ -17,7 +17,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql index 154b0184ed6..993676aca95 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql @@ -15,7 +15,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql index b4e9092d17a..b5d910f7bf8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql @@ -16,7 +16,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql index 9adc732bb32..1b634e65fb7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql @@ -14,13 +14,13 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; REVOKE ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" FROM PUBLIC; GRANT SELECT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO ; COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql index 70c567d27bc..a09505553c2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql @@ -27,7 +27,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate.sql index 413d6bc2eca..698694eae0b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" IS 'partition table'; @@ -26,4 +26,4 @@ CREATE TABLE public.cust_arr_small PARTITION OF public."partition_table_with_col TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_arr_small - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate_msql.sql index 12b54c5ee3b..8583dcbdf67 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_partition_table_with_collate_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."partition_table_with_collate_$%{}[]()&*^!@""'`\/#" IS 'partition table'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql index 0bf11157591..c61e9df21d0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" ENABLE ROW LEVEL SECURITY; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql index ee9793e4115..6bf9cc4a3a1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" ENABLE ROW LEVEL SECURITY; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql index c1bc7c663f1..f90aa35c732 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql @@ -23,7 +23,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql index e0bf5bd7c4a..a737fb10691 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql @@ -18,7 +18,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" IS 'custom auto vacuum'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql index 709bee33c13..2469c3cf7ae 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql @@ -19,7 +19,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql index fb9536f305a..fd4334fd647 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql @@ -15,7 +15,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql index 039ac925358..9d730c5e91f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql @@ -15,7 +15,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" IS 'test '; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql index cf44cf35bd0..5f0713e40af 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql @@ -15,7 +15,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#" IS 'test '; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition.sql index f28b1e59948..551f9680acb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#" IS 'partition table'; @@ -26,4 +26,4 @@ CREATE TABLE public.cust_active PARTITION OF public."table_with_patition_$%{}[]( TABLESPACE pg_default; ALTER TABLE IF EXISTS public.cust_active - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition_msql.sql index 79826ceae8b..2ad15192c61 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_partition_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#" IS 'partition table'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql index 368495c727b..e402859b2bd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql index 71907e170fa..fb2cfeaf804 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql @@ -17,7 +17,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql index 9fbdcb4df2b..f8e0ee85404 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql @@ -12,7 +12,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" IS 'create table comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql index 216b2915a87..9424d92343f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition.sql index 8dafaa96d55..c147f5aa757 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition.sql @@ -14,7 +14,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; -- Partitions SQL @@ -23,4 +23,4 @@ CREATE TABLE public."cust_arr_small PARTITION" PARTITION OF public."table_with_r TABLESPACE pg_default; ALTER TABLE IF EXISTS public."cust_arr_small PARTITION" - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition_msql.sql index 6ab1e855108..25cdf926227 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_range_partition_msql.sql @@ -9,7 +9,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; CREATE TABLE public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#" FOR VALUES FROM (20) TO (25); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql index e0fd47551ee..57ced999aee 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql @@ -17,7 +17,7 @@ WITH ( TABLESPACE pg_default; ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql index 8faaef59dc9..debfb1d82b5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql @@ -12,7 +12,7 @@ WITH ( ); ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#" - OWNER to postgres; + OWNER to ; COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#" IS 'test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/test.json index a520b657506..030ed169dac 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/test.json @@ -8,7 +8,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -287,7 +287,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -526,7 +526,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "create table comment", "coll_inherits": "[]", @@ -795,7 +795,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test comment", "coll_inherits": "[]", @@ -1019,7 +1019,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "custom auto vacuum", "coll_inherits": "[]", @@ -1206,7 +1206,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "relhasoids": true, "description": "test comment", @@ -1336,7 +1336,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", @@ -1413,7 +1413,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "test ", "coll_inherits": "[]", @@ -1515,7 +1515,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", @@ -1666,7 +1666,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "coll_inherits": "[]", "hastoasttable": true, @@ -1817,7 +1817,7 @@ "msql_endpoint": "NODE-table.msql", "data": { "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "postgres", + "relowner": "", "relacl": [], "description": "partition table", "coll_inherits": "[]", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/test.json index 51064958ad4..7f14eb91cc1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/test.json @@ -1332,7 +1332,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql index 6d4df84df15..6669d3e890c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql @@ -21,14 +21,14 @@ CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_pa FOR VALUES IN ('ACTIVE'); ALTER TABLE IF EXISTS public.cust_active - OWNER to postgres; + OWNER to ; CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#" FOR VALUES IN ('ACTIVE'); ALTER TABLE IF EXISTS public.cust_active - OWNER to postgres; + OWNER to ; CREATE TABLE IF NOT EXISTS public.cust_archived PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#" FOR VALUES IN ('EXPIRED'); ALTER TABLE public.cust_archived - OWNER to postgres; + OWNER to ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/test.json index 183245b15aa..e401b1e1ac7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/test.json @@ -1342,7 +1342,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/14_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/14_plus/test.json index b3ef3f38a67..8185db9bbcb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/14_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/14_plus/test.json @@ -1,335 +1,449 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Table without primary key", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, + "scenarios": [ + { + "type": "create", + "name": "Create Table without primary key", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col3", + "cltype": "boolean", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col4", + "cltype": "character varying", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 30, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col5", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": 20, + "attprecision": 10, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col6", + "cltype": "timestamp with time zone", + "attacl": [], + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": 5, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_without_primary_key.sql", + "expected_msql_file": "create_table_without_primary_key_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table to change column data types", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ { - "name": "col3", - "cltype": "boolean", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "attnum": 1, + "cltype": "bigint" }, { - "name": "col4", - "cltype": "character varying", - "attacl": [], + "attnum": 2, "min_val_attlen": 1, "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 30, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col5", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": 20, - "attprecision": 10, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "cltype": "character varying" }, { - "name": "col6", - "cltype": "timestamp with time zone", - "attacl": [], - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": 5, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "attnum": 6, + "attlen": null, + "cltype": "time without time zone" } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - }, + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_change_col_data_type.sql", + "expected_msql_file": "alter_table_change_col_data_type_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add pk", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ { - "name": "autovacuum_freeze_min_age" - }, + "attnum": 1, + "attnotnull": true, + "is_primary_key": true + } + ] + }, + "primary_key": { + "added": [ { - "name": "autovacuum_freeze_table_age" + "columns": [ + { + "column": "col1" + } + ], + "include": [] } - ], - "vacuum_toast": [ + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_add_pk_not_null_constraint.sql", + "expected_msql_file": "alter_table_add_pk_not_null_constraint_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add null constraint, rename column", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ { - "name": "autovacuum_freeze_max_age" + "attnum": 1, + "name": "col1_rename", + "is_primary_key": false }, { - "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" + "attnum": 4, + "attnotnull": true } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_without_primary_key.sql", - "expected_msql_file": "create_table_without_primary_key_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table to change column data types", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "cltype": "bigint" - }, - { - "attnum": 2, - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "cltype": "character varying" - }, + "store_object_id": true, + "expected_sql_file": "alter_table_add_null_constraint_rename_col.sql", + "expected_msql_file": "alter_table_add_null_constraint_rename_col_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table add pk", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with primary key", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [ + { + "columns": [ { - "attnum": 6, - "attlen": null, - "cltype": "time without time zone" + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_change_col_data_type.sql", - "expected_msql_file": "alter_table_change_col_data_type_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add pk", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "attnotnull": true, - "is_primary_key": true - } - ] + ], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "integer", + "attacl": [], + "is_primary_key": true, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "primary_key": { - "added": [ - { - "columns": [ - { - "column": "col1" - } - ], - "include": [] - } - ] + { + "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "json", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_pk_not_null_constraint.sql", - "expected_msql_file": "alter_table_add_pk_not_null_constraint_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add null constraint, rename column", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "name": "col1_rename", - "is_primary_key": false - }, - { - "attnum": 4, - "attnotnull": true - } - ] + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_null_constraint_rename_col.sql", - "expected_msql_file": "alter_table_add_null_constraint_rename_col_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table add pk", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#" - } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table with primary key", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [ - { - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] - } - ], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ + "store_object_id": true, + "expected_sql_file": "create_table_with_pk.sql", + "expected_msql_file": "create_table_with_pk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add columns", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "columns": { + "added": [ { - "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "integer", + "name": "col3_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "numeric", "attacl": [], - "is_primary_key": true, + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, "attnotnull": false, - "attlen": null, - "attprecision": null, + "attlen": 10, + "attprecision": 5, "attidentity": "a", "colconstype": "n", "attoptions": [], "seclabels": [] }, { - "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "json", + "name": "col4_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "text", "attacl": [], "is_primary_key": false, - "attnotnull": true, + "attnotnull": false, "attlen": null, "attprecision": null, "attidentity": "a", @@ -337,1667 +451,1553 @@ "attoptions": [], "seclabels": [] } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_pk.sql", - "expected_msql_file": "create_table_with_pk_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add columns", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "columns": { - "added": [ - { - "name": "col3_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": 10, - "attprecision": 5, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col4_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_cols.sql", - "expected_msql_file": "alter_table_add_cols_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table delete columns", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "columns": { - "deleted": [ - { - "attoptions": [], - "attacl": [], - "seclabels": [], - "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", - "atttypid": 114, - "attnum": 2, - "cltype": "json", - "collspcname": "", - "description": null, - "edit_types": [ - "json", - "jsonb" - ], - "is_primary_key": false, - "attstattarget": -1, - "attnotnull": true, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attndims": 0, - "atttypmod": -1, - "attstorage": "x", - "defval": null, - "typname": "json", - "displaytypname": "json", - "elemoid": 114, - "typnspname": "pg_catalog", - "defaultstorage": "x", - "indkey": "1", - "isdup": false, - "is_fk": false, - "is_sys_column": false, - "relname": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "is_view_only": false, - "is_pk": false, - "old_attidentity": "a" - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_delete_cols.sql", - "expected_msql_file": "alter_table_delete_cols_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table delete columns", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Table with pk & check constraint", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "create table comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [ - { - "name": "custom_pk", - "comment": "custom pk created", - "fillfactor": "11", - "condeferrable": true, - "condeferred": true, - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] - } - ], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ + "store_object_id": true, + "expected_sql_file": "alter_table_add_cols.sql", + "expected_msql_file": "alter_table_add_cols_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table delete columns", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "columns": { + "deleted": [ { - "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "time with time zone", - "attacl": [], - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": 5, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "character", "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, + "seclabels": [], + "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", + "atttypid": 114, + "attnum": 2, + "cltype": "json", + "collspcname": "", + "description": null, + "edit_types": [ + "json", + "jsonb" + ], "is_primary_key": false, - "attnotnull": false, - "attlen": 12, + "attstattarget": -1, + "attnotnull": true, + "attlen": null, "attprecision": null, "attidentity": "a", "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [ - { - "name": "chk_const", - "consrc": "col2 != null", - "convalidated": false, - "comment": "chk const comment" - } - ], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" + "attndims": 0, + "atttypmod": -1, + "attstorage": "x", + "defval": null, + "typname": "json", + "displaytypname": "json", + "elemoid": 114, + "typnspname": "pg_catalog", + "defaultstorage": "x", + "indkey": "1", + "isdup": false, + "is_fk": false, + "is_sys_column": false, + "relname": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "is_view_only": false, + "is_pk": false, + "old_attidentity": "a" } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_pk_chk.sql", - "expected_msql_file": "create_table_with_pk_chk_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table add unique constraint", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "unique_constraint": { - "added": [ + "store_object_id": true, + "expected_sql_file": "alter_table_delete_cols.sql", + "expected_msql_file": "alter_table_delete_cols_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table delete columns", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with pk & check constraint", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "create table comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [ + { + "name": "custom_pk", + "comment": "custom pk created", + "fillfactor": "11", + "condeferrable": true, + "condeferred": true, + "columns": [ { - "name": "unique", - "fillfactor": "13", - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } - ] + ], + "include": [] } - }, - "expected_sql_file": "alter_table_add_unique_const.sql", - "expected_msql_file": "alter_table_add_unique_const_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table delete constraints", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "check_constraint": { - "deleted": [ - { - "name": "chk_const", - "consrc": "col2 <> NULL::bpchar", - "connoinherit": false, - "convalidated": false, - "relname": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "nspname": "public", - "comment": "chk const comment", - "conislocal": true - } - ] + ], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "time with time zone", + "attacl": [], + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": 5, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "unique_constraint": { - "deleted": [ - { - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"\"'`\\\\/#" - } - ], - "name": "unique", - "comment": null, - "spcname": "pg_default", - "fillfactor": "13", - "condeferrable": false, - "condeferred": false, - "include": [], - "col_count": 1, - "conislocal": true - } - ] + { + "name": "col2", + "cltype": "character", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 12, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "expected_sql_file": "alter_table_delete_constraints.sql", - "expected_msql_file": "alter_table_delete_constraints_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with pk & chk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#" - } + ], + "foreign_key": [], + "check_constraint": [ + { + "name": "chk_const", + "consrc": "col2 != null", + "convalidated": false, + "comment": "chk const comment" + } + ], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table for FK reference", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "fk_reference_tbl", - "columns": [ - { - "name": "id", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "name", - "cltype": "bigint" - } - ], - "primary_key": [ - { - "columns": [ - { - "column": "id" - } - ], - "include": [] - } - ], - "unique_constraint": [ + "store_object_id": true, + "expected_sql_file": "create_table_with_pk_chk.sql", + "expected_msql_file": "create_table_with_pk_chk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add unique constraint", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "unique_constraint": { + "added": [ { - "name": "", + "name": "unique", + "fillfactor": "13", "columns": [ { - "column": "name" + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } ], "include": [] } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true + ] + } }, - { - "type": "create", - "name": "Create Table with fk constraint", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, + "expected_sql_file": "alter_table_add_unique_const.sql", + "expected_msql_file": "alter_table_add_unique_const_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table delete constraints", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "check_constraint": { + "deleted": [ { - "name": "col3", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "name": "chk_const", + "consrc": "col2 <> NULL::bpchar", + "connoinherit": false, + "convalidated": false, + "relname": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "nspname": "public", + "comment": "chk const comment", + "conislocal": true } - ], - "foreign_key": [ + ] + }, + "unique_constraint": { + "deleted": [ { - "name": "fk_test", - "comment": "fk comment", - "condeferrable": true, - "confmatchtype": true, "columns": [ { - "local_column": "col1", - "references": "", - "referenced": "id" + "column": "col1_$%{}[]()&*^!@\\\"\"'`\\\\/#" } ], - "confupdtype": "a", - "confdeltype": "a", - "autoindex": false, - "coveringindex": null - } - ], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" + "name": "unique", + "comment": null, + "spcname": "pg_default", + "fillfactor": "13", + "condeferrable": false, + "condeferred": false, + "include": [], + "col_count": 1, + "conislocal": true } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "create_table_with_fk.sql", - "expected_msql_file": "create_table_with_fk_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table add one more fk", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "foreign_key": { - "added": [ + "expected_sql_file": "alter_table_delete_constraints.sql", + "expected_msql_file": "alter_table_delete_constraints_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with pk & chk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table for FK reference", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "fk_reference_tbl", + "columns": [ + { + "name": "id", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "name", + "cltype": "bigint" + } + ], + "primary_key": [ + { + "columns": [ { - "name": "fk2", - "columns": [ - { - "local_column": "col2", - "references": "", - "referenced": "name" - } - ], - "confupdtype": "a", - "confdeltype": "a", - "autoindex": false, - "coveringindex": null + "column": "id" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "alter_table_add_another_fk.sql", - "expected_msql_file": "alter_table_add_another_fk_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add exclude constraint", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "exclude_constraint": { - "added": [ + ], + "unique_constraint": [ + { + "name": "", + "columns": [ { - "name": "ex_constr", - "amname": "btree", - "columns": [ - { - "column": "col1", - "is_exp": false, - "order": false, - "nulls_order": false, - "operator": "=", - "is_sort_nulls_applicable": false - } - ], - "include": [] + "column": "name" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "alter_table_add_exclude_constraint.sql", - "expected_msql_file": "alter_table_add_exclude_constraint_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with fk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#" - } + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" }, - { - "type": "create", - "name": "Create Table with custom auto-vacuum", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "custom auto vacuum", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "t", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "character varying[]", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 10, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "date", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "vacuum_table": [ - { - "name": "autovacuum_analyze_scale_factor", - "value": 0.2 - }, - { - "name": "autovacuum_analyze_threshold", - "value": 55 - }, - { - "name": "autovacuum_freeze_max_age", - "value": 20000000 - }, - { - "name": "autovacuum_vacuum_cost_delay", - "value": 25 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 10 - }, - { - "name": "autovacuum_vacuum_scale_factor", - "value": 0.3 - }, - { - "name": "autovacuum_vacuum_threshold", - "value": 60 - }, - { - "name": "autovacuum_freeze_min_age", - "value": 500000 - }, - { - "name": "autovacuum_freeze_table_age", - "value": 1300000 - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": true - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_custom_autovacuum.sql", - "expected_msql_file": "create_table_with_custom_autovacuum_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add toast table", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "autovacuum_enabled": "x", - "toast_autovacuum": true, - "toast_autovacuum_enabled": "f", - "vacuum_table": { - "changed": [ - { - "name": "autovacuum_analyze_threshold", - "value": 60 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 100 - } - ] + "store_object_id": true + }, + { + "type": "create", + "name": "Create Table with fk constraint", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "vacuum_toast": { - "changed": [ - { - "name": "autovacuum_freeze_max_age", - "value": 2000000 - }, - { - "name": "autovacuum_vacuum_cost_delay", - "value": 50 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 13 - }, - { - "name": "autovacuum_vacuum_threshold", - "value": 70 - } - ] + { + "name": "col2", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col3", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_with_toast_table.sql", - "expected_msql_file": "alter_table_with_toast_table_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with fk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Table with advanced options", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "relhasoids": true, - "description": "test comment", - "relpersistence": true, - "fillfactor": "50", - "parallel_workers": "", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "double precision", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "numrange", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": true, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "rlspolicy": true - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_advanced_options.sql", - "expected_msql_file": "create_table_with_advanced_options_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table update grants", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "rlspolicy": false, - "forcerlspolicy": false, - "relacl": { - "added": [ + ], + "foreign_key": [ + { + "name": "fk_test", + "comment": "fk comment", + "condeferrable": true, + "confmatchtype": true, + "columns": [ { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] + "local_column": "col1", + "references": "", + "referenced": "id" } - ] + ], + "confupdtype": "a", + "confdeltype": "a", + "autoindex": false, + "coveringindex": null } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_update_grants.sql", - "expected_msql_file": "alter_table_update_grants_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with advanced options", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" - } + ], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table for like table", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "like_tbl", - "columns": [ - { - "name": "id", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "name", - "cltype": "text" - } - ], - "primary_key": [ + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "create_table_with_fk.sql", + "expected_msql_file": "create_table_with_fk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add one more fk", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "foreign_key": { + "added": [ { + "name": "fk2", "columns": [ { - "column": "id" + "local_column": "col2", + "references": "", + "referenced": "name" } ], - "include": [] + "confupdtype": "a", + "confdeltype": "a", + "autoindex": false, + "coveringindex": null } - ], - "unique_constraint": [ + ] + } + }, + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "alter_table_add_another_fk.sql", + "expected_msql_file": "alter_table_add_another_fk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add exclude constraint", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "exclude_constraint": { + "added": [ { - "name": "", + "name": "ex_constr", + "amname": "btree", "columns": [ { - "column": "name" + "column": "col1", + "is_exp": false, + "order": false, + "nulls_order": false, + "operator": "=", + "is_sort_nulls_applicable": false } ], "include": [] } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true + ] + } }, - { - "type": "create", - "name": "Create Table using like table", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test ", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": true, - "like_constraints": true, - "like_indexes": true, - "like_storage": true, - "like_comments": true, - "like_generated": true, - "like_identity": true, - "like_statistics": true, - "like_compression": true, - "like_relation": "public.like_tbl" - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "create_table_with_lik_tbl.sql", - "expected_msql_file": "create_table_with_lik_tbl_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with advanced options", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" - } + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "alter_table_add_exclude_constraint.sql", + "expected_msql_file": "alter_table_add_exclude_constraint_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with fk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with custom auto-vacuum", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "custom auto vacuum", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "t", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "character varying[]", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 10, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "date", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "vacuum_table": [ + { + "name": "autovacuum_analyze_scale_factor", + "value": 0.2 + }, + { + "name": "autovacuum_analyze_threshold", + "value": 55 + }, + { + "name": "autovacuum_freeze_max_age", + "value": 20000000 + }, + { + "name": "autovacuum_vacuum_cost_delay", + "value": 25 + }, + { + "name": "autovacuum_vacuum_cost_limit", + "value": 10 + }, + { + "name": "autovacuum_vacuum_scale_factor", + "value": 0.3 + }, + { + "name": "autovacuum_vacuum_threshold", + "value": 60 + }, + { + "name": "autovacuum_freeze_min_age", + "value": 500000 + }, + { + "name": "autovacuum_freeze_table_age", + "value": 1300000 + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": true }, - { - "type": "create", - "name": "Create Table with list partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "partition table", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_active", - "values_in": "'ACTIVE'", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "list", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "status" - } - ], - "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" - }, + "store_object_id": true, + "expected_sql_file": "create_table_with_custom_autovacuum.sql", + "expected_msql_file": "create_table_with_custom_autovacuum_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add toast table", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", + "autovacuum_enabled": "x", + "toast_autovacuum": true, + "toast_autovacuum_enabled": "f", + "vacuum_table": { + "changed": [ { - "name": "autovacuum_freeze_min_age" + "name": "autovacuum_analyze_threshold", + "value": 60 }, { - "name": "autovacuum_freeze_table_age" + "name": "autovacuum_vacuum_cost_limit", + "value": 100 } - ], - "vacuum_toast": [ - { - "name": "autovacuum_freeze_max_age" - }, - { - "name": "autovacuum_vacuum_cost_delay" - }, - { - "name": "autovacuum_vacuum_cost_limit" - }, + ] + }, + "vacuum_toast": { + "changed": [ { - "name": "autovacuum_vacuum_scale_factor" + "name": "autovacuum_freeze_max_age", + "value": 2000000 }, { - "name": "autovacuum_vacuum_threshold" + "name": "autovacuum_vacuum_cost_delay", + "value": 50 }, { - "name": "autovacuum_freeze_min_age" + "name": "autovacuum_vacuum_cost_limit", + "value": 13 }, { - "name": "autovacuum_freeze_table_age" + "name": "autovacuum_vacuum_threshold", + "value": 70 } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_partition.sql", - "expected_msql_file": "create_table_with_partition_msql.sql" + ] + } }, - { + "store_object_id": true, + "expected_sql_file": "alter_table_with_toast_table.sql", + "expected_msql_file": "alter_table_with_toast_table_msql.sql" + }, + { "type": "delete", - "name": "Delete Table with list partition", + "name": "Delete Table with fk constraints", "endpoint": "NODE-table.obj_id", "data": { - "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#" + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#" } }, { - "type": "create", - "name": "Create Table with range partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_arr_small PARTITION", - "values_from": "20", - "values_to": "25", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "range", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "arr" - } - ], - "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" + "type": "create", + "name": "Create Table with advanced options", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "relhasoids": true, + "description": "test comment", + "relpersistence": true, + "fillfactor": "50", + "parallel_workers": "", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "double precision", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "numrange", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": true, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "rlspolicy": true + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_advanced_options.sql", + "expected_msql_file": "create_table_with_advanced_options_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table update grants", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", + "rlspolicy": false, + "forcerlspolicy": false, + "relacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_range_partition.sql", - "expected_msql_file": "create_table_with_range_partition_msql.sql" + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_update_grants.sql", + "expected_msql_file": "alter_table_update_grants_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with advanced options", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table for like table", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "like_tbl", + "columns": [ + { + "name": "id", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "name", + "cltype": "text" + } + ], + "primary_key": [ + { + "columns": [ + { + "column": "id" + } + ], + "include": [] + } + ], + "unique_constraint": [ + { + "name": "", + "columns": [ + { + "column": "name" + } + ], + "include": [] + } + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" + }, + "store_object_id": true + }, + { + "type": "create", + "name": "Create Table using like table", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test ", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": true, + "like_constraints": true, + "like_indexes": true, + "like_storage": true, + "like_comments": true, + "like_generated": true, + "like_identity": true, + "like_statistics": true, + "like_compression": true, + "like_relation": "public.like_tbl" + }, + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "create_table_with_lik_tbl.sql", + "expected_msql_file": "create_table_with_lik_tbl_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with advanced options", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with list partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "partition table", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_active", + "values_in": "'ACTIVE'", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "list", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "status" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_partition.sql", + "expected_msql_file": "create_table_with_partition_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with list partition", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with range partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_arr_small PARTITION", + "values_from": "20", + "values_to": "25", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "range", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "arr" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_range_partition.sql", + "expected_msql_file": "create_table_with_range_partition_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with range partition", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with hash partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "hash partition", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_part11", + "values_modulus": "2", + "values_remainder": "1", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "hash", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "name", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "id" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false }, - { - "type": "delete", - "name": "Delete Table with range partition", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#" - } + "store_object_id": true, + "expected_sql_file": "create_table_with_hash_partition.sql", + "expected_msql_file": "create_table_with_hash_partition_msql.sql" }, { - "type": "create", - "name": "Create Table with hash partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "hash partition", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_part11", - "values_modulus": "2", - "values_remainder": "1", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "hash", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "name", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "id" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_hash_partition.sql", - "expected_msql_file": "create_table_with_hash_partition_msql.sql" - }, - { "type": "delete", "name": "Delete Table with hash partition", "endpoint": "NODE-table.obj_id", @@ -2006,160 +2006,160 @@ } }, { - "type": "create", - "name": "Create Table with range partition with collate and opclass", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "partition table", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_arr_small", - "values_from": "'20'", - "values_to": "'25'", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "range", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "status", - "collationame": "\"C\"", - "op_class": "text_pattern_ops" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_partition_table_with_collate.sql", - "expected_msql_file": "create_partition_table_with_collate_msql.sql" + "type": "create", + "name": "Create Table with range partition with collate and opclass", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "partition table", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_arr_small", + "values_from": "'20'", + "values_to": "'25'", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "range", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "status", + "collationame": "\"C\"", + "op_class": "text_pattern_ops" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false + }, + "store_object_id": true, + "expected_sql_file": "create_partition_table_with_collate.sql", + "expected_msql_file": "create_partition_table_with_collate_msql.sql" }, { "type": "delete", @@ -2293,6 +2293,6 @@ "data": { "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#" } - } - ] - } + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/16_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/16_plus/test.json index a8f526937c7..c1250f76864 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/16_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/16_plus/test.json @@ -1,335 +1,449 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Table without primary key", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, + "scenarios": [ + { + "type": "create", + "name": "Create Table without primary key", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col3", + "cltype": "boolean", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col4", + "cltype": "character varying", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 30, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col5", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": 20, + "attprecision": 10, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col6", + "cltype": "timestamp with time zone", + "attacl": [], + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": 5, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_without_primary_key.sql", + "expected_msql_file": "create_table_without_primary_key_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table to change column data types", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ { - "name": "col3", - "cltype": "boolean", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "attnum": 1, + "cltype": "bigint" }, { - "name": "col4", - "cltype": "character varying", - "attacl": [], + "attnum": 2, "min_val_attlen": 1, "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 30, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col5", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": 20, - "attprecision": 10, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "cltype": "character varying" }, { - "name": "col6", - "cltype": "timestamp with time zone", - "attacl": [], - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": 5, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "attnum": 6, + "attlen": null, + "cltype": "time without time zone" } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - }, + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_change_col_data_type.sql", + "expected_msql_file": "alter_table_change_col_data_type_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add pk", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ { - "name": "autovacuum_freeze_min_age" - }, + "attnum": 1, + "attnotnull": true, + "is_primary_key": true + } + ] + }, + "primary_key": { + "added": [ { - "name": "autovacuum_freeze_table_age" + "columns": [ + { + "column": "col1" + } + ], + "include": [] } - ], - "vacuum_toast": [ + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_add_pk_not_null_constraint.sql", + "expected_msql_file": "alter_table_add_pk_not_null_constraint_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add null constraint, rename column", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", + "columns": { + "changed": [ { - "name": "autovacuum_freeze_max_age" + "attnum": 1, + "name": "col1_rename", + "is_primary_key": false }, { - "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" + "attnum": 4, + "attnotnull": true } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_without_primary_key.sql", - "expected_msql_file": "create_table_without_primary_key_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table to change column data types", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "cltype": "bigint" - }, - { - "attnum": 2, - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "cltype": "character varying" - }, + "store_object_id": true, + "expected_sql_file": "alter_table_add_null_constraint_rename_col.sql", + "expected_msql_file": "alter_table_add_null_constraint_rename_col_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table add pk", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with primary key", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [ + { + "columns": [ { - "attnum": 6, - "attlen": null, - "cltype": "time without time zone" + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_change_col_data_type.sql", - "expected_msql_file": "alter_table_change_col_data_type_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add pk", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "attnotnull": true, - "is_primary_key": true - } - ] + ], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "integer", + "attacl": [], + "is_primary_key": true, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "primary_key": { - "added": [ - { - "columns": [ - { - "column": "col1" - } - ], - "include": [] - } - ] + { + "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "json", + "attacl": [], + "is_primary_key": false, + "attnotnull": true, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_pk_not_null_constraint.sql", - "expected_msql_file": "alter_table_add_pk_not_null_constraint_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add null constraint, rename column", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#", - "columns": { - "changed": [ - { - "attnum": 1, - "name": "col1_rename", - "is_primary_key": false - }, - { - "attnum": 4, - "attnotnull": true - } - ] + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_null_constraint_rename_col.sql", - "expected_msql_file": "alter_table_add_null_constraint_rename_col_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table add pk", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_$%{}[]()&*^!@\"'`\\/#" - } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table with primary key", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [ - { - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] - } - ], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ + "store_object_id": true, + "expected_sql_file": "create_table_with_pk.sql", + "expected_msql_file": "create_table_with_pk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add columns", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "columns": { + "added": [ { - "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "integer", + "name": "col3_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "numeric", "attacl": [], - "is_primary_key": true, + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, "attnotnull": false, - "attlen": null, - "attprecision": null, + "attlen": 10, + "attprecision": 5, "attidentity": "a", "colconstype": "n", "attoptions": [], "seclabels": [] }, { - "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "json", + "name": "col4_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "text", "attacl": [], "is_primary_key": false, - "attnotnull": true, + "attnotnull": false, "attlen": null, "attprecision": null, "attidentity": "a", @@ -337,1505 +451,1391 @@ "attoptions": [], "seclabels": [] } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_pk.sql", - "expected_msql_file": "create_table_with_pk_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add columns", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "columns": { - "added": [ - { - "name": "col3_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": 10, - "attprecision": 5, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col4_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_add_cols.sql", - "expected_msql_file": "alter_table_add_cols_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table delete columns", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "columns": { - "deleted": [ - { - "attoptions": [], - "attacl": [], - "seclabels": [], - "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", - "atttypid": 114, - "attnum": 2, - "cltype": "json", - "collspcname": "", - "description": null, - "edit_types": [ - "json", - "jsonb" - ], - "is_primary_key": false, - "attstattarget": -1, - "attnotnull": true, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attndims": 0, - "atttypmod": -1, - "attstorage": "x", - "defval": null, - "typname": "json", - "displaytypname": "json", - "elemoid": 114, - "typnspname": "pg_catalog", - "defaultstorage": "x", - "indkey": "1", - "isdup": false, - "is_fk": false, - "is_sys_column": false, - "relname": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", - "is_view_only": false, - "is_pk": false, - "old_attidentity": "a" - } - ] - } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_delete_cols.sql", - "expected_msql_file": "alter_table_delete_cols_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table delete columns", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#" + ] } }, - { - "type": "create", - "name": "Create Table with pk & check constraint", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "create table comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [ - { - "name": "custom_pk", - "comment": "custom pk created", - "fillfactor": "11", - "condeferrable": true, - "condeferred": true, - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] - } - ], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ + "store_object_id": true, + "expected_sql_file": "alter_table_add_cols.sql", + "expected_msql_file": "alter_table_add_cols_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table delete columns", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "columns": { + "deleted": [ { - "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", - "cltype": "time with time zone", - "attacl": [], - "min_val_attlen": 0, - "max_val_attlen": 6, - "is_primary_key": false, - "attnotnull": false, - "attlen": 5, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "character", "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, + "seclabels": [], + "name": "col2_$%{}[]()&*^!@\\\"'`\\\\/#", + "atttypid": 114, + "attnum": 2, + "cltype": "json", + "collspcname": "", + "description": null, + "edit_types": [ + "json", + "jsonb" + ], "is_primary_key": false, - "attnotnull": false, - "attlen": 12, + "attstattarget": -1, + "attnotnull": true, + "attlen": null, "attprecision": null, "attidentity": "a", "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [ - { - "name": "chk_const", - "consrc": "col2 != null", - "convalidated": false, - "comment": "chk const comment" - } - ], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" + "attndims": 0, + "atttypmod": -1, + "attstorage": "x", + "defval": null, + "typname": "json", + "displaytypname": "json", + "elemoid": 114, + "typnspname": "pg_catalog", + "defaultstorage": "x", + "indkey": "1", + "isdup": false, + "is_fk": false, + "is_sys_column": false, + "relname": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#", + "is_view_only": false, + "is_pk": false, + "old_attidentity": "a" } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_pk_chk.sql", - "expected_msql_file": "create_table_with_pk_chk_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table add unique constraint", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "unique_constraint": { - "added": [ + "store_object_id": true, + "expected_sql_file": "alter_table_delete_cols.sql", + "expected_msql_file": "alter_table_delete_cols_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table delete columns", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_with_pk$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with pk & check constraint", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "create table comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [ + { + "name": "custom_pk", + "comment": "custom pk created", + "fillfactor": "11", + "condeferrable": true, + "condeferred": true, + "columns": [ { - "name": "unique", - "fillfactor": "13", - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" - } - ], - "include": [] + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } - ] + ], + "include": [] } - }, - "expected_sql_file": "alter_table_add_unique_const.sql", - "expected_msql_file": "alter_table_add_unique_const_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table delete constraints", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "check_constraint": { - "deleted": [ - { - "name": "chk_const", - "consrc": "col2 <> NULL::bpchar", - "connoinherit": false, - "convalidated": false, - "relname": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", - "nspname": "public", - "comment": "chk const comment", - "conislocal": true - } - ] + ], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1_$%{}[]()&*^!@\\\"'`\\\\/#", + "cltype": "time with time zone", + "attacl": [], + "min_val_attlen": 0, + "max_val_attlen": 6, + "is_primary_key": false, + "attnotnull": false, + "attlen": 5, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "unique_constraint": { - "deleted": [ - { - "columns": [ - { - "column": "col1_$%{}[]()&*^!@\\\"\"'`\\\\/#" - } - ], - "name": "unique", - "comment": null, - "spcname": "pg_default", - "fillfactor": "13", - "condeferrable": false, - "condeferred": false, - "include": [], - "col_count": 1, - "conislocal": true - } - ] + { + "name": "col2", + "cltype": "character", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 12, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "expected_sql_file": "alter_table_delete_constraints.sql", - "expected_msql_file": "alter_table_delete_constraints_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with pk & chk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#" - } + ], + "foreign_key": [], + "check_constraint": [ + { + "name": "chk_const", + "consrc": "col2 != null", + "convalidated": false, + "comment": "chk const comment" + } + ], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table for FK reference", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "fk_reference_tbl", - "columns": [ - { - "name": "id", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "name", - "cltype": "bigint" - } - ], - "primary_key": [ - { - "columns": [ - { - "column": "id" - } - ], - "include": [] - } - ], - "unique_constraint": [ + "store_object_id": true, + "expected_sql_file": "create_table_with_pk_chk.sql", + "expected_msql_file": "create_table_with_pk_chk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add unique constraint", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "unique_constraint": { + "added": [ { - "name": "", + "name": "unique", + "fillfactor": "13", "columns": [ { - "column": "name" + "column": "col1_$%{}[]()&*^!@\\\"'`\\\\/#" } ], "include": [] } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true + ] + } }, - { - "type": "create", - "name": "Create Table with fk constraint", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, + "expected_sql_file": "alter_table_add_unique_const.sql", + "expected_msql_file": "alter_table_add_unique_const_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table delete constraints", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "check_constraint": { + "deleted": [ { - "name": "col3", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] + "name": "chk_const", + "consrc": "col2 <> NULL::bpchar", + "connoinherit": false, + "convalidated": false, + "relname": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#", + "nspname": "public", + "comment": "chk const comment", + "conislocal": true } - ], - "foreign_key": [ + ] + }, + "unique_constraint": { + "deleted": [ { - "name": "fk_test", - "comment": "fk comment", - "condeferrable": true, - "confmatchtype": true, "columns": [ { - "local_column": "col1", - "references": "", - "referenced": "id" + "column": "col1_$%{}[]()&*^!@\\\"\"'`\\\\/#" } ], - "confupdtype": "a", - "confdeltype": "a", - "autoindex": false, - "coveringindex": null - } - ], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" + "name": "unique", + "comment": null, + "spcname": "pg_default", + "fillfactor": "13", + "condeferrable": false, + "condeferred": false, + "include": [], + "col_count": 1, + "conislocal": true } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "create_table_with_fk.sql", - "expected_msql_file": "create_table_with_fk_msql.sql" + ] + } }, - { - "type": "alter", - "name": "Alter Table add one more fk", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "foreign_key": { - "added": [ + "expected_sql_file": "alter_table_delete_constraints.sql", + "expected_msql_file": "alter_table_delete_constraints_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with pk & chk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_pk_chk_constraints$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table for FK reference", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "fk_reference_tbl", + "columns": [ + { + "name": "id", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "name", + "cltype": "bigint" + } + ], + "primary_key": [ + { + "columns": [ { - "name": "fk2", - "columns": [ - { - "local_column": "col2", - "references": "", - "referenced": "name" - } - ], - "confupdtype": "a", - "confdeltype": "a", - "autoindex": false, - "coveringindex": null + "column": "id" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "alter_table_add_another_fk.sql", - "expected_msql_file": "alter_table_add_another_fk_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add exclude constraint", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", - "exclude_constraint": { - "added": [ + ], + "unique_constraint": [ + { + "name": "", + "columns": [ { - "name": "ex_constr", - "amname": "btree", - "columns": [ - { - "column": "col1", - "is_exp": false, - "order": false, - "nulls_order": false, - "operator": "=", - "is_sort_nulls_applicable": false - } - ], - "include": [] + "column": "name" } - ] + ], + "include": [] } - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "alter_table_add_exclude_constraint.sql", - "expected_msql_file": "alter_table_add_exclude_constraint_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with fk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#" - } + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" }, - { - "type": "create", - "name": "Create Table with custom auto-vacuum", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "custom auto vacuum", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "t", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "character varying[]", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 10, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "date", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "vacuum_table": [ - { - "name": "autovacuum_analyze_scale_factor", - "value": 0.2 - }, - { - "name": "autovacuum_analyze_threshold", - "value": 55 - }, - { - "name": "autovacuum_freeze_max_age", - "value": 20000000 - }, - { - "name": "autovacuum_vacuum_cost_delay", - "value": 25 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 10 - }, - { - "name": "autovacuum_vacuum_scale_factor", - "value": 0.3 - }, - { - "name": "autovacuum_vacuum_threshold", - "value": 60 - }, - { - "name": "autovacuum_freeze_min_age", - "value": 500000 - }, - { - "name": "autovacuum_freeze_table_age", - "value": 1300000 - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": true - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_custom_autovacuum.sql", - "expected_msql_file": "create_table_with_custom_autovacuum_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table add toast table", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", - "autovacuum_enabled": "x", - "toast_autovacuum": true, - "toast_autovacuum_enabled": "f", - "vacuum_table": { - "changed": [ - { - "name": "autovacuum_analyze_threshold", - "value": 60 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 100 - } - ] + "store_object_id": true + }, + { + "type": "create", + "name": "Create Table with fk constraint", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] }, - "vacuum_toast": { - "changed": [ - { - "name": "autovacuum_freeze_max_age", - "value": 2000000 - }, - { - "name": "autovacuum_vacuum_cost_delay", - "value": 50 - }, - { - "name": "autovacuum_vacuum_cost_limit", - "value": 13 - }, - { - "name": "autovacuum_vacuum_threshold", - "value": 70 - } - ] + { + "name": "col2", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col3", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_with_toast_table.sql", - "expected_msql_file": "alter_table_with_toast_table_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with fk constraints", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#" - } - }, - { - "type": "create", - "name": "Create Table with advanced options", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "relhasoids": true, - "description": "test comment", - "relpersistence": true, - "fillfactor": "50", - "parallel_workers": "", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col1", - "cltype": "double precision", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "col2", - "cltype": "numrange", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": true, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "rlspolicy": true - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_advanced_options.sql", - "expected_msql_file": "create_table_with_advanced_options_msql.sql" - }, - { - "type": "alter", - "name": "Alter Table update grants", - "endpoint": "NODE-table.obj_id", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql_id", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", - "rlspolicy": false, - "forcerlspolicy": false, - "relacl": { - "added": [ + ], + "foreign_key": [ + { + "name": "fk_test", + "comment": "fk comment", + "condeferrable": true, + "confmatchtype": true, + "columns": [ { - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [ - { - "privilege_type": "r", - "privilege": true, - "with_grant": false - } - ] + "local_column": "col1", + "references": "", + "referenced": "id" } - ] + ], + "confupdtype": "a", + "confdeltype": "a", + "autoindex": false, + "coveringindex": null } - }, - "store_object_id": true, - "expected_sql_file": "alter_table_update_grants.sql", - "expected_msql_file": "alter_table_update_grants_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with advanced options", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" - } + ], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false }, - { - "type": "create", - "name": "Create Table for like table", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "data": { - "name": "like_tbl", - "columns": [ - { - "name": "id", - "cltype": "integer", - "is_primary_key": true - }, - { - "name": "name", - "cltype": "text" - } - ], - "primary_key": [ + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "create_table_with_fk.sql", + "expected_msql_file": "create_table_with_fk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add one more fk", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "foreign_key": { + "added": [ { + "name": "fk2", "columns": [ { - "column": "id" + "local_column": "col2", + "references": "", + "referenced": "name" } ], - "include": [] + "confupdtype": "a", + "confdeltype": "a", + "autoindex": false, + "coveringindex": null } - ], - "unique_constraint": [ + ] + } + }, + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "alter_table_add_another_fk.sql", + "expected_msql_file": "alter_table_add_another_fk_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add exclude constraint", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#", + "exclude_constraint": { + "added": [ { - "name": "", + "name": "ex_constr", + "amname": "btree", "columns": [ { - "column": "name" + "column": "col1", + "is_exp": false, + "order": false, + "nulls_order": false, + "operator": "=", + "is_sort_nulls_applicable": false } ], "include": [] } - ], - "is_partitioned": false, - "schema": "public", - "spcname": "pg_default" - }, - "store_object_id": true + ] + } }, - { - "type": "create", - "name": "Create Table using like table", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test ", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "partition_type": "range", - "is_partitioned": false, - "schema": "public", - "columns": [], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": true, - "like_constraints": true, - "like_indexes": true, - "like_storage": true, - "like_comments": true, - "like_generated": true, - "like_identity": true, - "like_statistics": true, - "like_compression": true, - "like_relation": "public.like_tbl" - }, - "store_object_id": true, - "preprocess_data": true, - "expected_sql_file": "create_table_with_lik_tbl.sql", - "expected_msql_file": "create_table_with_lik_tbl_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table with advanced options", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" - } + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "alter_table_add_exclude_constraint.sql", + "expected_msql_file": "alter_table_add_exclude_constraint_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with fk constraints", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_fk_constraints$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with custom auto-vacuum", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "custom auto vacuum", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "t", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "character varying[]", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 10, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "date", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "vacuum_table": [ + { + "name": "autovacuum_analyze_scale_factor", + "value": 0.2 + }, + { + "name": "autovacuum_analyze_threshold", + "value": 55 + }, + { + "name": "autovacuum_freeze_max_age", + "value": 20000000 + }, + { + "name": "autovacuum_vacuum_cost_delay", + "value": 25 + }, + { + "name": "autovacuum_vacuum_cost_limit", + "value": 10 + }, + { + "name": "autovacuum_vacuum_scale_factor", + "value": 0.3 + }, + { + "name": "autovacuum_vacuum_threshold", + "value": 60 + }, + { + "name": "autovacuum_freeze_min_age", + "value": 500000 + }, + { + "name": "autovacuum_freeze_table_age", + "value": 1300000 + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": true }, - { - "type": "create", - "name": "Create Table with list partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "partition table", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_active", - "values_in": "'ACTIVE'", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "list", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "status" - } - ], - "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" - }, + "store_object_id": true, + "expected_sql_file": "create_table_with_custom_autovacuum.sql", + "expected_msql_file": "create_table_with_custom_autovacuum_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table add toast table", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#", + "autovacuum_enabled": "x", + "toast_autovacuum": true, + "toast_autovacuum_enabled": "f", + "vacuum_table": { + "changed": [ { - "name": "autovacuum_freeze_min_age" + "name": "autovacuum_analyze_threshold", + "value": 60 }, { - "name": "autovacuum_freeze_table_age" + "name": "autovacuum_vacuum_cost_limit", + "value": 100 } - ], - "vacuum_toast": [ - { - "name": "autovacuum_freeze_max_age" - }, - { - "name": "autovacuum_vacuum_cost_delay" - }, - { - "name": "autovacuum_vacuum_cost_limit" - }, + ] + }, + "vacuum_toast": { + "changed": [ { - "name": "autovacuum_vacuum_scale_factor" + "name": "autovacuum_freeze_max_age", + "value": 2000000 }, { - "name": "autovacuum_vacuum_threshold" + "name": "autovacuum_vacuum_cost_delay", + "value": 50 }, { - "name": "autovacuum_freeze_min_age" + "name": "autovacuum_vacuum_cost_limit", + "value": 13 }, { - "name": "autovacuum_freeze_table_age" + "name": "autovacuum_vacuum_threshold", + "value": 70 } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_partition.sql", - "expected_msql_file": "create_table_with_partition_msql.sql" + ] + } }, - { + "store_object_id": true, + "expected_sql_file": "alter_table_with_toast_table.sql", + "expected_msql_file": "alter_table_with_toast_table_msql.sql" + }, + { "type": "delete", - "name": "Delete Table with list partition", + "name": "Delete Table with fk constraints", "endpoint": "NODE-table.obj_id", "data": { - "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#" + "name": "table_with_custom_autovaccum_$%{}[]()&*^!@\"'`\\/#" } }, { - "type": "create", - "name": "Create Table with range partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_arr_small PARTITION", - "values_from": "20", - "values_to": "25", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "range", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "arr" - } - ], - "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" + "type": "create", + "name": "Create Table with advanced options", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "relhasoids": true, + "description": "test comment", + "relpersistence": true, + "fillfactor": "50", + "parallel_workers": "", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col1", + "cltype": "double precision", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "col2", + "cltype": "numrange", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": true, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "rlspolicy": true + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_advanced_options.sql", + "expected_msql_file": "create_table_with_advanced_options_msql.sql" + }, + { + "type": "alter", + "name": "Alter Table update grants", + "endpoint": "NODE-table.obj_id", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql_id", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#", + "rlspolicy": false, + "forcerlspolicy": false, + "relacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_range_partition.sql", - "expected_msql_file": "create_table_with_range_partition_msql.sql" + ] + } + }, + "store_object_id": true, + "expected_sql_file": "alter_table_update_grants.sql", + "expected_msql_file": "alter_table_update_grants_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with advanced options", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_advanced_options_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table for like table", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "data": { + "name": "like_tbl", + "columns": [ + { + "name": "id", + "cltype": "integer", + "is_primary_key": true + }, + { + "name": "name", + "cltype": "text" + } + ], + "primary_key": [ + { + "columns": [ + { + "column": "id" + } + ], + "include": [] + } + ], + "unique_constraint": [ + { + "name": "", + "columns": [ + { + "column": "name" + } + ], + "include": [] + } + ], + "is_partitioned": false, + "schema": "public", + "spcname": "pg_default" + }, + "store_object_id": true + }, + { + "type": "create", + "name": "Create Table using like table", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test ", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "partition_type": "range", + "is_partitioned": false, + "schema": "public", + "columns": [], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": true, + "like_constraints": true, + "like_indexes": true, + "like_storage": true, + "like_comments": true, + "like_generated": true, + "like_identity": true, + "like_statistics": true, + "like_compression": true, + "like_relation": "public.like_tbl" + }, + "store_object_id": true, + "preprocess_data": true, + "expected_sql_file": "create_table_with_lik_tbl.sql", + "expected_msql_file": "create_table_with_lik_tbl_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with advanced options", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_like_tbl$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with list partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "partition table", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_active", + "values_in": "'ACTIVE'", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "list", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "status" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false + }, + "store_object_id": true, + "expected_sql_file": "create_table_with_partition.sql", + "expected_msql_file": "create_table_with_partition_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table with list partition", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "table_with_patition_$%{}[]()&*^!@\"'`\\/#" + } + }, + { + "type": "create", + "name": "Create Table with range partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_range_patition_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_arr_small PARTITION", + "values_from": "20", + "values_to": "25", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "range", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "arr" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false }, - { + "store_object_id": true, + "expected_sql_file": "create_table_with_range_partition.sql", + "expected_msql_file": "create_table_with_range_partition_msql.sql" + }, + { "type": "delete", "name": "Delete Table with range partition", "endpoint": "NODE-table.obj_id", @@ -1844,160 +1844,160 @@ } }, { - "type": "create", - "name": "Create Table with hash partition", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "hash partition", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_part11", - "values_modulus": "2", - "values_remainder": "1", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "hash", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "bigint", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "name", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "id" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_hash_partition.sql", - "expected_msql_file": "create_table_with_hash_partition_msql.sql" + "type": "create", + "name": "Create Table with hash partition", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "table_with_hash_patition_$%{}[]()&*^!@\\\"'`\\\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "hash partition", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_part11", + "values_modulus": "2", + "values_remainder": "1", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "hash", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "bigint", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "name", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "id" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false }, - { + "store_object_id": true, + "expected_sql_file": "create_table_with_hash_partition.sql", + "expected_msql_file": "create_table_with_hash_partition_msql.sql" + }, + { "type": "delete", "name": "Delete Table with hash partition", "endpoint": "NODE-table.obj_id", @@ -2006,160 +2006,160 @@ } }, { - "type": "create", - "name": "Create Table with range partition with collate and opclass", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "partition table", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [ - { - "is_attach": false, - "partition_name": "cust_arr_small", - "values_from": "'20'", - "values_to": "'25'", - "is_sub_partitioned": false, - "sub_partition_type": "range", - "sub_partition_keys": [] - } - ], - "partition_type": "range", - "is_partitioned": true, - "schema": "public", - "columns": [ - { - "name": "id", - "cltype": "integer", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "status", - "cltype": "text", - "attacl": [], - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - }, - { - "name": "arr", - "cltype": "numeric", - "attacl": [], - "min_val_attlen": 1, - "min_val_attprecision": 0, - "max_val_attlen": 1000, - "max_val_attprecision": 1000, - "is_primary_key": false, - "attnotnull": false, - "attlen": null, - "attprecision": null, - "attidentity": "a", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [ - { - "key_type": "column", - "pt_column": "status", - "collationame": "\"C\"", - "op_class": "text_pattern_ops" - } - ], - "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" - } - ], - "seclabels": [], - "forcerlspolicy": false, - "like_default_value": false, - "like_constraints": false, - "like_indexes": false, - "like_storage": false, - "like_comments": false, - "like_identity": false, - "like_statistics": false, - "like_generated": false, - "like_compression": false, - "autovacuum_custom": false - }, - "store_object_id": true, - "expected_sql_file": "create_partition_table_with_collate.sql", - "expected_msql_file": "create_partition_table_with_collate_msql.sql" + "type": "create", + "name": "Create Table with range partition with collate and opclass", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "partition_table_with_collate_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "partition table", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [ + { + "is_attach": false, + "partition_name": "cust_arr_small", + "values_from": "'20'", + "values_to": "'25'", + "is_sub_partitioned": false, + "sub_partition_type": "range", + "sub_partition_keys": [] + } + ], + "partition_type": "range", + "is_partitioned": true, + "schema": "public", + "columns": [ + { + "name": "id", + "cltype": "integer", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "status", + "cltype": "text", + "attacl": [], + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + }, + { + "name": "arr", + "cltype": "numeric", + "attacl": [], + "min_val_attlen": 1, + "min_val_attprecision": 0, + "max_val_attlen": 1000, + "max_val_attprecision": 1000, + "is_primary_key": false, + "attnotnull": false, + "attlen": null, + "attprecision": null, + "attidentity": "a", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [ + { + "key_type": "column", + "pt_column": "status", + "collationame": "\"C\"", + "op_class": "text_pattern_ops" + } + ], + "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" + } + ], + "seclabels": [], + "forcerlspolicy": false, + "like_default_value": false, + "like_constraints": false, + "like_indexes": false, + "like_storage": false, + "like_comments": false, + "like_identity": false, + "like_statistics": false, + "like_generated": false, + "like_compression": false, + "autovacuum_custom": false + }, + "store_object_id": true, + "expected_sql_file": "create_partition_table_with_collate.sql", + "expected_msql_file": "create_partition_table_with_collate_msql.sql" }, { "type": "delete", @@ -2293,61 +2293,61 @@ "data": { "name": "simple_table_comp_$%{}[]()&*^!@\"'`\\/#" } + }, + { + "type": "create", + "name": "Create Table with column storage", + "endpoint": "NODE-table.obj", + "sql_endpoint": "NODE-table.sql_id", + "msql_endpoint": "NODE-table.msql", + "data": { + "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#", + "relowner": "enterprisedb", + "relacl": [], + "description": "test comment", + "coll_inherits": "[]", + "hastoasttable": true, + "toast_autovacuum_enabled": "x", + "autovacuum_enabled": "x", + "primary_key": [], + "partitions": [], + "is_partitioned": false, + "schema": "public", + "columns": [ + { + "name": "col4", + "cltype": "character varying", + "attacl": [], + "min_val_attlen": 1, + "max_val_attlen": 2147483647, + "is_primary_key": false, + "attnotnull": false, + "attlen": 30, + "attprecision": null, + "attidentity": "a", + "attstorage": "e", + "colconstype": "n", + "attoptions": [], + "seclabels": [] + } + ], + "foreign_key": [], + "check_constraint": [], + "unique_constraint": [], + "exclude_constraint": [], + "partition_keys": [] }, - { - "type": "create", - "name": "Create Table with column storage", - "endpoint": "NODE-table.obj", - "sql_endpoint": "NODE-table.sql_id", - "msql_endpoint": "NODE-table.msql", - "data": { - "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#", - "relowner": "enterprisedb", - "relacl": [], - "description": "test comment", - "coll_inherits": "[]", - "hastoasttable": true, - "toast_autovacuum_enabled": "x", - "autovacuum_enabled": "x", - "primary_key": [], - "partitions": [], - "is_partitioned": false, - "schema": "public", - "columns": [ - { - "name": "col4", - "cltype": "character varying", - "attacl": [], - "min_val_attlen": 1, - "max_val_attlen": 2147483647, - "is_primary_key": false, - "attnotnull": false, - "attlen": 30, - "attprecision": null, - "attidentity": "a", - "attstorage": "e", - "colconstype": "n", - "attoptions": [], - "seclabels": [] - } - ], - "foreign_key": [], - "check_constraint": [], - "unique_constraint": [], - "exclude_constraint": [], - "partition_keys": [] - }, - "store_object_id": true, - "expected_sql_file": "create_table_with_column_storage.sql", - "expected_msql_file": "create_table_with_column_storage_msql.sql" - }, - { - "type": "delete", - "name": "Delete Table ", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#" - } + "store_object_id": true, + "expected_sql_file": "create_table_with_column_storage.sql", + "expected_msql_file": "create_table_with_column_storage_msql.sql" + }, + { + "type": "delete", + "name": "Delete Table ", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "simple_table_storage_$%{}[]()&*^!@\"'`\\/#" } - ] - } + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/test.json index bc450784670..92f2835e40c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/test.json @@ -1324,7 +1324,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "r", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/test.json index f4568aa42e8..e84bcf0985c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/test.json @@ -37,7 +37,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/14_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/14_plus/test.json index 0591de6ad6f..60fc20ee9ce 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/14_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/14_plus/test.json @@ -37,7 +37,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_plain_trigger_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_plain_trigger_function.sql index 759c632e9cf..15603af8e17 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_plain_trigger_function.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_plain_trigger_function.sql @@ -14,4 +14,4 @@ end; $BODY$; ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() - OWNER TO postgres; + OWNER TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/test.json index f4568aa42e8..e84bcf0985c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/test.json @@ -37,7 +37,7 @@ "name": "Trig1_$%{}[]()&*^!@\"'`\\/#", "acl": [], "args": [], - "funcowner": "postgres", + "funcowner": "", "lanname": "plpgsql", "options": [], "pronamespace": 2200, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/17_plus/test_schema.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/17_plus/test_schema.json index 86fc0e7fe35..b7b88660739 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/17_plus/test_schema.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/17_plus/test_schema.json @@ -9,103 +9,135 @@ "data": { "name": "test_schema_$%{}[]()&*^!@\"\"'`\\/#", "description": "This is a test comment", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }, { - "privilege_type": "m", - "privilege": true, - "with_grant": false - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + }, + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_schema_all_options.sql", "expected_msql_file": "create_schema_all_options_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop Schema with all options", "endpoint": "NODE-schema.obj_id", "data": { "name": "test_schema_$%{}[]()&*^!@\"\"'`\\/#" } - }, { + }, + { "type": "create", "name": "Create Schema with comments", "endpoint": "NODE-schema.obj", @@ -117,7 +149,8 @@ }, "expected_sql_file": "create_schema_with_comment.sql", "expected_msql_file": "create_schema_with_comment_msql.sql" - }, { + }, + { "type": "alter", "name": "Alert Schema Name", "endpoint": "NODE-schema.obj_id", @@ -136,7 +169,8 @@ "data": { "name": "test_schema1_$%{}[]()&*^!@\"\"'`\\/#" } - }, { + }, + { "type": "create", "name": "Create Schema", "endpoint": "NODE-schema.obj", @@ -144,7 +178,8 @@ "data": { "name": "test_schema_$%{}[]()&*^!@\"\"'`\\/#" } - }, { + }, + { "type": "alter", "name": "Alert Schema Add Privileges", "endpoint": "NODE-schema.obj_id", @@ -152,72 +187,95 @@ "msql_endpoint": "NODE-schema.msql_id", "data": { "nspacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftblacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "defseqacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deffuncacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftypeacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_schema_add_priv.sql", "expected_msql_file": "alter_schema_add_priv_msql.sql" - }, { + }, + { "type": "alter", "name": "Alert Schema Update Privileges", "endpoint": "NODE-schema.obj_id", @@ -225,42 +283,55 @@ "msql_endpoint": "NODE-schema.msql_id", "data": { "nspacl": { - "changed": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftblacl": { - "changed": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "defseqacl": { - "changed": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_schema_update_priv.sql", "expected_msql_file": "alter_schema_update_priv_msql.sql" - }, { + }, + { "type": "alter", "name": "Alert Schema Drop Privileges", "endpoint": "NODE-schema.obj_id", @@ -268,41 +339,54 @@ "msql_endpoint": "NODE-schema.msql_id", "data": { "nspacl": { - "deleted": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "defseqacl": { - "deleted": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftypeacl": { - "deleted": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_schema_drop_priv.sql", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv.sql index 4c57a1392b6..824f5a5dcb2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv.sql @@ -3,20 +3,20 @@ -- DROP SCHEMA IF EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" ; CREATE SCHEMA IF NOT EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" - AUTHORIZATION postgres; + AUTHORIZATION ; GRANT CREATE ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO PUBLIC; -GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO postgres; +GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT, UPDATE ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT, UPDATE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT EXECUTE ON FUNCTIONS TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT USAGE ON TYPES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv_msql.sql index adf741941ce..b8420feeca5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_add_priv_msql.sql @@ -1,13 +1,13 @@ GRANT CREATE ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT, UPDATE ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT, UPDATE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT EXECUTE ON FUNCTIONS TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT USAGE ON TYPES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv.sql index 09c5b7f886d..a79f2cc8fa1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv.sql @@ -3,12 +3,12 @@ -- DROP SCHEMA IF EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" ; CREATE SCHEMA IF NOT EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" - AUTHORIZATION postgres; + AUTHORIZATION ; -GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO postgres; +GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT EXECUTE ON FUNCTIONS TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv_msql.sql index 9263bc42fdc..98f41ef4704 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_drop_priv_msql.sql @@ -1,5 +1,5 @@ REVOKE ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" REVOKE ALL ON SEQUENCES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" REVOKE ALL ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_name.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_name.sql index 3642167ef9c..a683dc858ed 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_name.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_name.sql @@ -3,7 +3,7 @@ -- DROP SCHEMA IF EXISTS "test_schema1_$%{}[]()&*^!@""""'`\/#" ; CREATE SCHEMA IF NOT EXISTS "test_schema1_$%{}[]()&*^!@""""'`\/#" - AUTHORIZATION postgres; + AUTHORIZATION ; COMMENT ON SCHEMA "test_schema1_$%{}[]()&*^!@""""'`\/#" IS 'This is a test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv.sql index 1d03b22bc21..9d0daa5a767 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv.sql @@ -3,20 +3,20 @@ -- DROP SCHEMA IF EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" ; CREATE SCHEMA IF NOT EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" - AUTHORIZATION postgres; + AUTHORIZATION ; GRANT USAGE ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO PUBLIC; -GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO postgres; +GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT UPDATE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT EXECUTE ON FUNCTIONS TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT USAGE ON TYPES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv_msql.sql index 8ce58a3c213..9213278f51b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/alter_schema_update_priv_msql.sql @@ -1,12 +1,12 @@ REVOKE ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" FROM PUBLIC; GRANT USAGE ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" REVOKE ALL ON TABLES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT SELECT ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" REVOKE ALL ON SEQUENCES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT UPDATE ON SEQUENCES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options.sql index bb31d9943bc..956279bc01c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options.sql @@ -3,23 +3,23 @@ -- DROP SCHEMA IF EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" ; CREATE SCHEMA IF NOT EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" - AUTHORIZATION postgres; + AUTHORIZATION ; COMMENT ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" IS 'This is a test comment'; GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO PUBLIC; -GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO postgres; +GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT ALL ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT ALL ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT EXECUTE ON FUNCTIONS TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT USAGE ON TYPES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options_msql.sql index 647449cd6b3..a57698493ee 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_all_options_msql.sql @@ -5,14 +5,14 @@ COMMENT ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT ALL ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT ALL ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT ALL ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT EXECUTE ON FUNCTIONS TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" +ALTER DEFAULT PRIVILEGES FOR ROLE IN SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" GRANT USAGE ON TYPES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_with_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_with_comment.sql index e0e4cf4c451..61dd63862c8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_with_comment.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/create_schema_with_comment.sql @@ -3,7 +3,7 @@ -- DROP SCHEMA IF EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" ; CREATE SCHEMA IF NOT EXISTS "test_schema_$%{}[]()&*^!@""""'`\/#" - AUTHORIZATION postgres; + AUTHORIZATION ; COMMENT ON SCHEMA "test_schema_$%{}[]()&*^!@""""'`\/#" IS 'This is a test comment'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/test_schema.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/test_schema.json index 85c0d6af1b6..efb330b549f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/test_schema.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/pg/default/test_schema.json @@ -9,99 +9,130 @@ "data": { "name": "test_schema_$%{}[]()&*^!@\"\"'`\\/#", "description": "This is a test comment", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_schema_all_options.sql", "expected_msql_file": "create_schema_all_options_msql.sql" - }, { + }, + { "type": "delete", "name": "Drop Schema with all options", "endpoint": "NODE-schema.obj_id", "data": { "name": "test_schema_$%{}[]()&*^!@\"\"'`\\/#" } - }, { + }, + { "type": "create", "name": "Create Schema with comments", "endpoint": "NODE-schema.obj", @@ -113,7 +144,8 @@ }, "expected_sql_file": "create_schema_with_comment.sql", "expected_msql_file": "create_schema_with_comment_msql.sql" - }, { + }, + { "type": "alter", "name": "Alert Schema Name", "endpoint": "NODE-schema.obj_id", @@ -132,7 +164,8 @@ "data": { "name": "test_schema1_$%{}[]()&*^!@\"\"'`\\/#" } - }, { + }, + { "type": "create", "name": "Create Schema", "endpoint": "NODE-schema.obj", @@ -140,7 +173,8 @@ "data": { "name": "test_schema_$%{}[]()&*^!@\"\"'`\\/#" } - }, { + }, + { "type": "alter", "name": "Alert Schema Add Privileges", "endpoint": "NODE-schema.obj_id", @@ -148,72 +182,95 @@ "msql_endpoint": "NODE-schema.msql_id", "data": { "nspacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftblacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "defseqacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deffuncacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftypeacl": { - "added": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_schema_add_priv.sql", "expected_msql_file": "alter_schema_add_priv_msql.sql" - }, { + }, + { "type": "alter", "name": "Alert Schema Update Privileges", "endpoint": "NODE-schema.obj_id", @@ -221,42 +278,55 @@ "msql_endpoint": "NODE-schema.msql_id", "data": { "nspacl": { - "changed": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftblacl": { - "changed": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "defseqacl": { - "changed": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_schema_update_priv.sql", "expected_msql_file": "alter_schema_update_priv_msql.sql" - }, { + }, + { "type": "alter", "name": "Alert Schema Drop Privileges", "endpoint": "NODE-schema.obj_id", @@ -264,41 +334,54 @@ "msql_endpoint": "NODE-schema.msql_id", "data": { "nspacl": { - "deleted": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "defseqacl": { - "deleted": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "deftypeacl": { - "deleted": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] } }, "expected_sql_file": "alter_schema_drop_priv.sql", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/14_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/14_plus/tests.json index 3c752724832..6a1fb1ca811 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/14_plus/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/14_plus/tests.json @@ -8,14 +8,24 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "enum_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"e", - "schema":"public", - "composite":[], - "enum":[{"label":"a"},{"label":"b"},{"label":"c"}], - "typacl":[], - "seclabels":[], - "description":"" + "is_sys_type": false, + "typtype": "e", + "schema": "public", + "composite": [], + "enum": [ + { + "label": "a" + }, + { + "label": "b" + }, + { + "label": "c" + } + ], + "typacl": [], + "seclabels": [], + "description": "" }, "expected_sql_file": "create_enum_type.sql", "expected_msql_file": "create_enum_type.msql" @@ -27,7 +37,13 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "enum": {"added": [{"label": "d"}]} + "enum": { + "added": [ + { + "label": "d" + } + ] + } }, "expected_sql_file": "alter_enum_type_label.sql", "expected_msql_file": "alter_enum_type_label.msql" @@ -39,8 +55,22 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test", - "typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]} + "description": "this is test", + "typacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_enum_type_acl_description.sql", "expected_msql_file": "alter_enum_type_acl_description.msql" @@ -52,7 +82,18 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "enum": {"changed": [{"label": "a_new", "old_label": "a"}, {"label": "d_new", "old_label": "d"}]} + "enum": { + "changed": [ + { + "label": "a_new", + "old_label": "a" + }, + { + "label": "d_new", + "old_label": "d" + } + ] + } }, "expected_sql_file": "alter_enum_type_rename_enum.sql", "expected_msql_file": "alter_enum_type_rename_enum.msql" @@ -64,8 +105,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - - { "type": "create", "name": "Create Composite type", @@ -74,17 +113,39 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "composite_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"c", - "schema":"public", - "composite":[ - {"member_name":"mname1","type":"bigint","is_tlength":false,"is_precision":false}, - {"member_name":"mname2","type":"character varying","tlength":50,"is_tlength":true,"is_precision":false,"collation":"pg_catalog.\"C\"","min_val":1,"max_val":2147483647,"collspcname":""}, - {"member_name":"mname3","type":"text[]","is_tlength":false,"is_precision":false,"collation":"pg_catalog.\"C\"","collspcname":""} + "is_sys_type": false, + "typtype": "c", + "schema": "public", + "composite": [ + { + "member_name": "mname1", + "type": "bigint", + "is_tlength": false, + "is_precision": false + }, + { + "member_name": "mname2", + "type": "character varying", + "tlength": 50, + "is_tlength": true, + "is_precision": false, + "collation": "pg_catalog.\"C\"", + "min_val": 1, + "max_val": 2147483647, + "collspcname": "" + }, + { + "member_name": "mname3", + "type": "text[]", + "is_tlength": false, + "is_precision": false, + "collation": "pg_catalog.\"C\"", + "collspcname": "" + } ], - "typacl":[], - "seclabels":[], - "description":"" + "typacl": [], + "seclabels": [], + "description": "" }, "expected_sql_file": "create_composite_type.sql", "expected_msql_file": "create_composite_type.msql" @@ -96,7 +157,16 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "composite": {"added": [{"member_name":"mname4","type":"bigint","is_tlength":false,"is_precision":false}]} + "composite": { + "added": [ + { + "member_name": "mname4", + "type": "bigint", + "is_tlength": false, + "is_precision": false + } + ] + } }, "expected_sql_file": "alter_composite_type_add_member.sql", "expected_msql_file": "alter_composite_type_add_member.msql" @@ -108,7 +178,23 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "composite": {"deleted":[{"attnum":1,"member_name":"mname1","type":"bigint","tlength":null,"is_tlength":false,"precision":null,"is_precision":false,"collation":"","cltype":"bigint","hasSqrBracket":false,"fulltype":"bigint"}]} + "composite": { + "deleted": [ + { + "attnum": 1, + "member_name": "mname1", + "type": "bigint", + "tlength": null, + "is_tlength": false, + "precision": null, + "is_precision": false, + "collation": "", + "cltype": "bigint", + "hasSqrBracket": false, + "fulltype": "bigint" + } + ] + } }, "expected_sql_file": "alter_composite_type_remove_member.sql", "expected_msql_file": "alter_composite_type_remove_member.msql" @@ -120,8 +206,22 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test", - "typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]} + "description": "this is test", + "typacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_composite_type_acl_description.sql", "expected_msql_file": "alter_composite_type_acl_description.msql" @@ -133,7 +233,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - { "type": "create", "name": "Create Composite type - one field", @@ -141,15 +240,20 @@ "sql_endpoint": "NODE-type.sql_id", "data": { "name": "composite_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"c", - "schema":"public", - "composite":[ - {"member_name":"mname1","type":"bigint","is_tlength":false,"is_precision":false} + "is_sys_type": false, + "typtype": "c", + "schema": "public", + "composite": [ + { + "member_name": "mname1", + "type": "bigint", + "is_tlength": false, + "is_precision": false + } ], - "typacl":[], - "seclabels":[], - "description":"" + "typacl": [], + "seclabels": [], + "description": "" }, "expected_sql_file": "create_composite_type_one_field.sql" }, @@ -160,7 +264,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - { "type": "create", "name": "Create SHELL type", @@ -169,13 +272,13 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "shell_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"p", - "schema":"public", - "composite":[], - "enum":[], - "typacl":[], - "seclabels":[] + "is_sys_type": false, + "typtype": "p", + "schema": "public", + "composite": [], + "enum": [], + "typacl": [], + "seclabels": [] }, "expected_sql_file": "create_shell_type.sql", "expected_msql_file": "create_shell_type.msql" @@ -187,7 +290,7 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test" + "description": "this is test" }, "expected_sql_file": "alter_shell_type_acl_description.sql", "expected_msql_file": "alter_shell_type_acl_description.msql" @@ -199,8 +302,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - - { "type": "create", "name": "Create RANGE type", @@ -209,14 +310,14 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "range_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"r", - "schema":"public", - "composite":[], - "enum":[], - "typacl":[], - "seclabels":[], - "typname":"bool" + "is_sys_type": false, + "typtype": "r", + "schema": "public", + "composite": [], + "enum": [], + "typacl": [], + "seclabels": [], + "typname": "bool" }, "expected_sql_file": "create_range_type.sql", "expected_msql_file": "create_range_type.msql" @@ -228,8 +329,22 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test", - "typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]} + "description": "this is test", + "typacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_range_type_acl_description.sql", "expected_msql_file": "alter_range_type_acl_description.msql" @@ -245,7 +360,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "U", @@ -266,21 +381,21 @@ "msql_endpoint": "NODE-type.msql_id", "data": { "typacl": { - "changed": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", - "privileges": [ - { - "privilege_type": "U", - "privilege": true, - "with_grant": false - } - ] - } - ] - } + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_acl_grantee_change.sql", "expected_msql_file": "alter_acl_grantee_change_msql.sql" @@ -300,14 +415,14 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "range_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"r", - "schema":"public", - "composite":[], - "enum":[], - "typacl":[], - "seclabels":[], - "typname":"bool", + "is_sys_type": false, + "typtype": "r", + "schema": "public", + "composite": [], + "enum": [], + "typacl": [], + "seclabels": [], + "typname": "bool", "rngmultirangetype": "multirange_type" }, "expected_sql_file": "create_multi_range_type.sql", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/tests.json index 31bd5dde52e..40d5e1626dc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/tests.json @@ -8,14 +8,24 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "enum_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"e", - "schema":"public", - "composite":[], - "enum":[{"label":"a"},{"label":"b"},{"label":"c"}], - "typacl":[], - "seclabels":[], - "description":"" + "is_sys_type": false, + "typtype": "e", + "schema": "public", + "composite": [], + "enum": [ + { + "label": "a" + }, + { + "label": "b" + }, + { + "label": "c" + } + ], + "typacl": [], + "seclabels": [], + "description": "" }, "expected_sql_file": "create_enum_type.sql", "expected_msql_file": "create_enum_type.msql" @@ -27,7 +37,13 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "enum": {"added": [{"label": "d"}]} + "enum": { + "added": [ + { + "label": "d" + } + ] + } }, "expected_sql_file": "alter_enum_type_label.sql", "expected_msql_file": "alter_enum_type_label.msql" @@ -39,8 +55,22 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test", - "typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]} + "description": "this is test", + "typacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_enum_type_acl_description.sql", "expected_msql_file": "alter_enum_type_acl_description.msql" @@ -52,7 +82,18 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "enum": {"changed": [{"label": "a_new", "old_label": "a"}, {"label": "d_new", "old_label": "d"}]} + "enum": { + "changed": [ + { + "label": "a_new", + "old_label": "a" + }, + { + "label": "d_new", + "old_label": "d" + } + ] + } }, "expected_sql_file": "alter_enum_type_rename_enum.sql", "expected_msql_file": "alter_enum_type_rename_enum.msql" @@ -64,8 +105,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - - { "type": "create", "name": "Create Composite type", @@ -74,17 +113,39 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "composite_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"c", - "schema":"public", - "composite":[ - {"member_name":"mname1","type":"bigint","is_tlength":false,"is_precision":false}, - {"member_name":"mname2","type":"character varying","tlength":50,"is_tlength":true,"is_precision":false,"collation":"pg_catalog.\"C\"","min_val":1,"max_val":2147483647,"collspcname":""}, - {"member_name":"mname3","type":"text[]","is_tlength":false,"is_precision":false,"collation":"pg_catalog.\"C\"","collspcname":""} + "is_sys_type": false, + "typtype": "c", + "schema": "public", + "composite": [ + { + "member_name": "mname1", + "type": "bigint", + "is_tlength": false, + "is_precision": false + }, + { + "member_name": "mname2", + "type": "character varying", + "tlength": 50, + "is_tlength": true, + "is_precision": false, + "collation": "pg_catalog.\"C\"", + "min_val": 1, + "max_val": 2147483647, + "collspcname": "" + }, + { + "member_name": "mname3", + "type": "text[]", + "is_tlength": false, + "is_precision": false, + "collation": "pg_catalog.\"C\"", + "collspcname": "" + } ], - "typacl":[], - "seclabels":[], - "description":"" + "typacl": [], + "seclabels": [], + "description": "" }, "expected_sql_file": "create_composite_type.sql", "expected_msql_file": "create_composite_type.msql" @@ -96,7 +157,16 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "composite": {"added": [{"member_name":"mname4","type":"bigint","is_tlength":false,"is_precision":false}]} + "composite": { + "added": [ + { + "member_name": "mname4", + "type": "bigint", + "is_tlength": false, + "is_precision": false + } + ] + } }, "expected_sql_file": "alter_composite_type_add_member.sql", "expected_msql_file": "alter_composite_type_add_member.msql" @@ -108,7 +178,23 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "composite": {"deleted":[{"attnum":1,"member_name":"mname1","type":"bigint","tlength":null,"is_tlength":false,"precision":null,"is_precision":false,"collation":"","cltype":"bigint","hasSqrBracket":false,"fulltype":"bigint"}]} + "composite": { + "deleted": [ + { + "attnum": 1, + "member_name": "mname1", + "type": "bigint", + "tlength": null, + "is_tlength": false, + "precision": null, + "is_precision": false, + "collation": "", + "cltype": "bigint", + "hasSqrBracket": false, + "fulltype": "bigint" + } + ] + } }, "expected_sql_file": "alter_composite_type_remove_member.sql", "expected_msql_file": "alter_composite_type_remove_member.msql" @@ -120,8 +206,22 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test", - "typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]} + "description": "this is test", + "typacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_composite_type_acl_description.sql", "expected_msql_file": "alter_composite_type_acl_description.msql" @@ -133,7 +233,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - { "type": "create", "name": "Create Composite type - one field", @@ -141,15 +240,20 @@ "sql_endpoint": "NODE-type.sql_id", "data": { "name": "composite_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"c", - "schema":"public", - "composite":[ - {"member_name":"mname1","type":"bigint","is_tlength":false,"is_precision":false} + "is_sys_type": false, + "typtype": "c", + "schema": "public", + "composite": [ + { + "member_name": "mname1", + "type": "bigint", + "is_tlength": false, + "is_precision": false + } ], - "typacl":[], - "seclabels":[], - "description":"" + "typacl": [], + "seclabels": [], + "description": "" }, "expected_sql_file": "create_composite_type_one_field.sql" }, @@ -160,7 +264,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - { "type": "create", "name": "Create SHELL type", @@ -169,13 +272,13 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "shell_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"p", - "schema":"public", - "composite":[], - "enum":[], - "typacl":[], - "seclabels":[] + "is_sys_type": false, + "typtype": "p", + "schema": "public", + "composite": [], + "enum": [], + "typacl": [], + "seclabels": [] }, "expected_sql_file": "create_shell_type.sql", "expected_msql_file": "create_shell_type.msql" @@ -187,7 +290,7 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test" + "description": "this is test" }, "expected_sql_file": "alter_shell_type_acl_description.sql", "expected_msql_file": "alter_shell_type_acl_description.msql" @@ -199,8 +302,6 @@ "sql_endpoint": "NODE-type.sql_id", "data": {} }, - - { "type": "create", "name": "Create RANGE type", @@ -209,14 +310,14 @@ "msql_endpoint": "NODE-type.msql", "data": { "name": "range_type_$%{}[]()&*^!@\"'`\\/#", - "is_sys_type":false, - "typtype":"r", - "schema":"public", - "composite":[], - "enum":[], - "typacl":[], - "seclabels":[], - "typname":"bool" + "is_sys_type": false, + "typtype": "r", + "schema": "public", + "composite": [], + "enum": [], + "typacl": [], + "seclabels": [], + "typname": "bool" }, "expected_sql_file": "create_range_type.sql", "expected_msql_file": "create_range_type.msql" @@ -228,8 +329,22 @@ "sql_endpoint": "NODE-type.sql_id", "msql_endpoint": "NODE-type.msql_id", "data": { - "description":"this is test", - "typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]} + "description": "this is test", + "typacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_range_type_acl_description.sql", "expected_msql_file": "alter_range_type_acl_description.msql" @@ -245,7 +360,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "U", @@ -266,21 +381,21 @@ "msql_endpoint": "NODE-type.msql_id", "data": { "typacl": { - "changed": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", - "privileges": [ - { - "privilege_type": "U", - "privilege": true, - "with_grant": false - } - ] - } - ] - } + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_acl_grantee_change.sql", "expected_msql_file": "alter_acl_grantee_change_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am.sql index 39d07b539a4..7c77e6fb6a6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am.sql @@ -9,7 +9,7 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_am_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_am_$%{}[]()&*^!/@`#" IS 'comment1'; \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am_msql.sql index d43f961e478..37d8bc39478 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/create_mview_with_am_msql.sql @@ -6,7 +6,7 @@ SELECT 1 AS col1 WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_am_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_am_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/test_mview.json index a8bf5ef7d1d..f1666e30751 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/test_mview.json @@ -1,280 +1,279 @@ { - "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", - "schema": "public", - "owner": "postgres", - "datacl": [], - "seclabels": [], - "name": "testmview_$%{}[]()&*^!/@`#", - "comment": "comment1", - "definition": "SELECT 1 AS col1" - }, - "expected_sql_file": "create_mview.sql", - "expected_msql_file": "create_mview_msql.sql" + "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", + "schema": "public", + "owner": "", + "datacl": [], + "seclabels": [], + "name": "testmview_$%{}[]()&*^!/@`#", + "comment": "comment1", + "definition": "SELECT 1 AS col1" }, - { - "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": "postgres", - "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" + "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": "", + "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 + } + ] + } + ] + } }, - { - "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": "postgres", - "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" + "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": "", + "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 + } + ] + } + ] + } }, - { - "type": "alter", - "name": "Alter Materialised Views (change grantee in privileges)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "datacl": { - "changed": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", - "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_change_grantee_priv.sql", - "expected_msql_file": "alter_mview_change_grantee_priv_msql.sql" + "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 grantee in privileges)", + "endpoint": "NODE-mview.obj_id", + "sql_endpoint": "NODE-mview.sql_id", + "msql_endpoint": "NODE-mview.msql_id", + "data": { + "datacl": { + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "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 + } + ] + } + ] + } }, - { - "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 AS col1;" - }, - "expected_sql_file": "alter_mview_definition.sql", - "expected_msql_file": "alter_mview_definition_msql.sql" + "expected_sql_file": "alter_mview_change_grantee_priv.sql", + "expected_msql_file": "alter_mview_change_grantee_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 AS col1;" }, - { - "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": true - }, - "expected_sql_file": "alter_mview_add_fillfactor.sql", - "expected_msql_file": "alter_mview_add_fillfactor_msql.sql" + "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": true }, - { - "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": "t", - "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" + "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": "t", + "vacuum_table": { + "changed": [ + { + "name": "autovacuum_analyze_scale_factor", + "value": 0.2 + } + ] + } }, - { - "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": "x", - "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" + "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": "x", + "vacuum_table": { + "changed": [ + { + "name": "autovacuum_analyze_scale_factor", + "value": null + } + ] + } }, - { - "type": "create", - "name": "Create Materialised Views with access method", - "endpoint": "NODE-mview.obj", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql", - "data": { - "spcname": "pg_default", - "schema": "public", - "owner": "postgres", - "datacl": [], - "seclabels": [], - "name": "testmview_am_$%{}[]()&*^!/@`#", - "comment": "comment1", - "definition": "SELECT 1 AS col1", - "amname": "heap" - }, - "expected_msql_file": "create_mview_with_am_msql.sql", - "expected_sql_file": "create_mview_with_am.sql" - } - ] - } - \ No newline at end of file + "expected_sql_file": "alter_mview_remove_table_parameter.sql", + "expected_msql_file": "alter_mview_remove_table_parameter_msql.sql" + }, + { + "type": "create", + "name": "Create Materialised Views with access method", + "endpoint": "NODE-mview.obj", + "sql_endpoint": "NODE-mview.sql_id", + "msql_endpoint": "NODE-mview.msql", + "data": { + "spcname": "pg_default", + "schema": "public", + "owner": "", + "datacl": [], + "seclabels": [], + "name": "testmview_am_$%{}[]()&*^!/@`#", + "comment": "comment1", + "definition": "SELECT 1 AS col1", + "amname": "heap" + }, + "expected_msql_file": "create_mview_with_am_msql.sql", + "expected_sql_file": "create_mview_with_am.sql" + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/tests.json index 4180ec310bc..83395eb5c8f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/12_plus/tests.json @@ -1,224 +1,244 @@ { - "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": "postgres", - "schema": "public", - "check_option": "local", - "security_barrier": false, - "comment":"Testcomment", - "datacl":[{"grantee":"postgres", "old_grantee": "postgres", "grantor":"postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] - }, - "expected_sql_file": "create_view.sql", - "expected_msql_file": "create_view_msql.sql" + "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": "", + "schema": "public", + "check_option": "local", + "security_barrier": false, + "comment": "Testcomment", + "datacl": [ + { + "grantee": "", + "old_grantee": "", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, - { - "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": "postgres", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":[{"grantee":"postgres", "grantor":"postgres", "old_grantee": "postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] - }, - "expected_sql_file": "alter_view.sql", - "expected_msql_file": "alter_view_msql.sql" + "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": "", + "schema": "public", + "check_option": "cascaded", + "security_barrier": true, + "comment": "Testcomment-updated", + "datacl": [ + { + "grantee": "", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, - { - "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" + "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;" }, - { - "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": "postgres", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":{ - "added":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } + "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": "", + "schema": "public", + "check_option": "cascaded", + "security_barrier": true, + "comment": "Testcomment-updated", + "datacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "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 (PUBLIC))", - "endpoint": "NODE-view.obj_id", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql_id", - "data": { - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": + "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 (PUBLIC))", + "endpoint": "NODE-view.obj_id", + "sql_endpoint": "NODE-view.sql_id", + "msql_endpoint": "NODE-view.msql_id", + "data": { + "name": "testview_$%{}[]()&*^!@\"'`\\/#", + "owner": "", + "schema": "public", + "check_option": "cascaded", + "security_barrier": true, + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ { - "deleted":[ + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] + "privilege_type": "r", + "privilege": true, + "with_grant": false } ] } + ] } - }, - { - "type": "alter", - "name": "Alter View (changing privileges (postgres to PUBLIC))", - "endpoint": "NODE-view.obj_id", - "sql_endpoint": "NODE-view.sql_id", - "msql_endpoint": "NODE-view.msql_id", - "data": { - "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": + } + }, + { + "type": "alter", + "name": "Alter View (changing privileges (postgres to PUBLIC))", + "endpoint": "NODE-view.obj_id", + "sql_endpoint": "NODE-view.sql_id", + "msql_endpoint": "NODE-view.msql_id", + "data": { + "name": "testview_$%{}[]()&*^!@\"'`\\/#", + "owner": "", + "schema": "public", + "check_option": "cascaded", + "security_barrier": true, + "comment": "Testcomment-updated", + "datacl": { + "changed": [ { - "changed":[ + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ { - "grantee":"PUBLIC", - "grantor":"postgres", - "old_grantee": "postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] + "privilege_type": "r", + "privilege": true, + "with_grant": false } ] } - }, - "expected_sql_file": "alter_view_update_priv.sql", - "expected_msql_file": "alter_view_update_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": "postgres", - "schema": "public", - "check_option": "cascaded", - "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": + "expected_sql_file": "alter_view_update_priv.sql", + "expected_msql_file": "alter_view_update_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": "", + "schema": "public", + "check_option": "cascaded", + "security_barrier": true, + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ { - "deleted":[ + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] + "privilege_type": "r", + "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": "postgres", - "schema": "public" + ] } }, - { - "type": "delete", - "name": "Drop Table for view", - "endpoint": "NODE-table.obj_id", - "data": { - "name": "test_view_table", - "owner": "postgres", - "schema": "public" - } + "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": "", + "schema": "public" + } + }, + { + "type": "delete", + "name": "Drop Table for view", + "endpoint": "NODE-table.obj_id", + "data": { + "name": "test_view_table", + "owner": "", + "schema": "public" } - ] - } - \ No newline at end of file + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/alter_mview_no_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/alter_mview_no_depends.sql index a16142a0fc1..b4693da4ca1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/alter_mview_no_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/alter_mview_no_depends.sql @@ -9,7 +9,7 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.msql index c986e30a474..94f4ed4b53d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.msql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.msql @@ -5,7 +5,7 @@ SELECT 1 AS col1 WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.sql index 6b0ad596eda..75487212298 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/create_mview_no_depends.sql @@ -9,7 +9,7 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" DEPENDS ON EXTENSION plpgsql; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/test_mview.json index 05f3415e6f3..b364b449349 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/13_plus/test_mview.json @@ -1,341 +1,345 @@ { - "scenarios": [ - { - "type": "create", - "name": "Create Extension", - "endpoint": "NODE-extension.obj", - "sql_endpoint": "NODE-extension.sql_id", - "data": { - "name": "postgres_fdw", - "version": "", - "relocatable": true - }, - "store_object_id": true + "scenarios": [ + { + "type": "create", + "name": "Create Extension", + "endpoint": "NODE-extension.obj", + "sql_endpoint": "NODE-extension.sql_id", + "data": { + "name": "postgres_fdw", + "version": "", + "relocatable": true }, - { - "type": "create", - "name": "Create Materialised Views with extensions.", - "endpoint": "NODE-mview.obj", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql", - "data": { - "spcname": "pg_default", - "schema": "public", - "owner": "postgres", - "datacl": [], - "seclabels": [], - "name": "testmview_$%{}[]()&*^!/@`#", - "comment": "comment1", - "definition": "SELECT 1 AS col1", - "dependsonextensions": ["plpgsql", "postgres_fdw"] - }, - "expected_sql_file": "create_mview_no_depends.sql", - "expected_msql_file": "create_mview_no_depends.msql" + "store_object_id": true + }, + { + "type": "create", + "name": "Create Materialised Views with extensions.", + "endpoint": "NODE-mview.obj", + "sql_endpoint": "NODE-mview.sql_id", + "msql_endpoint": "NODE-mview.msql", + "data": { + "spcname": "pg_default", + "schema": "public", + "owner": "", + "datacl": [], + "seclabels": [], + "name": "testmview_$%{}[]()&*^!/@`#", + "comment": "comment1", + "definition": "SELECT 1 AS col1", + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ] }, - { - "type": "alter", - "name": "Alter Materialised Views with NO DEPENDS ON", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "dependsonextensions": ["plpgsql"] - }, - "expected_sql_file": "alter_mview_no_depends.sql", - "expected_msql_file": "alter_mview_no_depends.msql" + "expected_sql_file": "create_mview_no_depends.sql", + "expected_msql_file": "create_mview_no_depends.msql" + }, + { + "type": "alter", + "name": "Alter Materialised Views with NO DEPENDS ON", + "endpoint": "NODE-mview.obj_id", + "sql_endpoint": "NODE-mview.sql_id", + "msql_endpoint": "NODE-mview.msql_id", + "data": { + "dependsonextensions": [ + "plpgsql" + ] }, - { - "type": "delete", - "name": "Drop Materialised Views", - "endpoint": "NODE-mview.delete_id", - "data": { - } - }, - { - "type": "delete", - "name": "Drop Extension", - "endpoint": "NODE-extension.delete", - "data": { - "ids": [""] - }, - "preprocess_data": true + "expected_sql_file": "alter_mview_no_depends.sql", + "expected_msql_file": "alter_mview_no_depends.msql" + }, + { + "type": "delete", + "name": "Drop Materialised Views", + "endpoint": "NODE-mview.delete_id", + "data": {} + }, + { + "type": "delete", + "name": "Drop Extension", + "endpoint": "NODE-extension.delete", + "data": { + "ids": [ + "" + ] }, - { - "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", - "schema": "public", - "owner": "postgres", - "datacl": [], - "seclabels": [], - "name": "testmview_$%{}[]()&*^!/@`#", - "comment": "comment1", - "definition": "SELECT 1 AS col1" - }, - "expected_sql_file": "create_mview.sql", - "expected_msql_file": "create_mview_msql.sql" + "preprocess_data": true + }, + { + "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", + "schema": "public", + "owner": "", + "datacl": [], + "seclabels": [], + "name": "testmview_$%{}[]()&*^!/@`#", + "comment": "comment1", + "definition": "SELECT 1 AS col1" }, - { - "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": "postgres", - "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" + "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": "", + "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 + } + ] + } + ] + } }, - { - "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": "postgres", - "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" + "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": "", + "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 + } + ] + } + ] + } }, - { - "type": "alter", - "name": "Alter Materialised Views (change grantee in privileges)", - "endpoint": "NODE-mview.obj_id", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql_id", - "data": { - "datacl": { - "changed": [ - { - "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", - "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_change_grantee_priv.sql", - "expected_msql_file": "alter_mview_change_grantee_priv_msql.sql" + "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 grantee in privileges)", + "endpoint": "NODE-mview.obj_id", + "sql_endpoint": "NODE-mview.sql_id", + "msql_endpoint": "NODE-mview.msql_id", + "data": { + "datacl": { + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "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 + } + ] + } + ] + } }, - { - "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 AS col1;" - }, - "expected_sql_file": "alter_mview_definition.sql", - "expected_msql_file": "alter_mview_definition_msql.sql" + "expected_sql_file": "alter_mview_change_grantee_priv.sql", + "expected_msql_file": "alter_mview_change_grantee_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 AS col1;" }, - { - "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": true - }, - "expected_sql_file": "alter_mview_add_fillfactor.sql", - "expected_msql_file": "alter_mview_add_fillfactor_msql.sql" + "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": true }, - { - "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": "t", - "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" + "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": "t", + "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": "x", + "vacuum_table": { + "changed": [ + { + "name": "autovacuum_analyze_scale_factor", + "value": null + } + ] + } }, - { - "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": "x", - "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" + "expected_sql_file": "alter_mview_remove_table_parameter.sql", + "expected_msql_file": "alter_mview_remove_table_parameter_msql.sql" + }, + { + "type": "create", + "name": "Create Materialised Views with access method", + "endpoint": "NODE-mview.obj", + "sql_endpoint": "NODE-mview.sql_id", + "msql_endpoint": "NODE-mview.msql", + "data": { + "spcname": "pg_default", + "schema": "public", + "owner": "", + "datacl": [], + "seclabels": [], + "name": "testmview_am_$%{}[]()&*^!/@`#", + "comment": "comment1", + "definition": "SELECT 1 AS col1", + "amname": "heap" }, - { - "type": "create", - "name": "Create Materialised Views with access method", - "endpoint": "NODE-mview.obj", - "sql_endpoint": "NODE-mview.sql_id", - "msql_endpoint": "NODE-mview.msql", - "data": { - "spcname": "pg_default", - "schema": "public", - "owner": "postgres", - "datacl": [], - "seclabels": [], - "name": "testmview_am_$%{}[]()&*^!/@`#", - "comment": "comment1", - "definition": "SELECT 1 AS col1", - "amname": "heap" - }, - "expected_msql_file": "create_mview_with_am_msql.sql", - "expected_sql_file": "create_mview_with_am.sql" - - } - ] - } - \ No newline at end of file + "expected_msql_file": "create_mview_with_am_msql.sql", + "expected_sql_file": "create_mview_with_am.sql" + } + ] +} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view.sql index 38dd7f91679..3dab31d2d65 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view.sql @@ -12,8 +12,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_add_some_priv.sql index 17c23f10dc0..bae10168f94 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_add_some_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_add_some_priv.sql @@ -12,9 +12,9 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition.sql index 38dd7f91679..3dab31d2d65 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition.sql @@ -12,8 +12,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition_msql.sql index 26a21ddd7bb..97ef89ddfca 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_definition_msql.sql @@ -6,7 +6,7 @@ CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" SELECT * FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_delete_priv.sql index e203e8ad359..6f57b3c4112 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_delete_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_delete_priv.sql @@ -12,7 +12,7 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_update_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_update_priv.sql index 8fac5ce35c4..948c9acf2b7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_update_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/alter_view_update_priv.sql @@ -12,7 +12,7 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/test_mview.json index 52352f1cf87..ac63312cb0a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/test_mview.json @@ -21,13 +21,16 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_$%{}[]()&*^!/@`#", "comment": "comment1", "definition": "SELECT 1 AS col1", - "dependsonextensions": ["plpgsql", "postgres_fdw"] + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ] }, "expected_sql_file": "create_mview_no_depends.sql", "expected_msql_file": "create_mview_no_depends.msql" @@ -39,7 +42,9 @@ "sql_endpoint": "NODE-mview.sql_id", "msql_endpoint": "NODE-mview.msql_id", "data": { - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "expected_sql_file": "alter_mview_no_depends.sql", "expected_msql_file": "alter_mview_no_depends.msql" @@ -48,15 +53,16 @@ "type": "delete", "name": "Drop Materialised Views", "endpoint": "NODE-mview.delete_id", - "data": { - } - }, + "data": {} + }, { "type": "delete", "name": "Drop Extension", "endpoint": "NODE-extension.delete", "data": { - "ids": [""] + "ids": [ + "" + ] }, "preprocess_data": true }, @@ -69,7 +75,7 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_$%{}[]()&*^!/@`#", @@ -90,7 +96,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -146,7 +152,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -202,8 +208,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "a", @@ -324,7 +330,7 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_am_$%{}[]()&*^!/@`#", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/tests.json index aae4702db6d..534503f9ebb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/15_plus/tests.json @@ -27,14 +27,26 @@ "data": { "definition": "select col1 from test_view_table;", "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "local", "security_barrier": false, "security_invoker": false, - "comment":"Testcomment", - "datacl":[{"grantee":"postgres", "old_grantee": "postgres", "grantor":"postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] + "comment": "Testcomment", + "datacl": [ + { + "grantee": "", + "old_grantee": "", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_view.sql", "expected_msql_file": "create_view_msql.sql" @@ -47,14 +59,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, "security_invoker": true, - "comment":"Testcomment-updated", - "datacl":[{"grantee":"postgres", "grantor":"postgres", "old_grantee": "postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] + "comment": "Testcomment-updated", + "datacl": [ + { + "grantee": "", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "alter_view.sql", "expected_msql_file": "alter_view_msql.sql" @@ -79,25 +103,25 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":{ - "added":[ + "comment": "Testcomment-updated", + "datacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] + "privilege_type": "r", + "privilege": true, + "with_grant": false } - ] + ] + } + ] } }, "expected_sql_file": "alter_view_add_some_priv.sql", @@ -111,27 +135,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } } }, { @@ -142,28 +165,27 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "changed":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "old_grantee": "postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_view_update_priv.sql", "expected_msql_file": "alter_view_update_priv_msql.sql" @@ -176,27 +198,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_view_delete_priv.sql", "expected_msql_file": "alter_view_delete_priv_msql.sql" @@ -207,7 +228,7 @@ "endpoint": "NODE-view.obj_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public" } }, @@ -217,7 +238,7 @@ "endpoint": "NODE-table.obj_id", "data": { "name": "test_view_table", - "owner": "postgres", + "owner": "", "schema": "public" } } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view.sql index f457970c801..90490f974a7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view.sql @@ -12,8 +12,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_add_some_priv.sql index d082512d257..3c1a481d346 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_add_some_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_add_some_priv.sql @@ -12,9 +12,9 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_definition.sql index f457970c801..90490f974a7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_definition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_definition.sql @@ -12,8 +12,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_delete_priv.sql index 71259e42fba..f81db5211a1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_delete_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_delete_priv.sql @@ -12,7 +12,7 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_update_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_update_priv.sql index 8b5aa69b5d9..20b948a8da4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_update_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/alter_view_update_priv.sql @@ -12,7 +12,7 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/create_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/create_view.sql index b5806dcc037..abe6f22680e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/create_view.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/create_view.sql @@ -10,8 +10,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/test_mview.json index 52352f1cf87..ac63312cb0a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/test_mview.json @@ -21,13 +21,16 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_$%{}[]()&*^!/@`#", "comment": "comment1", "definition": "SELECT 1 AS col1", - "dependsonextensions": ["plpgsql", "postgres_fdw"] + "dependsonextensions": [ + "plpgsql", + "postgres_fdw" + ] }, "expected_sql_file": "create_mview_no_depends.sql", "expected_msql_file": "create_mview_no_depends.msql" @@ -39,7 +42,9 @@ "sql_endpoint": "NODE-mview.sql_id", "msql_endpoint": "NODE-mview.msql_id", "data": { - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "expected_sql_file": "alter_mview_no_depends.sql", "expected_msql_file": "alter_mview_no_depends.msql" @@ -48,15 +53,16 @@ "type": "delete", "name": "Drop Materialised Views", "endpoint": "NODE-mview.delete_id", - "data": { - } - }, + "data": {} + }, { "type": "delete", "name": "Drop Extension", "endpoint": "NODE-extension.delete", "data": { - "ids": [""] + "ids": [ + "" + ] }, "preprocess_data": true }, @@ -69,7 +75,7 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_$%{}[]()&*^!/@`#", @@ -90,7 +96,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -146,7 +152,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -202,8 +208,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "a", @@ -324,7 +330,7 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_am_$%{}[]()&*^!/@`#", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/tests.json index aae4702db6d..534503f9ebb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/16_plus/tests.json @@ -27,14 +27,26 @@ "data": { "definition": "select col1 from test_view_table;", "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "local", "security_barrier": false, "security_invoker": false, - "comment":"Testcomment", - "datacl":[{"grantee":"postgres", "old_grantee": "postgres", "grantor":"postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] + "comment": "Testcomment", + "datacl": [ + { + "grantee": "", + "old_grantee": "", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_view.sql", "expected_msql_file": "create_view_msql.sql" @@ -47,14 +59,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, "security_invoker": true, - "comment":"Testcomment-updated", - "datacl":[{"grantee":"postgres", "grantor":"postgres", "old_grantee": "postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] + "comment": "Testcomment-updated", + "datacl": [ + { + "grantee": "", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "alter_view.sql", "expected_msql_file": "alter_view_msql.sql" @@ -79,25 +103,25 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":{ - "added":[ + "comment": "Testcomment-updated", + "datacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] + "privilege_type": "r", + "privilege": true, + "with_grant": false } - ] + ] + } + ] } }, "expected_sql_file": "alter_view_add_some_priv.sql", @@ -111,27 +135,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } } }, { @@ -142,28 +165,27 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "changed":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "old_grantee": "postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_view_update_priv.sql", "expected_msql_file": "alter_view_update_priv_msql.sql" @@ -176,27 +198,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_view_delete_priv.sql", "expected_msql_file": "alter_view_delete_priv_msql.sql" @@ -207,7 +228,7 @@ "endpoint": "NODE-view.obj_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public" } }, @@ -217,7 +238,7 @@ "endpoint": "NODE-table.obj_id", "data": { "name": "test_view_table", - "owner": "postgres", + "owner": "", "schema": "public" } } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview.sql index ca5a3bc1dda..a2656f7ddb0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview.sql @@ -9,10 +9,10 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO PUBLIC; -GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO postgres; +GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_fillfactor.sql index c180c1b601a..2a22dcc0865 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_fillfactor.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_fillfactor.sql @@ -12,7 +12,7 @@ AS WITH DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_table_parameter.sql index 3b7b0f3e388..e5258f7713b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_table_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_add_table_parameter.sql @@ -14,7 +14,7 @@ AS WITH DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv.sql index 0ce2ba73f5f..1eb21410512 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv.sql @@ -9,7 +9,7 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv_msql.sql index 7e7a5ae5342..271d8ce49e8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_change_grantee_priv_msql.sql @@ -1,2 +1,2 @@ -REVOKE ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" FROM postgres; +REVOKE ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" FROM ; GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition.sql index ae644bea1f0..03361c146e8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition.sql @@ -9,7 +9,7 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition_msql.sql index 22a19b40895..97116cc7890 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_definition_msql.sql @@ -5,7 +5,7 @@ SELECT 12 AS col1 WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_drop_all_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_drop_all_priv.sql index d3402a81770..bcf14c5d968 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_drop_all_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_drop_all_priv.sql @@ -9,9 +9,9 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; -GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO postgres; +GRANT ALL ON TABLE public."testmview_$%{}[]()&*^!/@`#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_remove_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_remove_table_parameter.sql index c180c1b601a..2a22dcc0865 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_remove_table_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_mview_remove_table_parameter.sql @@ -12,7 +12,7 @@ AS WITH DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view.sql index b3b83cd0d82..a39a0a64d48 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view.sql @@ -11,8 +11,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_add_some_priv.sql index b5835cf5ac5..d51e89b72bc 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_add_some_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_add_some_priv.sql @@ -11,9 +11,9 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition.sql index b3b83cd0d82..a39a0a64d48 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition.sql @@ -11,8 +11,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition_msql.sql index a0d45d9a70a..973657e924c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_definition_msql.sql @@ -6,7 +6,7 @@ CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#" SELECT * FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_delete_priv.sql index 09f1e9dfbbf..00b0d3032d5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_delete_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_delete_priv.sql @@ -11,7 +11,7 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv.sql index 8165dd5a800..68d20f8fad5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv.sql @@ -11,7 +11,7 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment-updated'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv_msql.sql index 53d6a907126..d23df3da91a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/alter_view_update_priv_msql.sql @@ -1,2 +1,2 @@ -REVOKE ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" FROM postgres; +REVOKE ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" FROM ; GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview.sql index 9d9290a3946..9c594126922 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview.sql @@ -9,7 +9,7 @@ AS WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview_msql.sql index e558dd48781..1f1d97c7389 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_mview_msql.sql @@ -5,7 +5,7 @@ SELECT 1 AS col1 WITH NO DATA; ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#" - OWNER TO postgres; + OWNER TO ; COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" IS 'comment1'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view.sql index 655ee374dfc..19d492162b1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view.sql @@ -10,8 +10,8 @@ WITH ( FROM test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment'; -GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view_msql.sql index 027b1b15c98..ef53961b35e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/create_view_msql.sql @@ -5,8 +5,8 @@ WITH ( select col1 from test_view_table; ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#" - OWNER TO postgres; + OWNER TO ; COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#" IS 'Testcomment'; -GRANT INSERT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres; +GRANT INSERT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/test_mview.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/test_mview.json index 1feb2d1a5c4..6abd567dfbd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/test_mview.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/test_mview.json @@ -9,7 +9,7 @@ "data": { "spcname": "pg_default", "schema": "public", - "owner": "postgres", + "owner": "", "datacl": [], "seclabels": [], "name": "testmview_$%{}[]()&*^!/@`#", @@ -30,7 +30,7 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -86,7 +86,7 @@ "deleted": [ { "grantee": "PUBLIC", - "grantor": "postgres", + "grantor": "", "privileges": [ { "privilege_type": "a", @@ -142,8 +142,8 @@ "changed": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "a", diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/tests.json index fb185dfe34e..83395eb5c8f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/tests.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/default/tests.json @@ -27,13 +27,25 @@ "data": { "definition": "select col1 from test_view_table;", "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "local", "security_barrier": false, - "comment":"Testcomment", - "datacl":[{"grantee":"postgres", "old_grantee": "postgres", "grantor":"postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] + "comment": "Testcomment", + "datacl": [ + { + "grantee": "", + "old_grantee": "", + "grantor": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_view.sql", "expected_msql_file": "create_view_msql.sql" @@ -46,13 +58,25 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":[{"grantee":"postgres", "grantor":"postgres", "old_grantee": "postgres", "privileges":[{"privilege_type": "a", "privilege": true, - "with_grant":false}]}] + "comment": "Testcomment-updated", + "datacl": [ + { + "grantee": "", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "alter_view.sql", "expected_msql_file": "alter_view_msql.sql" @@ -77,25 +101,25 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl":{ - "added":[ + "comment": "Testcomment-updated", + "datacl": { + "added": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] + "privilege_type": "r", + "privilege": true, + "with_grant": false } - ] + ] + } + ] } }, "expected_sql_file": "alter_view_add_some_priv.sql", @@ -109,27 +133,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } } }, { @@ -140,28 +163,27 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "changed":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "old_grantee": "postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "changed": [ + { + "grantee": "PUBLIC", + "grantor": "", + "old_grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_view_update_priv.sql", "expected_msql_file": "alter_view_update_priv_msql.sql" @@ -174,27 +196,26 @@ "msql_endpoint": "NODE-view.msql_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public", "check_option": "cascaded", "security_barrier": true, - "comment":"Testcomment-updated", - "datacl": - { - "deleted":[ - { - "grantee":"PUBLIC", - "grantor":"postgres", - "privileges":[ - { - "privilege_type":"r", - "privilege":true, - "with_grant":false - } - ] - } - ] - } + "comment": "Testcomment-updated", + "datacl": { + "deleted": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ] + } + ] + } }, "expected_sql_file": "alter_view_delete_priv.sql", "expected_msql_file": "alter_view_delete_priv_msql.sql" @@ -205,7 +226,7 @@ "endpoint": "NODE-view.obj_id", "data": { "name": "testview_$%{}[]()&*^!@\"'`\\/#", - "owner": "postgres", + "owner": "", "schema": "public" } }, @@ -215,7 +236,7 @@ "endpoint": "NODE-table.obj_id", "data": { "name": "test_view_table", - "owner": "postgres", + "owner": "", "schema": "public" } } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json index 015bce58767..aa4a7a5d611 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json @@ -89,7 +89,9 @@ "seclabels": [], "name": "test_mview_add_", "definition": "SELECT 'test_pgadmin';", - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "mocking_required": false, "mock_data": {}, @@ -1026,8 +1028,8 @@ "added": [ { "grantee": "PUBLIC", - "grantor": "postgres", - "old_grantee": "postgres", + "grantor": "", + "old_grantee": "", "privileges": [ { "privilege_type": "a", @@ -1056,7 +1058,9 @@ }, "test_data": { "comment": "This is test comment", - "dependsonextensions": ["plpgsql"] + "dependsonextensions": [ + "plpgsql" + ] }, "mocking_required": false, "mock_data": {}, @@ -1076,7 +1080,6 @@ "test_data": { "comment": "This is test comment", "definition": "select 1" - }, "mocking_required": false, "mock_data": {}, diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/14_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/14_plus/test.json index b3130fa0a27..8ae70293150 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/14_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/14_plus/test.json @@ -7,50 +7,51 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", "data": { - "username": "postgres", - "name": "test_create_subscription", - "connect": false, - "connect_timeout": 10, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5434, - "password": "edb", - "sync": "remote_apply", - "binary": true, - "streaming": true, - "sslmode": "prefer", - "pub": ["test_pub"] + "username": "postgres", + "name": "test_create_subscription", + "connect": false, + "connect_timeout": 10, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5434, + "password": "edb", + "sync": "remote_apply", + "binary": true, + "streaming": true, + "sslmode": "prefer", + "pub": [ + "test_pub" + ] }, "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" + }, + { + "type": "alter", + "name": "Alter parameters of subscription", + "endpoint": "NODE-subscription.obj_id", + "sql_endpoint": "NODE-subscription.sql_id", + "msql_endpoint": "NODE-subscription.msql_id", + "data": { + "binary": false, + "streaming": false + }, + "expected_sql_file": "alter_parameters.sql", + "expected_msql_file": "alter_parameters_msql.sql" + }, + { + "type": "delete", + "name": "Drop subscription", + "endpoint": "NODE-subscription.delete_id", + "data": { + "name": "test_create_subscription" + } } - , -{ - "type": "alter", - "name": "Alter parameters of subscription", - "endpoint": "NODE-subscription.obj_id", - "sql_endpoint": "NODE-subscription.sql_id", - "msql_endpoint": "NODE-subscription.msql_id", - "data": { - "binary": false, - "streaming": false - }, - "expected_sql_file": "alter_parameters.sql", - "expected_msql_file": "alter_parameters_msql.sql" -}, -{ - "type": "delete", - "name": "Drop subscription", - "endpoint": "NODE-subscription.delete_id", - "data": { - "name": "test_create_subscription" - } -} ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/15_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/15_plus/test.json index a395070b36e..7bf976830bd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/15_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/15_plus/test.json @@ -7,27 +7,29 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", "data": { - "username": "postgres", - "name": "test_create_subscription", - "connect": false, - "connect_timeout": 10, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5434, - "password": "edb", - "sync": "remote_apply", - "binary": true, - "streaming": true, - "disable_on_error": true, - "two_phase": true, - "sslmode": "prefer", - "pub": ["test_pub"] + "username": "postgres", + "name": "test_create_subscription", + "connect": false, + "connect_timeout": 10, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5434, + "password": "edb", + "sync": "remote_apply", + "binary": true, + "streaming": true, + "disable_on_error": true, + "two_phase": true, + "sslmode": "prefer", + "pub": [ + "test_pub" + ] }, "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" @@ -39,10 +41,10 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql_id", "data": { - "sync": "off", - "binary": false, - "streaming": false, - "disable_on_error": false + "sync": "off", + "binary": false, + "streaming": false, + "disable_on_error": false }, "expected_sql_file": "alter_parameters.sql", "expected_msql_file": "alter_parameters_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json index 80dfbea46c8..5c042066cd6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json @@ -7,30 +7,32 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", "data": { - "username": "postgres", - "name": "test_create_subscription", - "connect": false, - "connect_timeout": 10, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5434, - "password": "edb", - "sync": "remote_apply", - "binary": true, - "streaming": "on", - "disable_on_error": true, - "two_phase": true, - "password_required": true, - "run_as_owner": true, - "origin": "any", - "sslmode": "prefer", - "pub": ["test_pub"] + "username": "postgres", + "name": "test_create_subscription", + "connect": false, + "connect_timeout": 10, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5434, + "password": "edb", + "sync": "remote_apply", + "binary": true, + "streaming": "on", + "disable_on_error": true, + "two_phase": true, + "password_required": true, + "run_as_owner": true, + "origin": "any", + "sslmode": "prefer", + "pub": [ + "test_pub" + ] }, "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" @@ -42,11 +44,11 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql_id", "data": { - "sync": "off", - "binary": false, - "streaming": "parallel", - "disable_on_error": false, - "origin": "none" + "sync": "off", + "binary": false, + "streaming": "parallel", + "disable_on_error": false, + "origin": "none" }, "expected_sql_file": "alter_parameters.sql", "expected_msql_file": "alter_parameters_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json index f1fe0a31141..8e75ea7f0b6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json @@ -40,13 +40,15 @@ "evnt_update": true, "evnt_delete": true, "evnt_truncate": true, - "pubowner": "postgres", + "pubowner": "", "publish_via_partition_root": false, "all_table": false, "only_table": false, - "pubtable": [{ - "table_name": "public.test_table" - }], + "pubtable": [ + { + "table_name": "public.test_table" + } + ], "pubschema": "" } }, @@ -57,31 +59,33 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", "data": { - "name": "test_create_subscription", - "subowner": "postgres", - "host": "localhost", - "port": 5434, - "db": "postgres", - "username": "postgres", - "password": "postgres", - "connect_timeout": 10, - "pub": ["test_publication"], - "sslmode": "prefer", - "copy_data": false, - "create_slot": false, - "enabled": false, - "connect": false, - "slot_name": "test_create_subscription", - "sync": "remote_apply", - "streaming": "on", - "binary": true, - "two_phase": true, - "disable_on_error": true, - "run_as_owner": true, - "password_required": true, - "origin": "any", - "service": "", - "failover": false + "name": "test_create_subscription", + "subowner": "", + "host": "localhost", + "port": 5434, + "db": "postgres", + "username": "postgres", + "password": "postgres", + "connect_timeout": 10, + "pub": [ + "test_publication" + ], + "sslmode": "prefer", + "copy_data": false, + "create_slot": false, + "enabled": false, + "connect": false, + "slot_name": "test_create_subscription", + "sync": "remote_apply", + "streaming": "on", + "binary": true, + "two_phase": true, + "disable_on_error": true, + "run_as_owner": true, + "password_required": true, + "origin": "any", + "service": "", + "failover": false }, "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json index 602ab8ccd3d..9f9dadf42fa 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json @@ -7,31 +7,33 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", "data": { - "name": "test_create_subscription", - "subowner": "postgres", - "host": "localhost", - "port": 5434, - "db": "postgres", - "username": "postgres", - "password": "edb", - "connect_timeout": 10, - "pub": ["test_publication"], - "sslmode": "prefer", - "copy_data": false, - "create_slot": false, - "enabled": false, - "connect": false, - "slot_name": "test_create_subscription", - "sync": "remote_apply", - "streaming": "on", - "binary": true, - "two_phase": false, - "disable_on_error": true, - "run_as_owner": true, - "password_required": true, - "origin": "any", - "service": "", - "failover": false + "name": "test_create_subscription", + "subowner": "", + "host": "localhost", + "port": 5434, + "db": "postgres", + "username": "postgres", + "password": "edb", + "connect_timeout": 10, + "pub": [ + "test_publication" + ], + "sslmode": "prefer", + "copy_data": false, + "create_slot": false, + "enabled": false, + "connect": false, + "slot_name": "test_create_subscription", + "sync": "remote_apply", + "streaming": "on", + "binary": true, + "two_phase": false, + "disable_on_error": true, + "run_as_owner": true, + "password_required": true, + "origin": "any", + "service": "", + "failover": false }, "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/default/test.json index ff907db37fc..7c3aa132064 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/default/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/default/test.json @@ -7,23 +7,25 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", "data": { - "username": "postgres", - "name": "test_create_subscription", - "connect": false, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5432, - "password": "edb", - "sync": "off", - "connect_timeout": 10, - "sslmode": "prefer", - "pub": ["sample__1"] + "username": "postgres", + "name": "test_create_subscription", + "connect": false, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5432, + "password": "edb", + "sync": "off", + "connect_timeout": 10, + "sslmode": "prefer", + "pub": [ + "sample__1" + ] }, "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" @@ -35,7 +37,7 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql_id", "data": { - "name": "test_alter_subscription" + "name": "test_alter_subscription" }, "expected_sql_file": "alter_subscription.sql", "expected_msql_file": "alter_subscription_msql.sql" @@ -47,12 +49,11 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql_id", "data": { - "sync": "remote_apply" + "sync": "remote_apply" }, "expected_sql_file": "alter_sync.sql", "expected_msql_file": "alter_sync_msql.sql" }, - { "type": "alter", "name": "Alter maintainance DB in connection string of subscription", @@ -60,7 +61,7 @@ "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql_id", "data": { - "db": "edb" + "db": "edb" }, "expected_sql_file": "alter_maintenance_db.sql", "expected_msql_file": "alter_maintenance_db_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/subscription_test_data.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/subscription_test_data.json index 7dc9178d91e..04daeec76f4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/subscription_test_data.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/subscription_test_data.json @@ -5,29 +5,31 @@ "url": "/browser/subscription/obj/", "is_positive_test": true, "test_data": { - "username": "postgres", - "name": "PLACEHOLDER", - "connect": false, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5432, - "password": "", - "sync": "off", - "binary":false, - "two_phase":false, - "disable_on_error":false, - "streaming":false, - "password_required":true, - "run_as_owner":false, - "failover": false, - "origin":"any", - "pub": ["sample__1"] + "username": "postgres", + "name": "PLACEHOLDER", + "connect": false, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5432, + "password": "", + "sync": "off", + "binary": false, + "two_phase": false, + "disable_on_error": false, + "streaming": false, + "password_required": true, + "run_as_owner": false, + "failover": false, + "origin": "any", + "pub": [ + "sample__1" + ] }, "mocking_required": false, "mock_data": {}, @@ -41,28 +43,30 @@ "is_positive_test": false, "without_name": true, "test_data": { - "username": "postgres", - "name": "PLACEHOLDER", - "connect": false, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5432, - "password": "", - "sync": "off", - "binary":false, - "two_phase":false, - "disable_on_error":false, - "streaming":false, - "password_required":true, - "run_as_owner":false, - "origin":"any", - "pub": ["sample__1"] + "username": "postgres", + "name": "PLACEHOLDER", + "connect": false, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5432, + "password": "", + "sync": "off", + "binary": false, + "two_phase": false, + "disable_on_error": false, + "streaming": false, + "password_required": true, + "run_as_owner": false, + "origin": "any", + "pub": [ + "sample__1" + ] }, "mocking_required": false, "mock_data": {}, @@ -76,28 +80,30 @@ "is_positive_test": false, "error_creating_subscription": true, "test_data": { - "username": "postgres", - "name": "PLACEHOLDER", - "connect": false, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5432, - "password": "", - "sync": "off", - "binary":false, - "two_phase":false, - "disable_on_error":false, - "streaming":false, - "password_required":true, - "run_as_owner":false, - "origin":"any", - "pub": ["sample__1"] + "username": "postgres", + "name": "PLACEHOLDER", + "connect": false, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5432, + "password": "", + "sync": "off", + "binary": false, + "two_phase": false, + "disable_on_error": false, + "streaming": false, + "password_required": true, + "run_as_owner": false, + "origin": "any", + "pub": [ + "sample__1" + ] }, "mocking_required": true, "mock_data": { @@ -113,28 +119,30 @@ "url": "/browser/subscription/obj/", "is_positive_test": false, "test_data": { - "username": "postgres", - "name": "PLACEHOLDER", - "connect": false, - "copy_data": false, - "create_slot": false, - "db": "postgres", - "subowner": "postgres", - "enabled": false, - "host": "localhost", - "slot_name": "None", - "service": "", - "port": 5432, - "password": "", - "sync": "off", - "binary":false, - "two_phase":false, - "disable_on_error":false, - "streaming":false, - "password_required":true, - "run_as_owner":false, - "origin":"any", - "pub": ["sample__1"] + "username": "postgres", + "name": "PLACEHOLDER", + "connect": false, + "copy_data": false, + "create_slot": false, + "db": "postgres", + "subowner": "", + "enabled": false, + "host": "localhost", + "slot_name": "None", + "service": "", + "port": 5432, + "password": "", + "sync": "off", + "binary": false, + "two_phase": false, + "disable_on_error": false, + "streaming": false, + "password_required": true, + "run_as_owner": false, + "origin": "any", + "pub": [ + "sample__1" + ] }, "mocking_required": true, "mock_data": { @@ -383,8 +391,7 @@ "url": "/browser/subscription/sql/", "is_positive_test": true, "mocking_required": false, - "mock_data": { - }, + "mock_data": {}, "expected_data": { "status_code": 200 } diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_add_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_add_all.sql index 886b20e21d9..ccf691b66dd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_add_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_add_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,14 +13,14 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE, INSERT, UPDATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, UPDATE ON SEQUENCES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_all.sql index ef6a1129b78..f0a725ff7a7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = 'C' LC_CTYPE = 'C' @@ -13,16 +13,16 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT TRUNCATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE ON TABLES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT UPDATE ON SEQUENCES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_function.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_function.sql index f0300a2959e..f279c71fd98 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_function.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_function.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,4 +13,4 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_newuser_reset_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_newuser_reset_all.sql index 87745cf9478..bdb48f9569e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_newuser_reset_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_newuser_reset_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_reset_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_reset_all.sql index 87745cf9478..bdb48f9569e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_reset_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_reset_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_sequences.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_sequences.sql index 85934e9ac14..ea9c689a3f5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_sequences.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_sequences.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,11 +13,11 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, USAGE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_tables.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_tables.sql index e1d23496312..a5ceeef2f89 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_tables.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_tables.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,9 +13,9 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_types.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_types.sql index 3d0f6de5374..719e55dba50 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_types.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/alter_default_db_privileges_types.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,13 +13,13 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, USAGE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE USAGE ON TYPES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE USAGE ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu.sql index d7ee32c2827..0569fc8fdcf 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu.sql @@ -4,7 +4,7 @@ CREATE DATABASE "test_database_icu_$%{}[]()&*^!@""""""""'`\/#" WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu_msql.sql index de655f7625a..0865621acf0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_icu_msql.sql @@ -6,10 +6,10 @@ CREATE DATABASE "test_database_icu_$%{}[]()&*^!@""""""""'`\/#" LOCALE_PROVIDER = 'icu' IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE USAGE ON TYPES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE USAGE ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc.sql index dbf85c3a3aa..3bb2beb79ae 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc.sql @@ -4,7 +4,7 @@ CREATE DATABASE "test_database_$%{}[]()&*^!@""""""""'`\/#" WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc_msql.sql index d7dcb7603cc..e3606de7f17 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/create_database_new_options_libc_msql.sql @@ -3,10 +3,10 @@ CREATE DATABASE "test_database_$%{}[]()&*^!@""""""""'`\/#" ENCODING = 'UTF8' IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE USAGE ON TYPES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE USAGE ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/test_database.json b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/test_database.json index 12a578039ba..24ba2be2955 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/test_database.json +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/15_plus/test_database.json @@ -12,7 +12,7 @@ "deffuncacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -41,11 +41,19 @@ "deftblacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ - {"privilege_type":"D","privilege":true,"with_grant":false}, - {"privilege_type":"w","privilege":true,"with_grant":false} + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } ], "acltype": "deftblacl" } @@ -60,7 +68,7 @@ "with_grant": false } ], - "grantor": "postgres" + "grantor": "" } ] } @@ -80,8 +88,8 @@ "defseqacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ { "privilege_type": "w", @@ -92,11 +100,41 @@ "acltype": "defaultacls" } ], - "added":[ - {"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}, - {"privilege_type":"r","privilege":true,"with_grant":false}],"grantor":"postgres"}] + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, - "deftblacl": {"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deftblacl": { + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } }, "expected_msql_file": "alter_default_db_privileges_sequences_msql.sql", "expected_sql_file": "alter_default_db_privileges_sequences.sql" @@ -113,7 +151,7 @@ "deftypeacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -126,7 +164,6 @@ } ] } - }, "expected_msql_file": "alter_default_db_privileges_types_msql.sql", "expected_sql_file": "alter_default_db_privileges_types.sql" @@ -139,11 +176,170 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"postgres","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}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","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}],"acltype":"defaultacls"}]}, - "defseqacl":{"added":[{"grantee":"postgres","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deffuncacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "", + "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 + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "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 + } + ], + "acltype": "defaultacls" + } + ] }, + "defseqacl": { + "added": [ + { + "grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_reset_all.sql" }, { @@ -155,11 +351,82 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"d","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "defseqacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}]} + "deffuncacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, + "deftypeacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "defseqacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_add_msql.sql", "expected_sql_file": "alter_default_db_privileges_add_all.sql", "pre_scenario_sql": "CREATE ROLE test_default_priv_user WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS;" @@ -173,16 +440,106 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}], "grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_all_msql.sql", "expected_sql_file": "alter_default_db_privileges_all.sql" }, @@ -195,13 +552,72 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}, {"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_newuser_reset_all.sql", "post_scenario_sql": "DROP ROLE IF EXISTS test_default_priv_user;" }, @@ -218,88 +634,117 @@ "is_template": false, "encoding": "UTF8", "schema_res": [], - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_new_options_libc.sql", "expected_msql_file": "create_database_new_options_libc_msql.sql" @@ -328,88 +773,117 @@ "schema_res": [], "datlocaleprovider": "icu", "daticulocale": "en-US", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_icu.sql", "expected_msql_file": "create_database_icu_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules.sql index d5889bf0d00..24d2452aa19 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules.sql @@ -4,7 +4,7 @@ CREATE DATABASE "test_database_icu_rules_$%{}[]()&*^!@""""""""'`\/#" WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules_msql.sql index f60a44ee4d8..06eb2d43e70 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/create_database_icu_rules_msql.sql @@ -7,10 +7,10 @@ CREATE DATABASE "test_database_icu_rules_$%{}[]()&*^!@""""""""'`\/#" LOCALE_PROVIDER = 'icu' IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE USAGE ON TYPES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE USAGE ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/test_database.json b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/test_database.json index 1eee94b0e08..eed26cd1ce8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/test_database.json +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/16_plus/test_database.json @@ -12,7 +12,7 @@ "deffuncacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -41,11 +41,19 @@ "deftblacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ - {"privilege_type":"D","privilege":true,"with_grant":false}, - {"privilege_type":"w","privilege":true,"with_grant":false} + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } ], "acltype": "deftblacl" } @@ -60,7 +68,7 @@ "with_grant": false } ], - "grantor": "postgres" + "grantor": "" } ] } @@ -80,8 +88,8 @@ "defseqacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ { "privilege_type": "w", @@ -92,11 +100,41 @@ "acltype": "defaultacls" } ], - "added":[ - {"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}, - {"privilege_type":"r","privilege":true,"with_grant":false}],"grantor":"postgres"}] + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, - "deftblacl": {"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deftblacl": { + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } }, "expected_msql_file": "alter_default_db_privileges_sequences_msql.sql", "expected_sql_file": "alter_default_db_privileges_sequences.sql" @@ -113,7 +151,7 @@ "deftypeacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -126,7 +164,6 @@ } ] } - }, "expected_msql_file": "alter_default_db_privileges_types_msql.sql", "expected_sql_file": "alter_default_db_privileges_types.sql" @@ -139,11 +176,170 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"postgres","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}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","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}],"acltype":"defaultacls"}]}, - "defseqacl":{"added":[{"grantee":"postgres","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deffuncacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "", + "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 + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "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 + } + ], + "acltype": "defaultacls" + } + ] }, + "defseqacl": { + "added": [ + { + "grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_reset_all.sql" }, { @@ -155,11 +351,82 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"d","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "defseqacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}]} + "deffuncacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, + "deftypeacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "defseqacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_add_msql.sql", "expected_sql_file": "alter_default_db_privileges_add_all.sql", "pre_scenario_sql": "CREATE ROLE test_default_priv_user WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS;" @@ -173,16 +440,106 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}], "grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_all_msql.sql", "expected_sql_file": "alter_default_db_privileges_all.sql" }, @@ -195,13 +552,72 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}, {"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_newuser_reset_all.sql", "post_scenario_sql": "DROP ROLE IF EXISTS test_default_priv_user;" }, @@ -218,88 +634,117 @@ "is_template": false, "encoding": "UTF8", "schema_res": [], - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_new_options_libc.sql", "expected_msql_file": "create_database_new_options_libc_msql.sql" @@ -328,88 +773,117 @@ "schema_res": [], "datlocaleprovider": "icu", "daticulocale": "en-US", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_icu.sql", "expected_msql_file": "create_database_icu_msql.sql" @@ -439,88 +913,117 @@ "datlocaleprovider": "icu", "daticulocale": "und", "daticurules": "&V << w <<< W", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_icu_rules.sql", "expected_msql_file": "create_database_icu_rules_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_all.sql index 63ee525eec8..8f9c53c6779 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,19 +13,19 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres -GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE +GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE, MAINTAIN, UPDATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, UPDATE ON SEQUENCES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_msql.sql index 0d96053166a..78a5ae407ac 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_add_msql.sql @@ -1,12 +1,12 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE, MAINTAIN, UPDATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, UPDATE ON SEQUENCES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all.sql index d006ba0daf9..0021b4da0e3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = 'C' LC_CTYPE = 'C' @@ -13,21 +13,21 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres -GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE +GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT TRUNCATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT MAINTAIN ON TABLES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT UPDATE ON SEQUENCES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all_msql.sql index 08264a9636b..82f5c456279 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_all_msql.sql @@ -1,27 +1,27 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON FUNCTIONS FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT MAINTAIN ON TABLES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT TRUNCATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT UPDATE ON SEQUENCES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TYPES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_newuser_reset_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_newuser_reset_all.sql index b16d8caf522..71fdc01eaf1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_newuser_reset_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_newuser_reset_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,7 +13,7 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres -GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE +GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_reset_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_reset_all.sql index b16d8caf522..71fdc01eaf1 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_reset_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/alter_default_db_privileges_reset_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -13,7 +13,7 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres -GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE +GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLES TO ; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin.sql index beef0a2e32b..1bb25e8fd93 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin.sql @@ -4,7 +4,7 @@ CREATE DATABASE "test_database_builtin_$%{}[]()&*^!@""""""""'`\/#" WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin_msql.sql index fb7fdc549f0..7fe782c81c2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/create_database_builtin_msql.sql @@ -6,10 +6,10 @@ CREATE DATABASE "test_database_builtin_$%{}[]()&*^!@""""""""'`\/#" LOCALE_PROVIDER = 'builtin' IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE USAGE ON TYPES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE USAGE ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/test_database.json b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/test_database.json index 7e36723ecec..174b8afc0d5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/test_database.json +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/17_plus/test_database.json @@ -12,7 +12,7 @@ "deffuncacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -41,11 +41,19 @@ "deftblacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ - {"privilege_type":"D","privilege":true,"with_grant":false}, - {"privilege_type":"w","privilege":true,"with_grant":false} + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } ], "acltype": "deftblacl" } @@ -60,7 +68,7 @@ "with_grant": false } ], - "grantor": "postgres" + "grantor": "" } ] } @@ -80,8 +88,8 @@ "defseqacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ { "privilege_type": "w", @@ -92,11 +100,41 @@ "acltype": "defaultacls" } ], - "added":[ - {"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}, - {"privilege_type":"r","privilege":true,"with_grant":false}],"grantor":"postgres"}] + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, - "deftblacl": {"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deftblacl": { + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } }, "expected_msql_file": "alter_default_db_privileges_sequences_msql.sql", "expected_sql_file": "alter_default_db_privileges_sequences.sql" @@ -113,7 +151,7 @@ "deftypeacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -126,7 +164,6 @@ } ] } - }, "expected_msql_file": "alter_default_db_privileges_types_msql.sql", "expected_sql_file": "alter_default_db_privileges_types.sql" @@ -139,11 +176,170 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"postgres","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}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","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}],"acltype":"defaultacls"}]}, - "defseqacl":{"added":[{"grantee":"postgres","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deffuncacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "", + "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 + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "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 + } + ], + "acltype": "defaultacls" + } + ] }, + "defseqacl": { + "added": [ + { + "grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_reset_all.sql" }, { @@ -155,11 +351,82 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"m","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"d","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "defseqacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}]} + "deffuncacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, + "deftypeacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "defseqacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_add_msql.sql", "expected_sql_file": "alter_default_db_privileges_add_all.sql", "pre_scenario_sql": "CREATE ROLE test_default_priv_user WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS;" @@ -173,16 +440,106 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"m","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}], "grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "m", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_all_msql.sql", "expected_sql_file": "alter_default_db_privileges_all.sql" }, @@ -195,13 +552,72 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}, {"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_newuser_reset_all.sql", "post_scenario_sql": "DROP ROLE IF EXISTS test_default_priv_user;" }, @@ -218,92 +634,122 @@ "is_template": false, "encoding": "UTF8", "schema_res": [], - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }, { - "privilege_type": "m", - "privilege": true, - "with_grant": false - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + }, + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_new_options_libc.sql", "expected_msql_file": "create_database_new_options_libc_msql.sql" @@ -332,92 +778,122 @@ "schema_res": [], "datlocaleprovider": "icu", "daticulocale": "en-US", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }, { - "privilege_type": "m", - "privilege": true, - "with_grant": false - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + }, + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_icu.sql", "expected_msql_file": "create_database_icu_msql.sql" @@ -447,92 +923,122 @@ "datlocaleprovider": "icu", "daticulocale": "und", "daticurules": "&V << w <<< W", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }, { - "privilege_type": "m", - "privilege": true, - "with_grant": false - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + }, + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_icu_rules.sql", "expected_msql_file": "create_database_icu_rules_msql.sql" @@ -561,92 +1067,122 @@ "schema_res": [], "datlocaleprovider": "builtin", "datbuiltinlocale": "C.UTF-8", - "nspacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "C", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], + "nspacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "C", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], "seclabels": [], - "deftblacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "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 - }, { - "privilege_type": "m", - "privilege": true, - "with_grant": false - }] - }], - "defseqacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "r", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "w", - "privilege": true, - "with_grant": false - }, { - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }], - "deffuncacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "X", - "privilege": true, - "with_grant": false - }] - }], - "deftypeacl": [{ - "grantee": "PUBLIC", - "grantor": "postgres", - "privileges": [{ - "privilege_type": "U", - "privilege": true, - "with_grant": false - }] - }] + "deftblacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "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 + }, + { + "privilege_type": "m", + "privilege": true, + "with_grant": false + } + ] + } + ], + "defseqacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deffuncacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ] + } + ], + "deftypeacl": [ + { + "grantee": "PUBLIC", + "grantor": "", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ] + } + ] }, "expected_sql_file": "create_database_builtin.sql", "expected_msql_file": "create_database_builtin_msql.sql" diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_all.sql index 164845af071..8c32fe51700 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -12,14 +12,14 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE, INSERT, UPDATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, UPDATE ON SEQUENCES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_msql.sql index 0a1acefbf03..094218a9723 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_add_msql.sql @@ -1,12 +1,12 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE, INSERT, UPDATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, UPDATE ON SEQUENCES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all.sql index 880d95c8857..8c060ae94c3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = 'C' LC_CTYPE = 'C' @@ -12,16 +12,16 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT TRUNCATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE ON TABLES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT UPDATE ON SEQUENCES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all_msql.sql index 9e112d637ea..f9356b8f99f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_all_msql.sql @@ -1,27 +1,27 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON FUNCTIONS FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT EXECUTE ON FUNCTIONS TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT DELETE ON TABLES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT TRUNCATE ON TABLES TO test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT UPDATE ON SEQUENCES TO test_default_priv_user WITH GRANT OPTION; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TYPES FROM test_default_priv_user; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT USAGE ON TYPES TO test_default_priv_user WITH GRANT OPTION; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function.sql index 3f681819713..2412d3a6cd4 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -12,4 +12,4 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function_msql.sql index 0b7485596ef..df7cf4d0b1f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_function_msql.sql @@ -1,3 +1,3 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_newuser_reset_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_newuser_reset_all.sql index 15768fa0b1c..1d92e1ef594 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_newuser_reset_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_newuser_reset_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_reset_all.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_reset_all.sql index 15768fa0b1c..1d92e1ef594 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_reset_all.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_reset_all.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences.sql index 96259db4128..daf96630b50 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -12,11 +12,11 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, USAGE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences_msql.sql index 5bd72096322..0b132af16d7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_sequences_msql.sql @@ -1,9 +1,9 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres - REVOKE ALL ON SEQUENCES FROM postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE + REVOKE ALL ON SEQUENCES FROM ; +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, USAGE ON SEQUENCES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables.sql index e47b36cdc0c..544dd2126e3 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -12,9 +12,9 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT ON TABLES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables_msql.sql index 997157f5800..279cfda88d9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_tables_msql.sql @@ -1,6 +1,6 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres - REVOKE ALL ON TABLES FROM postgres; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE + REVOKE ALL ON TABLES FROM ; +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT ON TABLES TO PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types.sql index e9726d55952..68176b028af 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types.sql @@ -4,7 +4,7 @@ CREATE DATABASE WITH - OWNER = postgres + OWNER = ENCODING = 'UTF8' LC_COLLATE = '' LC_CTYPE = '' @@ -12,13 +12,13 @@ CREATE DATABASE CONNECTION LIMIT = -1 IS_TEMPLATE = False; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON TABLES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TABLES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE ALL ON SEQUENCES FROM postgres; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON SEQUENCES FROM ; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE GRANT SELECT, USAGE ON SEQUENCES TO PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC; -ALTER DEFAULT PRIVILEGES FOR ROLE postgres REVOKE USAGE ON TYPES FROM PUBLIC; +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE USAGE ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types_msql.sql index 22bfbd6e90e..68d7f44f779 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/alter_default_db_privileges_types_msql.sql @@ -1,4 +1,4 @@ -ALTER DEFAULT PRIVILEGES FOR ROLE postgres +ALTER DEFAULT PRIVILEGES FOR ROLE REVOKE ALL ON TYPES FROM PUBLIC; diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/test_database.json b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/test_database.json index 0ef370ea320..f7da89c2c02 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/test_database.json +++ b/web/pgadmin/browser/server_groups/servers/databases/tests/pg/default/test_database.json @@ -12,7 +12,7 @@ "deffuncacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -41,11 +41,19 @@ "deftblacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ - {"privilege_type":"D","privilege":true,"with_grant":false}, - {"privilege_type":"w","privilege":true,"with_grant":false} + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } ], "acltype": "deftblacl" } @@ -60,7 +68,7 @@ "with_grant": false } ], - "grantor": "postgres" + "grantor": "" } ] } @@ -80,8 +88,8 @@ "defseqacl": { "deleted": [ { - "grantor": "postgres", - "grantee": "postgres", + "grantor": "", + "grantee": "", "privileges": [ { "privilege_type": "w", @@ -92,11 +100,41 @@ "acltype": "defaultacls" } ], - "added":[ - {"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}, - {"privilege_type":"r","privilege":true,"with_grant":false}],"grantor":"postgres"}] + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, - "deftblacl": {"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deftblacl": { + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } }, "expected_msql_file": "alter_default_db_privileges_sequences_msql.sql", "expected_sql_file": "alter_default_db_privileges_sequences.sql" @@ -113,7 +151,7 @@ "deftypeacl": { "deleted": [ { - "grantor": "postgres", + "grantor": "", "grantee": "PUBLIC", "privileges": [ { @@ -126,7 +164,6 @@ } ] } - }, "expected_msql_file": "alter_default_db_privileges_types_msql.sql", "expected_sql_file": "alter_default_db_privileges_types.sql" @@ -139,11 +176,170 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"PUBLIC","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"postgres","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}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","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}],"acltype":"defaultacls"}]}, - "defseqacl":{"added":[{"grantee":"postgres","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}],"deleted":[{"grantor":"postgres","grantee":"PUBLIC","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"U","privilege":true,"with_grant":false}],"acltype":"defaultacls"}]} + "deffuncacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "added": [ + { + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "", + "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 + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "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 + } + ], + "acltype": "defaultacls" + } + ] }, + "defseqacl": { + "added": [ + { + "grantee": "", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantor": "", + "grantee": "PUBLIC", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "acltype": "defaultacls" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_reset_all.sql" }, { @@ -155,11 +351,82 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftypeacl": {"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "deftblacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"d","privilege":true,"with_grant":false}],"grantor":"postgres"}]}, - "defseqacl":{"added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}]} + "deffuncacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] }, + "deftypeacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "a", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + }, + "defseqacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_add_msql.sql", "expected_sql_file": "alter_default_db_privileges_add_all.sql", "pre_scenario_sql": "CREATE ROLE test_default_priv_user WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS;" @@ -173,16 +440,106 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "added":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":false}],"grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"r","privilege":true,"with_grant":false}], "grantor":"postgres"}], - "changed":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "added": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "r", + "privilege": true, + "with_grant": false + } + ], + "grantor": "" + } + ], + "changed": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_msql_file": "alter_default_db_privileges_all_msql.sql", "expected_sql_file": "alter_default_db_privileges_all.sql" }, @@ -195,13 +552,72 @@ "TEST_DB_NAME": "", "REPLACE_LOCALE": true, "data": { - "deffuncacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"X","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftypeacl": {"deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"U","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "deftblacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"D","privilege":true,"with_grant":false}, {"privilege_type":"d","privilege":true,"with_grant":true}],"grantor":"postgres"}]}, - "defseqacl":{ - "deleted":[{"grantee":"test_default_priv_user","privileges":[{"privilege_type":"w","privilege":true,"with_grant":true}],"grantor":"postgres"}]} + "deffuncacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "X", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftypeacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "U", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + }, + "deftblacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "D", + "privilege": true, + "with_grant": false + }, + { + "privilege_type": "d", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] }, + "defseqacl": { + "deleted": [ + { + "grantee": "test_default_priv_user", + "privileges": [ + { + "privilege_type": "w", + "privilege": true, + "with_grant": true + } + ], + "grantor": "" + } + ] + } + }, "expected_sql_file": "alter_default_db_privileges_newuser_reset_all.sql", "post_scenario_sql": "DROP ROLE IF EXISTS test_default_priv_user;" } diff --git a/web/pgadmin/tools/schema_diff/tests/utils.py b/web/pgadmin/tools/schema_diff/tests/utils.py index d6e2325bd12..b226513aa46 100644 --- a/web/pgadmin/tools/schema_diff/tests/utils.py +++ b/web/pgadmin/tools/schema_diff/tests/utils.py @@ -40,6 +40,19 @@ def restore_schema(server, db_name, schema_name, sql_path): with open(sql_path, 'r') as content_file: sql = content_file.read() + # Replace hardcoded 'postgres' role with the actual test user + # so the restore works on systems without a 'postgres' role. + # Use qtIdent to properly quote usernames with special chars. + import re + from pgadmin.utils.driver.psycopg3 import Driver + username = Driver.qtIdent(None, server['username']) + sql = re.sub(r'\bOWNER [Tt][Oo] postgres\b', + 'OWNER TO ' + username, sql) + sql = re.sub(r'\bTO postgres\b', 'TO ' + username, sql) + sql = re.sub(r'\bFROM postgres\b', 'FROM ' + username, sql) + sql = re.sub(r'\bFOR postgres\b', 'FOR ' + username, sql) + sql = sql.replace('Owner: postgres', + 'Owner: ' + server['username']) pg_cursor.execute(sql) utils.set_isolation_level(connection, old_isolation_level) connection.commit() diff --git a/web/regression/re_sql/tests/test_resql.py b/web/regression/re_sql/tests/test_resql.py index 4ded0fed592..91fdc7a48d5 100644 --- a/web/regression/re_sql/tests/test_resql.py +++ b/web/regression/re_sql/tests/test_resql.py @@ -259,9 +259,10 @@ def execute_test_case(self, scenarios): self.execute_prepost_sql( scenario['pre_scenario_sql'], False) - # Preprocessed data to replace any place holder if available - if 'preprocess_data' in scenario and \ - scenario['preprocess_data'] and 'data' in scenario: + # Always preprocess data to replace placeholders like + # with the actual test username, and any object + # ID references. + if 'data' in scenario: scenario['data'] = self.preprocess_data(scenario['data']) # If msql_endpoint exists then validate the modified sql @@ -500,8 +501,8 @@ def check_msql(self, scenario, object_id): fp = open(output_file, "r") # Used rstrip to remove trailing \n sql = fp.read().rstrip() - sql = self.preprocess_expected_sql(scenario, sql, resp_sql, - object_id) + sql, resp_sql = self.preprocess_expected_sql( + scenario, sql, resp_sql, object_id) try: self.assertEqual(sql, resp_sql) except Exception as e: @@ -554,8 +555,8 @@ def check_re_sql(self, scenario, object_id): fp = open(output_file, "r") # Used rstrip to remove trailing \n sql = fp.read().rstrip() - sql = self.preprocess_expected_sql(scenario, sql, resp_sql, - object_id) + sql, resp_sql = self.preprocess_expected_sql( + scenario, sql, resp_sql, object_id) try: self.assertEqual(sql, resp_sql) except Exception as e: @@ -573,8 +574,8 @@ def check_re_sql(self, scenario, object_id): return False elif 'expected_sql' in scenario: exp_sql = scenario['expected_sql'] - exp_sql = self.preprocess_expected_sql(scenario, exp_sql, resp_sql, - object_id) + exp_sql, resp_sql = self.preprocess_expected_sql( + scenario, exp_sql, resp_sql, object_id) try: self.assertEqual(exp_sql, resp_sql) except Exception as e: @@ -788,10 +789,19 @@ def preprocess_expected_sql(self, scenario, sql, resp_sql, object_id): :return: """ # Replace place holder with the current username - # used to connect to the database + # used to connect to the database. if 'username' in self.server: - sql = sql.replace(self.JSON_PLACEHOLDERS['owner'], - self.server['username']) + from pgadmin.utils.driver.psycopg3 import Driver + quoted = Driver.qtIdent(None, self.server['username']) + raw = self.server['username'] + # Replace with the raw username first + sql = sql.replace(self.JSON_PLACEHOLDERS['owner'], raw) + # If the username needs quoting, normalize both expected and + # response SQL so unquoted occurrences match quoted ones. + if quoted != raw: + sql = self._normalize_owner(sql, raw, quoted) + resp_sql = self._normalize_owner( + resp_sql, raw, quoted) # Convert timestamp with timezone from json file to the # database server's correct timestamp sql = self.convert_timestamptz(scenario, sql) @@ -850,6 +860,27 @@ def preprocess_expected_sql(self, scenario, sql, resp_sql, object_id): sql = sql.replace(self.JSON_PLACEHOLDERS['LC_COLLATE'], lc_collate) sql = sql.replace(self.JSON_PLACEHOLDERS['LC_CTYPE'], lc_ctype) + return sql, resp_sql + + @staticmethod + def _normalize_owner(sql, raw, quoted): + """ + Normalize owner references in SQL so that both quoted and unquoted + forms become consistent. This handles usernames that contain special + characters (e.g. dots) where PostgreSQL sometimes quotes and + sometimes doesn't (e.g. in SQL comments vs DDL statements). + """ + import re + # Replace unquoted raw username with the quoted form everywhere + # except inside already-quoted strings. Use word boundary matching + # to avoid partial replacements. + escaped_raw = re.escape(raw) + escaped_quoted = re.escape(quoted) + # Don't replace if already quoted + sql = re.sub( + r'(?'): # Remove < and > from the string temp_value = value[1:-1] + + if temp_value == 'OWNER': + return self.server['username'] + # Find the place holder OID in dictionary if temp_value in self.all_object_ids: return self.all_object_ids[temp_value] diff --git a/web/regression/requirements.txt b/web/regression/requirements.txt index 434616e0105..89f1d245d08 100644 --- a/web/regression/requirements.txt +++ b/web/regression/requirements.txt @@ -28,6 +28,7 @@ pbr==7.0.3 pycodestyle>=2.5.0 python-mimeparse==2.0.0 selenium==4.43.0 -testscenarios==0.6.1 +testscenarios==0.5.0; python_version <= '3.9' +testscenarios==0.6.1; python_version > '3.9' testtools==2.9.0 traceback2==1.4.0