fix: Fixed the resql tests - use <OWNER> placeholder instead of hardcoded 'postgres' role (#9873)

The reverse-engineered SQL tests hardcoded 'postgres' as the role name
in test JSON data and expected SQL files. This fails on systems where
the superuser is not 'postgres' (e.g. 'ashesh.vashi').

Changes:
- Replace hardcoded 'postgres' with '<OWNER>' placeholder in ~400 test
  JSON, SQL, and MSQL files across all browser module tests
- Extend test_resql.py to resolve '<OWNER>' in scenario data sent to
  API endpoints (not just in expected SQL)
- Handle identifier quoting for usernames containing special characters
  (dots, etc.) by normalizing both expected and actual SQL
- Fix test_domain_sql.py to use qtIdent for username in expected SQL
- Split Authlib version pin: 1.6.x for Python <=3.9, 1.7.x for >3.9
This commit is contained in:
Ashesh Vashi authored and GitHub committed 2026-04-24 21:18:38 +05:30
1 parent b70d4c9857
commit d112dc3b96
407 files changed
+16164 -13163

No files matched your search

+4 -2
View File
@@ -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
@@ -7,7 +7,7 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#"
FOREIGN DATA WRAPPER test_fdw_for_fs;
ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#"
IS 'Test comment';
@@ -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 <OWNER>;
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 <OWNER>;
@@ -7,9 +7,9 @@ CREATE SERVER "FS_$%{}[]()&*^!@""'`\/#"
FOREIGN DATA WRAPPER test_fdw_for_fs;
ALTER SERVER "FS_$%{}[]()&*^!@""'`\/#"
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#"
IS 'Test comment';
GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO postgres;
GRANT USAGE ON FOREIGN SERVER "FS_$%{}[]()&*^!@""'`\/#" TO <OWNER>;
@@ -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 <OWNER>;
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 <OWNER>;
@@ -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 <OWNER>;
COMMENT ON SERVER "FS_$%{}[]()&*^!@""'`\/#"
IS 'Test comment';
@@ -32,11 +32,11 @@
"fsrvoption":"port",
"fsrvvalue":"5450"
}],
"fsrvowner":"postgres",
"fsrvowner":"<OWNER>",
"description":"Test comment",
"fsrvacl":[{
"grantee":"PUBLIC",
"grantor":"postgres",
"grantor":"<OWNER>",
"privileges":[{
"privilege_type":"U",
"privilege":true,
@@ -60,7 +60,7 @@
"sql_endpoint": "NODE-foreign_server.sql_id",
"data": {
"name":"FS_$%{}[]()&*^!@\"'`\\/#",
"fsrvowner":"postgres"
"fsrvowner":"<OWNER>"
}
}, {
"type": "alter",
@@ -96,7 +96,7 @@
"fsrvacl":{
"added": [{
"grantee":"PUBLIC",
"grantor":"postgres",
"grantor":"<OWNER>",
"privileges":[{
"privilege_type":"U",
"privilege":true,
@@ -129,7 +129,7 @@
"fsrvacl":{
"deleted": [{
"grantee":"PUBLIC",
"grantor":"postgres",
"grantor":"<OWNER>",
"privileges":[{
"privilege_type":"U",
"privilege":true,
@@ -1,6 +1,6 @@
-- User Mapping : postgres
-- User Mapping : <OWNER>
-- DROP USER MAPPING IF EXISTS FOR postgres SERVER test_fs_for_user_mapping
-- DROP USER MAPPING IF EXISTS FOR <OWNER> SERVER test_fs_for_user_mapping
CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping
CREATE USER MAPPING FOR <OWNER> SERVER test_fs_for_user_mapping
OPTIONS ("user" 'test_user12', password 'secret123');
@@ -1,5 +1,5 @@
-- User Mapping : postgres
-- User Mapping : <OWNER>
-- DROP USER MAPPING IF EXISTS FOR postgres SERVER test_fs_for_user_mapping
-- DROP USER MAPPING IF EXISTS FOR <OWNER> SERVER test_fs_for_user_mapping
CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping;
CREATE USER MAPPING FOR <OWNER> SERVER test_fs_for_user_mapping;
@@ -1,2 +1,2 @@
ALTER USER MAPPING FOR postgres SERVER test_fs_for_user_mapping
ALTER USER MAPPING FOR <OWNER> SERVER test_fs_for_user_mapping
OPTIONS (DROP "user", DROP password);
@@ -1,2 +1,2 @@
ALTER USER MAPPING FOR postgres SERVER test_fs_for_user_mapping
ALTER USER MAPPING FOR <OWNER> SERVER test_fs_for_user_mapping
OPTIONS (SET "user" 'test_user12', SET password 'secret123');
@@ -1,6 +1,6 @@
-- User Mapping : postgres
-- User Mapping : <OWNER>
-- DROP USER MAPPING IF EXISTS FOR postgres SERVER test_fs_for_user_mapping
-- DROP USER MAPPING IF EXISTS FOR <OWNER> SERVER test_fs_for_user_mapping
CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping
CREATE USER MAPPING FOR <OWNER> SERVER test_fs_for_user_mapping
OPTIONS ("user" 'test_user', password 'secret');
@@ -1,2 +1,2 @@
CREATE USER MAPPING FOR postgres SERVER test_fs_for_user_mapping
CREATE USER MAPPING FOR <OWNER> SERVER test_fs_for_user_mapping
OPTIONS ("user" 'test_user', password 'secret');
@@ -27,7 +27,7 @@
"sql_endpoint": "NODE-user_mapping.sql_id",
"msql_endpoint": "NODE-user_mapping.msql",
"data": {
"name": "postgres",
"name": "<OWNER>",
"umoptions":[{
"umoption":"user",
"umvalue":"test_user"
@@ -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 <OWNER> WITH GRANT OPTION;
@@ -103,7 +103,7 @@
"fdwacl": {
"added":[{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges":[
{
"privilege_type": "U",
@@ -111,8 +111,8 @@
"with_grant": false
}]
},{
"grantee": "postgres",
"grantor": "postgres",
"grantee": "<OWNER>",
"grantor": "<OWNER>",
"privileges":[{
"privilege_type": "U",
"privilege": true,
@@ -262,7 +262,7 @@
"lanproc": "plpgsql_call_handler",
"lanval": null,
"description": null,
"lanowner": "postgres",
"lanowner": "<OWNER>",
"laninl": null,
"seclabels": null
}
@@ -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 <OWNER> WITH GRANT OPTION;
@@ -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 <OWNER> WITH GRANT OPTION;
@@ -1,2 +1,2 @@
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM PUBLIC;
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM postgres;
REVOKE ALL ON LANGUAGE "Lan2_$%{}[]()&*^!@""'`\/#" FROM <OWNER>;
@@ -40,7 +40,7 @@
"lanacl": {
"added":[{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges":[
{
"privilege_type": "U",
@@ -48,8 +48,8 @@
"with_grant": false
}]
},{
"grantee": "postgres",
"grantor": "postgres",
"grantee": "<OWNER>",
"grantor": "<OWNER>",
"privileges":[{
"privilege_type": "U",
"privilege": true,
@@ -70,7 +70,7 @@
"lanacl": {
"deleted":[{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges":[
{
"privilege_type": "U",
@@ -78,8 +78,8 @@
"with_grant": false
}]
},{
"grantee": "postgres",
"grantor": "postgres",
"grantee": "<OWNER>",
"grantor": "<OWNER>",
"privileges":[{
"privilege_type": "U",
"privilege": true,
@@ -64,7 +64,7 @@
"evnt_update": true,
"evnt_delete": false,
"evnt_truncate": false,
"pubowner": "postgres",
"pubowner": "<OWNER>",
"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": "<OWNER>",
"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"
@@ -84,7 +84,7 @@
"evnt_update": true,
"evnt_delete": false,
"evnt_truncate": false,
"pubowner": "postgres",
"pubowner": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"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"
@@ -64,7 +64,7 @@
"evnt_update": true,
"evnt_delete": false,
"evnt_truncate": false,
"pubowner": "postgres",
"pubowner": "<OWNER>",
"all_table": true,
"pubtable": ""
},
@@ -115,10 +115,12 @@
"evnt_update": true,
"evnt_delete": true,
"evnt_truncate": true,
"pubowner": "postgres",
"pubowner": "<OWNER>",
"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"
@@ -44,7 +44,7 @@
"data": {
"name": "Cl1_$%{}[]()&*^!@\"'`\\/#b",
"schema": "testschema",
"owner": "postgres",
"owner": "<OWNER>",
"description": "Description for extra params",
"locale": "locale",
"provider": "icu",
@@ -70,7 +70,7 @@
"data": {
"name": "Cl1_$%{}[]()&*^!@\"'`\\/#b",
"schema": "testschema",
"owner": "postgres",
"owner": "<OWNER>",
"description": "libc",
"locale": "C",
"provider": "libc",
@@ -44,7 +44,7 @@
"data": {
"name": "Cl1_$%{}[]()&*^!@\"'`\\/#b",
"schema": "testschema",
"owner": "postgres",
"owner": "<OWNER>",
"description": "Description for extra params",
"locale": "locale",
"provider": "icu",
@@ -70,7 +70,7 @@
"data": {
"name": "Cl1_$%{}[]()&*^!@\"'`\\/#b",
"schema": "testschema",
"owner": "postgres",
"owner": "<OWNER>",
"description": "libc",
"locale": "C",
"provider": "libc",
@@ -95,7 +95,7 @@
"data": {
"name": "Cl1_$%{}[]()&*^!@\"'`\\/#b",
"schema": "testschema",
"owner": "postgres",
"owner": "<OWNER>",
"description": "builtin",
"locale": "C",
"provider": "builtin",
@@ -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 <OWNER>;
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
@@ -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 <OWNER>;
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
@@ -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 <OWNER>;
ALTER DOMAIN public."Dom2_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
@@ -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 <OWNER>;
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
@@ -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 <OWNER>;
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
@@ -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 <OWNER>;
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
IS 'test_comment';
@@ -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 <OWNER>;
ALTER DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT constraint_1 CHECK (3 < 5);
@@ -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 <OWNER>;
COMMENT ON DOMAIN public."Dom1_$%{}[]()&*^!@""'`\/#"
IS 'test_comment';
@@ -9,7 +9,7 @@
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
"schema": "public",
"schema_id": "<SCHEMA_ID>",
"owner": "postgres",
"owner": "<OWNER>",
"basensp": "public",
"description": "test_comment",
"basetype": "text",
@@ -90,7 +90,7 @@
"name": "Dom1_$%{}[]()&*^!@\"'`\\/#",
"schema": "public",
"schema_id": "<SCHEMA_ID>",
"owner": "postgres",
"owner": "<OWNER>",
"basensp": "public",
"description": "test_comment",
"basetype": "numeric",
@@ -101,13 +101,16 @@ class DomainReverseEngineeredSQLTestCase(BaseTestGenerator):
# 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)
@@ -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": "<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_$%{}[]()&*^!@\"'`\\/#"
}
}
]}
]
}
@@ -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": "<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_$%{}[]()&*^!@\"'`\\/#"
}
}
]}
]
}
@@ -241,7 +241,7 @@
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges": [
{
"privilege_type": "U",
@@ -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": "<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": "<OWNER>",
"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": "<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": "<OWNER>",
"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": "<OWNER>",
"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",
@@ -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 <OWNER>;
ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT cons1 CHECK (true) NO INHERIT;
@@ -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 <OWNER>;
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 <OWNER>;
@@ -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 <OWNER>;
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 <OWNER>;
ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
@@ -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 <OWNER>;
COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
IS 'Test Comment';
@@ -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 <OWNER>;
COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
IS 'Test Comment';
GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO postgres;
GRANT ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" TO <OWNER>;
ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
@@ -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 <OWNER>;
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 <OWNER>;
@@ -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 <OWNER>;
ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
ADD CONSTRAINT cons1 CHECK (true) NO INHERIT;
@@ -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": "<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": "<OWNER>",
"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": "<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": "<OWNER>",
"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": "<OWNER>",
"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",
@@ -12,11 +12,12 @@
"options": [],
"schema": "test",
"schema_id": "<SCHEMA_ID>",
"owner": "postgres"
"owner": "<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",
@@ -12,7 +12,7 @@
"options": [],
"schema": "public",
"schema_id": "<SCHEMA_ID>",
"owner": "postgres"
"owner": "<OWNER>"
},
"expected_sql_file": "create_fts_dictionary.sql",
"expected_msql_file": "msql_create_fts_dictionary.sql"
@@ -1 +1 @@
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO <OWNER>;
@@ -16,9 +16,9 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO <OWNER>;
@@ -17,4 +17,4 @@ end
$BODY$;
ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -1,3 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
@@ -16,6 +16,6 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
@@ -16,7 +16,7 @@ end
$BODY$;
ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
IS 'Some comment';
@@ -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 <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -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 <OWNER>;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
@@ -13,7 +13,7 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
@@ -12,7 +12,7 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';
@@ -13,7 +13,7 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';
@@ -14,7 +14,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
@@ -14,7 +14,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
@@ -16,7 +16,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
@@ -17,7 +17,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
@@ -16,9 +16,9 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION;
GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO <OWNER> WITH GRANT OPTION;
REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
@@ -11,4 +11,4 @@ end
$BODY$;
ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -16,5 +16,5 @@ end
$BODY$;
ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -11,4 +11,4 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -14,4 +14,4 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -17,9 +17,9 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO postgres WITH GRANT OPTION;
GRANT EXECUTE ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() TO <OWNER> WITH GRANT OPTION;
REVOKE ALL ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
@@ -12,4 +12,4 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -8,7 +8,7 @@
"sql_endpoint": "NODE-function.sql_id",
"data": {
"name": "Function1_$%{}[]()&*^!@\"'`\\/#",
"funcowner": "postgres",
"funcowner": "<OWNER>",
"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": "<OWNER>",
"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": "<OWNER>",
"pronamespace": 2200,
"prorettypename": "character varying",
"lanname": "plpgsql",
@@ -196,8 +194,8 @@
"acl": {
"added": [
{
"grantee": "postgres",
"grantor": "postgres",
"grantee": "<OWNER>",
"grantor": "<OWNER>",
"privileges": [
{
"privilege_type": "X",
@@ -223,7 +221,7 @@
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges": [
{
"privilege_type": "X",
@@ -247,8 +245,8 @@
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"grantor": "<OWNER>",
"old_grantee": "<OWNER>",
"privileges": [
{
"privilege_type": "X",
@@ -274,7 +272,7 @@
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges": [
{
"privilege_type": "X",
@@ -284,8 +282,8 @@
]
},
{
"grantee": "postgres",
"grantor": "postgres",
"grantee": "<OWNER>",
"grantor": "<OWNER>",
"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": "<OWNER>",
"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": {}
}
]
}
@@ -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": "<OWNER>",
"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": "<OWNER>",
"privileges": [
{
"privilege": true,
@@ -68,8 +82,8 @@
]
},
{
"grantee": "postgres",
"grantor": "postgres",
"grantee": "<OWNER>",
"grantor": "<OWNER>",
"privileges": [
{
"privilege": true,
@@ -92,7 +106,7 @@
"deleted": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"grantor": "<OWNER>",
"privileges": [
{
"privilege": true,
@@ -115,8 +129,8 @@
"changed": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"old_grantee": "postgres",
"grantor": "<OWNER>",
"old_grantee": "<OWNER>",
"privileges": [
{
"privilege": true,
@@ -135,8 +149,7 @@
"type": "delete",
"name": "Drop procedure",
"endpoint": "NODE-procedure.delete_id",
"data": {
}
"data": {}
}
]
}
@@ -9,7 +9,7 @@
"name": "Trig1_$%{}[]()&*^!@\"'`\\/#",
"acl": [],
"args": [],
"funcowner": "postgres",
"funcowner": "<OWNER>",
"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": "<OWNER>",
"grantor": "<OWNER>",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": true
}
]
}
],
"args": [],
"description": "some comment",
"funcowner": "postgres",
"funcowner": "<OWNER>",
"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": "<OWNER>",
"grantor": "<OWNER>",
"privileges": [
{
"privilege": true,
"privilege_type": "X",
"with_grant": true
}
]
}
],
"args": [],
"description": "some comment",
"funcowner": "postgres",
"funcowner": "<OWNER>",
"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": {}
}
]
}
@@ -16,8 +16,8 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO <OWNER>;
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM PUBLIC;
@@ -1 +1 @@
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO <OWNER>;
@@ -16,9 +16,9 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO postgres;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO <OWNER>;
@@ -17,4 +17,4 @@ end
$BODY$;
ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -1,3 +1,3 @@
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM postgres;
REVOKE ALL ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() FROM <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
@@ -16,6 +16,6 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"() TO PUBLIC;
@@ -16,7 +16,7 @@ end
$BODY$;
ALTER FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Function1_$%{}[]()&*^!@""'`\/#"(character varying)
IS 'Some comment';
@@ -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 <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function2_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -16,4 +16,4 @@ end
$BODY$;
ALTER FUNCTION public."Function3_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
@@ -1,3 +1,3 @@
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 <OWNER>;
@@ -13,11 +13,11 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
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 <OWNER>;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';
@@ -1,3 +1,3 @@
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM postgres;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM <OWNER>;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
@@ -13,7 +13,7 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO PUBLIC;
@@ -12,7 +12,7 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';
@@ -13,9 +13,9 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO postgres;
GRANT EXECUTE ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) TO <OWNER>;
REVOKE ALL ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer) FROM PUBLIC;
@@ -13,7 +13,7 @@ end;
$BODY$;
ALTER PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer)
IS 'some comment';
@@ -14,7 +14,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
@@ -14,7 +14,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
@@ -16,7 +16,7 @@ end;
$BODY$;
ALTER FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
OWNER TO postgres;
OWNER TO <OWNER>;
COMMENT ON FUNCTION public."Trig1_$%{}[]()&*^!@""'`\/#"()
IS 'some comment';
Loaded 100 of 407 files, more files were not shown because too many files have changed in this diff. Show more