mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-23 07:34:35 -06:00
Added support for PostgreSQL and EPAS 16 to ensure it works without any errors. #6588
This commit is contained in:
parent
31fddaf10b
commit
0f86b78d87
@ -20,6 +20,8 @@ Bundled PostgreSQL Utilities
|
||||
New features
|
||||
************
|
||||
|
||||
| `Issue #2595 <https://github.com/pgadmin-org/pgadmin4/issues/2595>`_ - Added Expression to CREATE INDEX.
|
||||
| `Issue #6375 <https://github.com/pgadmin-org/pgadmin4/issues/6375>`_ - Added support for ALTER INDEX column statistics.
|
||||
| `Issue #6376 <https://github.com/pgadmin-org/pgadmin4/issues/6376>`_ - Added unlogged option while creating a sequence.
|
||||
| `Issue #6381 <https://github.com/pgadmin-org/pgadmin4/issues/6381>`_ - Added support for SYSTEM, CONCURRENTLY and TABLESPACE options in REINDEX.
|
||||
| `Issue #6397 <https://github.com/pgadmin-org/pgadmin4/issues/6397>`_ - Added new/missing options to the VACUUM command.
|
||||
@ -28,8 +30,10 @@ New features
|
||||
Housekeeping
|
||||
************
|
||||
|
||||
| `Issue #6588 <https://github.com/pgadmin-org/pgadmin4/issues/6588>`_ - Added support for PostgreSQL and EPAS 16 to ensure it works without any errors.
|
||||
|
||||
Bug fixes
|
||||
*********
|
||||
|
||||
| `Issue #6500 <https://github.com/pgadmin-org/pgadmin4/issues/6500>`_ - Fix the issue where query tool window turns blank if the user tries to generate a graph on the result.
|
||||
| `Issue #6624 <https://github.com/pgadmin-org/pgadmin4/issues/6624>`_ - Fix an issue where changing MFA_SUPPORTED_METHODS breaks the MFA validation.
|
||||
|
@ -0,0 +1,19 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO postgres;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres;
|
@ -0,0 +1,20 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO postgres;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres;
|
@ -0,0 +1,19 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO postgres;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres;
|
@ -0,0 +1,18 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO postgres;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
@ -0,0 +1,20 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO postgres;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||
|
@ -0,0 +1,17 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=local
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO postgres;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment';
|
||||
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO postgres;
|
@ -0,0 +1,259 @@
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_mview_remove_table_parameter.sql",
|
||||
"expected_msql_file": "alter_mview_remove_table_parameter_msql.sql"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,225 @@
|
||||
{
|
||||
"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,
|
||||
"security_invoker": 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"
|
||||
},
|
||||
{
|
||||
"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,
|
||||
"security_invoker": 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"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter View (changing code)",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql_id",
|
||||
"data": {
|
||||
"definition": "SELECT * FROM test_view_table;"
|
||||
},
|
||||
"expected_sql_file": "alter_view_definition.sql",
|
||||
"expected_msql_file": "alter_view_definition_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter View (adding privileges)",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql_id",
|
||||
"data": {
|
||||
"name": "testview_$%{}[]()&*^!@\"'`\\/#",
|
||||
"owner": "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_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":
|
||||
{
|
||||
"deleted":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"postgres",
|
||||
"privileges":[
|
||||
{
|
||||
"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":
|
||||
{
|
||||
"changed":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"postgres",
|
||||
"old_grantee": "postgres",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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":
|
||||
{
|
||||
"deleted":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"postgres",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO enterprisedb;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb;
|
@ -0,0 +1,20 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO enterprisedb;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb;
|
@ -0,0 +1,15 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO enterprisedb;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb;
|
@ -0,0 +1,17 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO enterprisedb;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
@ -0,0 +1,20 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=cascaded,
|
||||
security_barrier=true,
|
||||
security_invoker=true
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO enterprisedb;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment-updated';
|
||||
|
||||
GRANT SELECT ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
||||
|
@ -0,0 +1,17 @@
|
||||
-- View: public.testview_$%{}[]()&*^!@"'`\/#
|
||||
|
||||
-- DROP VIEW public."testview_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
CREATE OR REPLACE VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
WITH (
|
||||
check_option=local
|
||||
) AS
|
||||
SELECT col1
|
||||
FROM test_view_table;
|
||||
|
||||
ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
OWNER TO enterprisedb;
|
||||
COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Testcomment';
|
||||
|
||||
GRANT ALL ON TABLE public."testview_$%{}[]()&*^!@""'`\/#" TO enterprisedb;
|
@ -0,0 +1,259 @@
|
||||
{
|
||||
"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": "enterprisedb",
|
||||
"datacl": [],
|
||||
"seclabels": [],
|
||||
"name": "testmview_$%{}[]()&*^!/@`#",
|
||||
"comment": "comment1",
|
||||
"definition": "SELECT 1 AS col1"
|
||||
},
|
||||
"expected_sql_file": "create_mview.sql",
|
||||
"expected_msql_file": "create_mview_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Materialised Views (Adding privileges)",
|
||||
"endpoint": "NODE-mview.obj_id",
|
||||
"sql_endpoint": "NODE-mview.sql_id",
|
||||
"msql_endpoint": "NODE-mview.msql_id",
|
||||
"data": {
|
||||
"datacl": {
|
||||
"added": [
|
||||
{
|
||||
"grantee": "PUBLIC",
|
||||
"grantor": "enterprisedb",
|
||||
"privileges": [
|
||||
{
|
||||
"privilege_type": "a",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "r",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "w",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "d",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "D",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "x",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "t",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_mview.sql",
|
||||
"expected_msql_file": "alter_mview_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Materialised Views (Remove all privileges)",
|
||||
"endpoint": "NODE-mview.obj_id",
|
||||
"sql_endpoint": "NODE-mview.sql_id",
|
||||
"msql_endpoint": "NODE-mview.msql_id",
|
||||
"data": {
|
||||
"datacl": {
|
||||
"deleted": [
|
||||
{
|
||||
"grantee": "PUBLIC",
|
||||
"grantor": "enterprisedb",
|
||||
"privileges": [
|
||||
{
|
||||
"privilege_type": "a",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "r",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "w",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "d",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "D",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "x",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "t",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_mview_drop_all_priv.sql",
|
||||
"expected_msql_file": "alter_mview_drop_all_priv_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Materialised Views (change 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": "enterprisedb",
|
||||
"old_grantee": "enterprisedb",
|
||||
"privileges": [
|
||||
{
|
||||
"privilege_type": "a",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "r",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "w",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "d",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "D",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "x",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
},
|
||||
{
|
||||
"privilege_type": "t",
|
||||
"privilege": true,
|
||||
"with_grant": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_mview_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;"
|
||||
},
|
||||
"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
|
||||
},
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_mview_remove_table_parameter.sql",
|
||||
"expected_msql_file": "alter_mview_remove_table_parameter_msql.sql"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
{
|
||||
"scenarios": [
|
||||
{
|
||||
"type": "create",
|
||||
"name": "Create Table for Views",
|
||||
"endpoint": "NODE-table.obj",
|
||||
"sql_endpoint": "NODE-table.sql_id",
|
||||
"data": {
|
||||
"name": "test_view_table",
|
||||
"check_constraint": [],
|
||||
"coll_inherits": "[]",
|
||||
"columns": [
|
||||
{
|
||||
"name": "col1",
|
||||
"cltype": "integer"
|
||||
}
|
||||
],
|
||||
"schema": "public"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "create",
|
||||
"name": "Create View",
|
||||
"endpoint": "NODE-view.obj",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql",
|
||||
"data": {
|
||||
"definition": "select col1 from test_view_table;",
|
||||
"name": "testview_$%{}[]()&*^!@\"'`\\/#",
|
||||
"owner": "enterprisedb",
|
||||
"schema": "public",
|
||||
"check_option": "local",
|
||||
"security_barrier": false,
|
||||
"security_invoker": false,
|
||||
"comment":"Testcomment",
|
||||
"datacl":[{"grantee":"enterprisedb", "grantor":"enterprisedb", "privileges":[{"privilege_type": "a", "privilege": true,
|
||||
"with_grant":false}]}]
|
||||
},
|
||||
"expected_sql_file": "create_view.sql",
|
||||
"expected_msql_file": "create_view_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter View",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql_id",
|
||||
"data": {
|
||||
"name": "testview_$%{}[]()&*^!@\"'`\\/#",
|
||||
"owner": "enterprisedb",
|
||||
"schema": "public",
|
||||
"check_option": "cascaded",
|
||||
"security_barrier": true,
|
||||
"security_invoker": true,
|
||||
"comment":"Testcomment-updated",
|
||||
"datacl":[{"grantee":"enterprisedb", "grantor":"enterprisedb", "privileges":[{"privilege_type": "a", "privilege": true,
|
||||
"with_grant":false}]}]
|
||||
},
|
||||
"expected_sql_file": "alter_view.sql",
|
||||
"expected_msql_file": "alter_view_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter View (adding privileges)",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql_id",
|
||||
"data": {
|
||||
"datacl":{
|
||||
"added":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"enterprisedb",
|
||||
"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": "enterprisedb",
|
||||
"schema": "public",
|
||||
"check_option": "cascaded",
|
||||
"security_barrier": true,
|
||||
"comment":"Testcomment-updated",
|
||||
"datacl":
|
||||
{
|
||||
"deleted":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"enterprisedb",
|
||||
"privileges":[
|
||||
{
|
||||
"privilege_type":"r",
|
||||
"privilege":true,
|
||||
"with_grant":false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter View (changing privileges (enterprisedb to PUBLIC))",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql_id",
|
||||
"data": {
|
||||
"name": "testview_$%{}[]()&*^!@\"'`\\/#",
|
||||
"owner": "enterprisedb",
|
||||
"schema": "public",
|
||||
"check_option": "cascaded",
|
||||
"security_barrier": true,
|
||||
"comment":"Testcomment-updated",
|
||||
"datacl":
|
||||
{
|
||||
"changed":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"enterprisedb",
|
||||
"old_grantee": "enterprisedb",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter View (deleting privileges)",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"sql_endpoint": "NODE-view.sql_id",
|
||||
"msql_endpoint": "NODE-view.msql_id",
|
||||
"data": {
|
||||
"name": "testview_$%{}[]()&*^!@\"'`\\/#",
|
||||
"owner": "enterprisedb",
|
||||
"schema": "public",
|
||||
"check_option": "cascaded",
|
||||
"security_barrier": true,
|
||||
"comment":"Testcomment-updated",
|
||||
"datacl":
|
||||
{
|
||||
"deleted":[
|
||||
{
|
||||
"grantee":"PUBLIC",
|
||||
"grantor":"enterprisedb",
|
||||
"privileges":[
|
||||
{
|
||||
"privilege_type":"r",
|
||||
"privilege":true,
|
||||
"with_grant":false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expected_sql_file": "alter_view_delete_priv.sql",
|
||||
"expected_msql_file": "alter_view_delete_priv_msql.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
"name": "Drop View",
|
||||
"endpoint": "NODE-view.obj_id",
|
||||
"data": {
|
||||
"name": "testview_$%{}[]()&*^!@\"'`\\/#",
|
||||
"owner": "enterprisedb",
|
||||
"schema": "public"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
"name": "Drop Table for view",
|
||||
"endpoint": "NODE-table.obj_id",
|
||||
"data": {
|
||||
"name": "test_view_table",
|
||||
"owner": "enterprisedb",
|
||||
"schema": "public"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -43,6 +43,21 @@ class ViewsGetTestCase(BaseTestGenerator):
|
||||
if not db_con['data']["connected"]:
|
||||
raise Exception("Could not connect to database to fetch the view.")
|
||||
|
||||
# Check DB version
|
||||
if "server_min_version" in self.data:
|
||||
server_con = server_utils.connect_server(self, self.server_id)
|
||||
if server_con["info"] != "Server connected.":
|
||||
raise Exception("Could not connect to server to check version")
|
||||
if server_con["data"]["version"] < self.data["server_min_version"]:
|
||||
self.skipTest(self.data["skip_msg"])
|
||||
|
||||
if "server_max_version" in self.data:
|
||||
server_con = server_utils.connect_server(self, self.server_id)
|
||||
if server_con["info"] != "Server connected.":
|
||||
raise Exception("Could not connect to server to check version")
|
||||
if server_con["data"]["version"] > self.data["server_max_version"]:
|
||||
self.skipTest(self.data["skip_msg"])
|
||||
|
||||
# Create schema
|
||||
self.schema_id = schema_info["schema_id"]
|
||||
self.schema_name = schema_info["schema_name"]
|
||||
|
@ -152,13 +152,16 @@
|
||||
"is_list": false
|
||||
},
|
||||
{
|
||||
"name": "Get view: With existing view having brackets.",
|
||||
"name": "Get view: With existing view having brackets (<v16).",
|
||||
"url": "/browser/view/obj/",
|
||||
"is_positive_test": true,
|
||||
"inventory_data": {
|
||||
"query": "\"CREATE OR REPLACE VIEW %s.%s AS SELECT CASE WHEN (pg_db.datistemplate = false AND pg_db.datallowconn = true AND (pg_db.datconnlimit = -1 OR pg_db.datacl is null)) then true else false end as res FROM pg_database pg_db; ALTER TABLE %s.%s OWNER TO %s\" % (schema_name, view_name, schema_name, view_name, server['username'])"
|
||||
},
|
||||
"test_data": {},
|
||||
"test_data": {
|
||||
"server_max_version": 159999,
|
||||
"skip_msg": "Definition is different from v16 onwards."
|
||||
},
|
||||
"mocking_required": false,
|
||||
"mock_data": {},
|
||||
"expected_data": {
|
||||
@ -171,6 +174,29 @@
|
||||
},
|
||||
"is_list": false
|
||||
},
|
||||
{
|
||||
"name": "Get view: With existing view having brackets (>=16).",
|
||||
"url": "/browser/view/obj/",
|
||||
"is_positive_test": true,
|
||||
"inventory_data": {
|
||||
"query": "\"CREATE OR REPLACE VIEW %s.%s AS SELECT CASE WHEN (pg_db.datistemplate = false AND pg_db.datallowconn = true AND (pg_db.datconnlimit = -1 OR pg_db.datacl is null)) then true else false end as res FROM pg_database pg_db; ALTER TABLE %s.%s OWNER TO %s\" % (schema_name, view_name, schema_name, view_name, server['username'])"
|
||||
},
|
||||
"test_data": {
|
||||
"server_min_version": 160000,
|
||||
"skip_msg": "Definition is different from v16 onwards."
|
||||
},
|
||||
"mocking_required": false,
|
||||
"mock_data": {},
|
||||
"expected_data": {
|
||||
"status_code": 200,
|
||||
"error_msg": null,
|
||||
"test_result_data": {
|
||||
"definition": " SELECT\n CASE\n WHEN ((datistemplate = false) AND (datallowconn = true) AND ((datconnlimit = '-1'::integer) OR (datacl IS NULL))) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;",
|
||||
"pg_definition": " SELECT\n CASE\n WHEN datistemplate = false AND datallowconn = true AND (datconnlimit = '-1'::integer OR datacl IS NULL) THEN true\n ELSE false\n END AS res\n FROM pg_database pg_db;"
|
||||
}
|
||||
},
|
||||
"is_list": false
|
||||
},
|
||||
{
|
||||
"name": "Get views list: With existing views.",
|
||||
"url": "/browser/view/obj/",
|
||||
|
@ -0,0 +1,8 @@
|
||||
SELECT CASE WHEN datlocprovider = 'i' THEN
|
||||
(SELECT daticulocale as cname FROM pg_database WHERE datname = current_database())
|
||||
ELSE
|
||||
(SELECT datcollate as cname FROM pg_database WHERE datname = current_database()
|
||||
UNION
|
||||
SELECT datctype as cname FROM pg_database WHERE datname = current_database())
|
||||
END
|
||||
FROM pg_database WHERE datname = current_database();
|
@ -0,0 +1,40 @@
|
||||
SELECT
|
||||
db.oid AS did, db.oid, db.datname AS name, db.dattablespace AS spcoid,
|
||||
spcname, datallowconn, pg_catalog.pg_encoding_to_char(encoding) AS encoding,
|
||||
pg_catalog.pg_get_userbyid(datdba) AS datowner, db.datcollate, db.datctype,
|
||||
datconnlimit,
|
||||
pg_catalog.has_database_privilege(db.oid, 'CREATE') AS cancreate,
|
||||
pg_catalog.current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description AS comments, db.datistemplate AS is_template,
|
||||
{### Default ACL for Tables ###}
|
||||
'' AS tblacl,
|
||||
{### Default ACL for Sequnces ###}
|
||||
'' AS seqacl,
|
||||
{### Default ACL for Functions ###}
|
||||
'' AS funcacl,
|
||||
pg_catalog.array_to_string(datacl::text[], ', ') AS acl
|
||||
FROM pg_catalog.pg_database db
|
||||
LEFT OUTER JOIN pg_catalog.pg_tablespace ta ON db.dattablespace=ta.OID
|
||||
LEFT OUTER JOIN pg_catalog.pg_shdescription descr ON (
|
||||
db.oid=descr.objoid AND descr.classoid='pg_database'::regclass
|
||||
)
|
||||
WHERE
|
||||
{% if show_user_defined_templates is defined %}
|
||||
db.datistemplate = {{show_user_defined_templates}} AND
|
||||
{% endif %}
|
||||
{% if did %}
|
||||
db.oid = {{ did|qtLiteral(conn) }}::OID
|
||||
{% else %}
|
||||
{% if name %}
|
||||
db.datname = {{ name|qtLiteral(conn) }}::text
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if db_restrictions %}
|
||||
{% if did or name %}AND{% endif %}
|
||||
db.datname in ({{db_restrictions}})
|
||||
{% elif not did and not name%}
|
||||
db.oid > {{ last_system_oid }}::OID OR db.datname IN ('postgres', 'edb')
|
||||
{% endif %}
|
||||
|
||||
ORDER BY datname;
|
@ -24,6 +24,7 @@ VERBOSE = '--verbose'
|
||||
FORMAT_C = '--format=c'
|
||||
FORMAT_P = '--format=p'
|
||||
BLOBS = '--blobs'
|
||||
LARGE_OBJECTS = '--large-objects'
|
||||
DATA_ONLY = '--data-only'
|
||||
SCHEMA_ONLY = '--schema-only'
|
||||
|
||||
@ -31,7 +32,7 @@ SCHEMA_ONLY = '--schema-only'
|
||||
class BackupCreateJobTest(BaseTestGenerator):
|
||||
"""Test the BackupCreateJob class"""
|
||||
scenarios = [
|
||||
('When backup object with default options',
|
||||
('When backup object with default options (< v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
@ -54,7 +55,38 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
url=BACKUP_OBJECT_URL,
|
||||
expected_cmd_opts=[VERBOSE, FORMAT_C, BLOBS],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
expected_exit_code=[0, None],
|
||||
server_max_version=159999,
|
||||
message='--blobs is deprecated and is not supported by EPAS/PG '
|
||||
'server greater than 15'
|
||||
)),
|
||||
('When backup object with default options (>= v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
name='test_backup_server',
|
||||
port=5444,
|
||||
host='localhost',
|
||||
database='postgres',
|
||||
bfile='test_backup',
|
||||
username='postgres'
|
||||
),
|
||||
params=dict(
|
||||
file='test_backup_file',
|
||||
format='custom',
|
||||
verbose=True,
|
||||
blobs=True,
|
||||
schemas=[],
|
||||
tables=[],
|
||||
database='postgres'
|
||||
),
|
||||
url=BACKUP_OBJECT_URL,
|
||||
expected_cmd_opts=[VERBOSE, FORMAT_C, LARGE_OBJECTS],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None],
|
||||
server_min_version=160000,
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
)),
|
||||
('When backup object with format directory',
|
||||
dict(
|
||||
@ -616,7 +648,7 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
)),
|
||||
('When backup the object with format tar',
|
||||
('When backup the object with format tar (< v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
@ -641,9 +673,42 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
BLOBS,
|
||||
'--format=t'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
expected_exit_code=[0, None],
|
||||
server_max_version=159999,
|
||||
message='--blobs is deprecated and is not supported by EPAS/PG '
|
||||
'server greater than 15'
|
||||
)),
|
||||
('When backup a schema with default options',
|
||||
('When backup the object with format tar (>= v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
name='test_backup_server',
|
||||
port=5444,
|
||||
host='localhost',
|
||||
database='postgres',
|
||||
bfile='test_backup',
|
||||
username='postgres'
|
||||
),
|
||||
params=dict(
|
||||
file='test_backup_file',
|
||||
format='tar',
|
||||
verbose=True,
|
||||
schemas=[],
|
||||
tables=[],
|
||||
database='postgres',
|
||||
blobs=True,
|
||||
),
|
||||
url=BACKUP_OBJECT_URL,
|
||||
expected_cmd_opts=[VERBOSE,
|
||||
LARGE_OBJECTS,
|
||||
'--format=t'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None],
|
||||
server_min_version=160000,
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
)),
|
||||
('When backup a schema with default options (< v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
@ -667,9 +732,41 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
expected_cmd_opts=[VERBOSE, FORMAT_C, BLOBS,
|
||||
'--schema', 'schema1'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
expected_exit_code=[0, None],
|
||||
server_max_version=159999,
|
||||
message='--blobs is deprecated and is not supported by EPAS/PG '
|
||||
'server greater than 15'
|
||||
)),
|
||||
('When backup a table with default options',
|
||||
('When backup a schema with default options (>=v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
name='test_backup_server',
|
||||
port=5444,
|
||||
host='localhost',
|
||||
database='postgres',
|
||||
bfile='test_backup',
|
||||
username='postgres'
|
||||
),
|
||||
params=dict(
|
||||
file='test_backup_file',
|
||||
format='custom',
|
||||
verbose=True,
|
||||
blobs=True,
|
||||
schemas=['schema1'],
|
||||
tables=[],
|
||||
database='postgres'
|
||||
),
|
||||
url=BACKUP_OBJECT_URL,
|
||||
expected_cmd_opts=[VERBOSE, FORMAT_C, LARGE_OBJECTS,
|
||||
'--schema', 'schema1'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None],
|
||||
server_min_version=160000,
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
)),
|
||||
('When backup a table with default options (< v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
@ -693,7 +790,39 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
expected_cmd_opts=[VERBOSE, FORMAT_C, BLOBS,
|
||||
'--table', 'public.table1'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
expected_exit_code=[0, None],
|
||||
server_max_version=159999,
|
||||
message='--blobs is deprecated and is not supported by EPAS/PG '
|
||||
'server greater than 15'
|
||||
)),
|
||||
('When backup a table with default options (>= v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
name='test_backup_server',
|
||||
port=5444,
|
||||
host='localhost',
|
||||
database='postgres',
|
||||
bfile='test_backup',
|
||||
username='postgres'
|
||||
),
|
||||
params=dict(
|
||||
file='test_backup_file',
|
||||
format='custom',
|
||||
verbose=True,
|
||||
blobs=True,
|
||||
schemas=[],
|
||||
tables=[['public', 'table1']],
|
||||
database='postgres'
|
||||
),
|
||||
url=BACKUP_OBJECT_URL,
|
||||
expected_cmd_opts=[VERBOSE, FORMAT_C, LARGE_OBJECTS,
|
||||
'--table', 'public.table1'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None],
|
||||
server_min_version=160000,
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
)),
|
||||
('When backup the server',
|
||||
dict(
|
||||
@ -1153,6 +1282,16 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
if hasattr(self, 'server_min_version') and \
|
||||
self.server_information['server_version'] < \
|
||||
self.server_min_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
if hasattr(self, 'server_max_version') and \
|
||||
self.server_information['server_version'] > \
|
||||
self.server_max_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
if 'default_binary_paths' not in self.server or \
|
||||
self.server['default_binary_paths'] is None or \
|
||||
self.server['type'] not in self.server['default_binary_paths'] or \
|
||||
@ -1222,11 +1361,6 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
db_owner = server_response['data']['user']['name']
|
||||
self.data = database_utils.get_db_data(db_owner)
|
||||
|
||||
if hasattr(self, 'server_min_version') and \
|
||||
server_response["data"]["version"] < \
|
||||
self.server_min_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
url = self.url.format(self.server_id)
|
||||
|
||||
# Create the backup job
|
||||
|
@ -18,7 +18,7 @@ import pgadmin.tools.backup.tests.test_backup_utils as backup_utils
|
||||
class BackupJobTest(BaseTestGenerator):
|
||||
"""Backup api test cases"""
|
||||
scenarios = [
|
||||
('When backup the object with the default options',
|
||||
('When backup the object with the default options (< v16)',
|
||||
dict(
|
||||
params=dict(
|
||||
file='test_backup',
|
||||
@ -34,11 +34,46 @@ class BackupJobTest(BaseTestGenerator):
|
||||
expected_cmd_opts=['--verbose', '--format=c', '--blobs'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
)
|
||||
),
|
||||
server_max_version=159999,
|
||||
message='--blobs is deprecated and is not supported by EPAS/PG '
|
||||
'server greater than 15'
|
||||
)),
|
||||
('When backup the object with the default options (>= v16)',
|
||||
dict(
|
||||
params=dict(
|
||||
file='test_backup',
|
||||
format='custom',
|
||||
verbose=True,
|
||||
blobs=True,
|
||||
schemas=[],
|
||||
tables=[],
|
||||
database='postgres'
|
||||
),
|
||||
url='/backup/job/{0}/object',
|
||||
expected_params=dict(
|
||||
expected_cmd_opts=['--verbose', '--format=c',
|
||||
'--large-objects'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
),
|
||||
server_min_version=160000,
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
))
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
if hasattr(self, 'server_min_version') and \
|
||||
self.server_information['server_version'] < \
|
||||
self.server_min_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
if hasattr(self, 'server_max_version') and \
|
||||
self.server_information['server_version'] > \
|
||||
self.server_max_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
if 'default_binary_paths' not in self.server or \
|
||||
self.server['default_binary_paths'] is None or \
|
||||
self.server['type'] not in self.server['default_binary_paths'] or\
|
||||
@ -56,9 +91,9 @@ class BackupJobTest(BaseTestGenerator):
|
||||
if os.name == 'nt':
|
||||
binary_path = binary_path + '.exe'
|
||||
|
||||
retVal = does_utility_exist(binary_path)
|
||||
if retVal is not None:
|
||||
self.skipTest(retVal)
|
||||
ret_val = does_utility_exist(binary_path)
|
||||
if ret_val is not None:
|
||||
self.skipTest(ret_val)
|
||||
|
||||
def runTest(self):
|
||||
self.server_id = parent_node_dict["server"][-1]["server_id"]
|
||||
@ -75,6 +110,5 @@ class BackupJobTest(BaseTestGenerator):
|
||||
self.assertEqual
|
||||
)
|
||||
|
||||
if backup_file is not None:
|
||||
if os.path.isfile(backup_file):
|
||||
os.remove(backup_file)
|
||||
if backup_file is not None and os.path.isfile(backup_file):
|
||||
os.remove(backup_file)
|
||||
|
@ -23,7 +23,7 @@ import pgadmin.tools.backup.tests.test_backup_utils as backup_utils
|
||||
class RestoreJobTest(BaseTestGenerator):
|
||||
"""Backup api test cases"""
|
||||
scenarios = [
|
||||
('When restore the object with the default options',
|
||||
('When restore the object with the default options (< v16)',
|
||||
dict(
|
||||
params=dict(
|
||||
file='test_restore_file',
|
||||
@ -56,11 +56,63 @@ class RestoreJobTest(BaseTestGenerator):
|
||||
expected_exit_code=[0, None]
|
||||
)
|
||||
|
||||
)
|
||||
),
|
||||
server_max_version=159999,
|
||||
message='--blobs is deprecated and is not supported by EPAS/PG '
|
||||
'server greater than 15'
|
||||
)),
|
||||
('When restore the object with the default options (>= v16)',
|
||||
dict(
|
||||
params=dict(
|
||||
file='test_restore_file',
|
||||
format='custom',
|
||||
custom=False,
|
||||
verbose=True,
|
||||
blobs=True,
|
||||
schemas=[],
|
||||
tables=[],
|
||||
database='test_restore_database'
|
||||
),
|
||||
url='/restore/job/{0}',
|
||||
expected_cmd_opts=['--verbose'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None],
|
||||
backup_options=dict(
|
||||
params=dict(
|
||||
file='test_restore_file',
|
||||
format='custom',
|
||||
verbose=True,
|
||||
blobs=True,
|
||||
schemas=[],
|
||||
tables=[],
|
||||
database='test_restore_database'
|
||||
),
|
||||
url='/backup/job/{0}/object',
|
||||
expected_params=dict(
|
||||
expected_cmd_opts=['--verbose', '--format=c',
|
||||
'--large-objects'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
)
|
||||
|
||||
),
|
||||
server_min_version=160000,
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
))
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
if hasattr(self, 'server_min_version') and \
|
||||
self.server_information['server_version'] < \
|
||||
self.server_min_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
if hasattr(self, 'server_max_version') and \
|
||||
self.server_information['server_version'] > \
|
||||
self.server_max_version:
|
||||
self.skipTest(self.message)
|
||||
|
||||
if 'default_binary_paths' not in self.server or \
|
||||
self.server['default_binary_paths'] is None or \
|
||||
self.server['type'] not in self.server['default_binary_paths'] or\
|
||||
@ -78,9 +130,9 @@ class RestoreJobTest(BaseTestGenerator):
|
||||
if os.name == 'nt':
|
||||
binary_path = binary_path + '.exe'
|
||||
|
||||
retVal = does_utility_exist(binary_path)
|
||||
if retVal is not None:
|
||||
self.skipTest(retVal)
|
||||
ret_val = does_utility_exist(binary_path)
|
||||
if ret_val is not None:
|
||||
self.skipTest(ret_val)
|
||||
|
||||
def create_backup(self):
|
||||
url = self.backup_options['url'].format(self.server_id)
|
||||
@ -187,9 +239,8 @@ class RestoreJobTest(BaseTestGenerator):
|
||||
|
||||
self.assertEqual(restore_ack_res['success'], 1)
|
||||
|
||||
if self.backup_file is not None:
|
||||
if os.path.isfile(self.backup_file):
|
||||
os.remove(self.backup_file)
|
||||
if self.backup_file is not None and os.path.isfile(self.backup_file):
|
||||
os.remove(self.backup_file)
|
||||
|
||||
@staticmethod
|
||||
def get_params(data):
|
||||
|
Loading…
Reference in New Issue
Block a user