mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-11-02 20:30:17 -06:00
Added support for PostgreSQL and EPAS 16 to ensure it works without any errors. #6588
This commit is contained in:
1 parent
31fddaf10b
commit
0f86b78d87
24 files changed
+1514
-31
No files matched your search
+19
@@ -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;
|
||||
+20
@@ -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;
|
||||
+19
@@ -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;
|
||||
+18
@@ -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';
|
||||
|
||||
+20
@@ -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;
|
||||
|
||||
+17
@@ -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;
|
||||
+259
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
+225
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+19
@@ -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;
|
||||
+20
@@ -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;
|
||||
+15
@@ -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;
|
||||
+17
@@ -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';
|
||||
+20
@@ -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;
|
||||
|
||||
+17
@@ -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;
|
||||
+259
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
+207
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+15
@@ -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"]
|
||||
|
||||
+28
-2
@@ -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/",
|
||||
|
||||
+8
@@ -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();
|
||||
+40
@@ -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;
|
||||
Reference in new issue
Block a user