Added RESQL/MSQL test cases for Table and its child nodes. Fixes #4622

This commit is contained in:
Yogesh Mahajan 2021-06-09 18:16:50 +05:30 committed by Akshay Joshi
parent d276f37e87
commit b2042f48cd
460 changed files with 23934 additions and 584 deletions

View File

@ -22,6 +22,7 @@ New features
Housekeeping
************
| `Issue #4622 <https://redmine.postgresql.org/issues/4622>`_ - Added RESQL/MSQL test cases for Table and its child nodes.
| `Issue #6225 <https://redmine.postgresql.org/issues/6225>`_ - Updated Flask-Security-Too to the latest v4.
| `Issue #6460 <https://redmine.postgresql.org/issues/6460>`_ - Added a mechanism to detect a corrupt/broken config database file.

View File

@ -0,0 +1,4 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__1_$%{}[]()&*^!@""'`\/#" SET DEFAULT 'changed default value';
GRANT SELECT("col__1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,11 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'changed default value'::text;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
IS 'test comment';
GRANT SELECT("col__1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,7 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" TYPE time(6) with time zone ;
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" SET NOT NULL;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment modification';

View File

@ -0,0 +1,9 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(6) with time zone NOT NULL DEFAULT now();
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment modification';

View File

@ -0,0 +1,3 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=2);

View File

@ -0,0 +1,13 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
IS 'comment';
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=2);

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
IS 'demo comments';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -0,0 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text DEFAULT 'xyz';
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,9 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'xyz'::text;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,9 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,9 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
IS 'comment';
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=1);

View File

@ -0,0 +1,13 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
IS 'comment';
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=1);

View File

@ -26,8 +26,8 @@
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
@ -138,10 +138,9 @@
"is_primary_key": false,
"attnotnull": false,
"attlen": "50",
"attprecision": null,
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": null
"seclabels": []
},
"expected_sql_file": "create_column_char.sql",
"expected_msql_file": "create_column_char.msql"
@ -211,8 +210,8 @@
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "a",
@ -398,8 +397,8 @@
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "d",
@ -468,8 +467,8 @@
"description": "demo comments",
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attidentity": "d",
"seqincrement": "1",
"seqstart": "1",
@ -526,6 +525,174 @@
"data": {
"name": "col_6_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with text & default value",
"endpoint": "NODE-column.obj",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql",
"data": {
"name": "col__1_$%{}[]()&*^!@\"'`\\/#",
"cltype": "text",
"attacl": [],
"description": "test comment",
"is_primary_key": false,
"attnotnull": false,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "n",
"attoptions": [],
"seclabels": [],
"defval": "'xyz'"
},
"expected_sql_file": "create_column_text_with_default_value.sql",
"expected_msql_file": "create_column_text_with_default_value.msql"
},
{
"type": "alter",
"name": "Alter Column with text & update default value",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql_id",
"data": {
"name": "col__1_$%{}[]()&*^!@\"'`\\/#",
"defval": "'changed default value'",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_text_with_default_value.sql",
"expected_msql_file": "alter_column_text_with_default_value.msql"
},
{
"type": "delete",
"name": "Drop Column with identity (ALWAYS)",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"data": {
"name": "col__1_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with time with time zone & default value using function",
"endpoint": "NODE-column.obj",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql",
"data": {
"name": "col__2_$%{}[]()&*^!@\"'`\\/#",
"cltype": "time with time zone",
"attacl": [],
"description": "test comment",
"min_val_attlen": 0,
"max_val_attlen": 6,
"is_primary_key": false,
"attnotnull": false,
"attlen": "4",
"attprecision": null,
"attidentity": "a",
"colconstype": "n",
"attoptions": [],
"seclabels": [],
"defval": "now()"
},
"expected_sql_file": "create_column_timestamp_with_default_value_using_function.sql",
"expected_msql_file": "create_column_timestamp_with_default_value_using_function.msql"
},
{
"type": "alter",
"name": "Alter Column with time with time zone & update length",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql_id",
"data": {
"name": "col__2_$%{}[]()&*^!@\"'`\\/#",
"attlen": "6",
"attnotnull": true,
"description": "test comment modification"
},
"expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql",
"expected_msql_file": "alter_column_timestamp_with_default_value_using_function.msql"
},
{
"type": "delete",
"name": "Drop Column with identity (ALWAYS)",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"data": {
"name": "col__2_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with interger_array and options",
"endpoint": "NODE-column.obj",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql",
"data": {
"name": "col__3_$%{}[]()&*^!@\"'`\\/#",
"cltype": "integer[]",
"attacl": [],
"description": "comment",
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "n",
"attoptions": [
{
"name": "n_distinct",
"value": "1"
}
],
"seclabels": []
},
"expected_sql_file": "create_column_with_interger_array_and_options.sql",
"expected_msql_file": "create_column_with_interger_array_and_options.msql"
},
{
"type": "alter",
"name": "Alter Column with interger_array and options",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql_id",
"data": {
"name": "col__3_$%{}[]()&*^!@\"'`\\/#",
"attoptions": {
"changed": [
{
"name": "n_distinct",
"value": "2"
}
]
}
},
"expected_sql_file": "alter_column_with_interger_array_and_options.sql",
"expected_msql_file": "alter_column_with_interger_array_and_options.msql"
},
{
"type": "delete",
"name": "Drop Column with identity (ALWAYS)",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"data": {
"name": "col__3_$%{}[]()&*^!@\"'`\\/#"
}
}
]
}

View File

@ -2,7 +2,7 @@ ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character COLLATE pg_catalog."C";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;

View File

@ -0,0 +1,4 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__1_$%{}[]()&*^!@""'`\/#" SET DEFAULT 'changed default value';
GRANT SELECT("col__1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,11 @@
-- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'changed default value'::text;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
IS 'test comment';
GRANT SELECT("col__1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,7 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" TYPE time(6) with time zone ;
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" SET NOT NULL;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment modification';

View File

@ -0,0 +1,9 @@
-- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(6) with time zone NOT NULL DEFAULT now();
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment modification';

View File

@ -0,0 +1,3 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=2);

View File

@ -0,0 +1,13 @@
-- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
IS 'comment';
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=2);

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint(None, None) GENERATED ALWAYS AS (1 + 2 + 3) STORED;
ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (1 + 2 + 3) STORED;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint(None, None) GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -0,0 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text DEFAULT 'xyz';
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,9 @@
-- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'xyz'::text;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,9 @@
-- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
IS 'test comment';

View File

@ -0,0 +1,9 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
IS 'comment';
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=1);

View File

@ -0,0 +1,13 @@
-- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
-- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
IS 'comment';
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
SET (n_distinct=1);

View File

@ -22,15 +22,15 @@
"data": {
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
},
"expected_sql_file": "create_column_int.sql",
"expected_msql_file": "create_column_int.msql"
@ -45,8 +45,37 @@
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"cltype":"real",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "real",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_int.sql",
"expected_msql_file": "alter_column_int.msql"
@ -60,7 +89,26 @@
"data": {
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"attacl":{"changed":[{"grantee":"postgres", "grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false}]}]}
"attacl": {
"changed": [
{
"grantee": "postgres",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_alt_privilege.sql",
"expected_msql_file": "alter_column_alt_privilege.msql"
@ -83,16 +131,15 @@
"data": {
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"character varying",
"cltype": "character varying",
"collspcname": "pg_catalog.\"C\"",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":"50",
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":null
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "50",
"attprecision": "",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_char.sql",
"expected_msql_file": "create_column_char.msql"
@ -106,12 +153,36 @@
"data": {
"attnum": 2,
"name": "new_col_2_$%{}[]()&*^!@\"'`\\/#",
"attlen": null,
"attlen": "",
"attstattarget": "5",
"attstorage": "p",
"description": "Comment for alter",
"cltype":"character",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "character",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_char.sql",
"expected_msql_file": "alter_column_char.msql"
@ -134,22 +205,22 @@
"data": {
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"attidentity":"a",
"seqincrement":"1",
"seqstart":"1",
"seqmin":"1",
"seqmax":"99999",
"seqcache":"10",
"seqcycle":true,
"colconstype":"i"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "a",
"seqincrement": "1",
"seqstart": "1",
"seqmin": "1",
"seqmax": "99999",
"seqcache": "10",
"seqcycle": true,
"colconstype": "i"
},
"expected_sql_file": "create_column_int_identity.sql",
"expected_msql_file": "create_column_int_identity.msql"
@ -164,7 +235,31 @@
"attnum": 3,
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_identity.sql",
"expected_msql_file": "alter_column_identity.msql"
@ -200,17 +295,17 @@
"data": {
"name": "col_4_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":null,
"attprecision":null,
"attidentity":"a",
"colconstype":"g",
"genexpr":"1 + 2 + 3",
"attoptions":[],
"seclabels":[]
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "g",
"genexpr": "1 + 2 + 3",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_int_generated.sql",
"expected_msql_file": "create_column_int_generated.msql"
@ -225,7 +320,31 @@
"attnum": 4,
"name": "new_col_4_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_generated.sql",
"expected_msql_file": "alter_column_generated.msql"
@ -248,17 +367,22 @@
"data": {
"name": "col_5_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"min_val":0,
"max_val":1000,
"cltype":"numeric",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":"10",
"attprecision":"5",
"attidentity":"a",
"attoptions":[{"name":"n_distinct","value":"1"}],
"seclabels":[]
"min_val": 0,
"max_val": 1000,
"cltype": "numeric",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "10",
"attprecision": "5",
"attidentity": "a",
"attoptions": [
{
"name": "n_distinct",
"value": "1"
}
],
"seclabels": []
},
"expected_sql_file": "create_column_numeric.sql",
"expected_msql_file": "create_column_numeric.msql"
@ -272,10 +396,39 @@
"data": {
"name": "new_col_5_$%{}[]()&*^!@\"'`\\/#",
"attnum": 5,
"attlen":"15",
"attprecision":"6",
"attlen": "15",
"attprecision": "6",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_numeric.sql",
"expected_msql_file": "alter_column_numeric.msql"
@ -288,7 +441,7 @@
"msql_endpoint": "NODE-column.msql_id",
"data": {
"attnum": 3,
"attlen":""
"attlen": ""
},
"expected_sql_file": "alter_column_remove_length.sql",
"expected_msql_file": "alter_column_remove_length.msql"
@ -302,7 +455,6 @@
"name": "new_col_5_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Dummy Column (Integer/Numeric type)",
@ -312,15 +464,15 @@
"data": {
"name": "dummy1",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
}
},
{
@ -332,15 +484,15 @@
"data": {
"name": "dummy2",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
}
},
{
@ -352,17 +504,17 @@
"data": {
"name": "col_8_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":null,
"attprecision":null,
"attidentity":"a",
"colconstype":"g",
"genexpr":"dummy1 + dummy2",
"attoptions":[],
"seclabels":[]
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "g",
"genexpr": "dummy1 + dummy2",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_int_generated_with_existing_columns.sql",
"expected_msql_file": "create_column_int_generated_with_existing_columns.msql"
@ -376,9 +528,33 @@
"data": {
"attnum": 8,
"name": "new_col_8_$%{}[]()&*^!@\"'`\\/#",
"genexpr":"dummy1 - dummy2",
"genexpr": "dummy1 - dummy2",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_generated_with_existing_columns.sql",
"expected_msql_file": "alter_column_generated_with_existing_columns.msql"
@ -392,7 +568,6 @@
"name": "new_col_8_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with identity (Generated by default)",
@ -402,22 +577,22 @@
"data": {
"name": "col_9_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"attidentity":"d",
"seqincrement":"1",
"seqstart":"1",
"seqmin":"1",
"seqmax":"99999",
"seqcache":"10",
"seqcycle":true,
"colconstype":"i"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "d",
"seqincrement": "1",
"seqstart": "1",
"seqmin": "1",
"seqmax": "99999",
"seqcache": "10",
"seqcycle": true,
"colconstype": "i"
},
"expected_sql_file": "create_column_int_identity_by_default.sql",
"expected_msql_file": "create_column_int_identity_by_default.msql"
@ -432,11 +607,11 @@
"attnum": 9,
"name": "new_col_9_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"seqincrement":"2",
"seqmax":"200",
"seqcache":"2",
"seqcycle":true,
"seqmin":"1"
"seqincrement": "2",
"seqmax": "200",
"seqcache": "2",
"seqcycle": true,
"seqmin": "1"
},
"expected_sql_file": "alter_column_identity_by_default.sql",
"expected_msql_file": "alter_column_identity_by_default.msql"
@ -534,6 +709,174 @@
"data": {
"name": "col_6_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with text & default value",
"endpoint": "NODE-column.obj",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql",
"data": {
"name": "col__1_$%{}[]()&*^!@\"'`\\/#",
"cltype": "text",
"attacl": [],
"description": "test comment",
"is_primary_key": false,
"attnotnull": false,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "n",
"attoptions": [],
"seclabels": [],
"defval": "'xyz'"
},
"expected_sql_file": "create_column_text_with_default_value.sql",
"expected_msql_file": "create_column_text_with_default_value.msql"
},
{
"type": "alter",
"name": "Alter Column with text & update default value",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql_id",
"data": {
"name": "col__1_$%{}[]()&*^!@\"'`\\/#",
"defval": "'changed default value'",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_text_with_default_value.sql",
"expected_msql_file": "alter_column_text_with_default_value.msql"
},
{
"type": "delete",
"name": "Drop Column with identity (ALWAYS)",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"data": {
"name": "col__1_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with time with time zone & default value using function",
"endpoint": "NODE-column.obj",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql",
"data": {
"name": "col__2_$%{}[]()&*^!@\"'`\\/#",
"cltype": "time with time zone",
"attacl": [],
"description": "test comment",
"min_val_attlen": 0,
"max_val_attlen": 6,
"is_primary_key": false,
"attnotnull": false,
"attlen": "4",
"attprecision": null,
"attidentity": "a",
"colconstype": "n",
"attoptions": [],
"seclabels": [],
"defval": "now()"
},
"expected_sql_file": "create_column_timestamp_with_default_value_using_function.sql",
"expected_msql_file": "create_column_timestamp_with_default_value_using_function.msql"
},
{
"type": "alter",
"name": "Alter Column with time with time zone & update length",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql_id",
"data": {
"name": "col__2_$%{}[]()&*^!@\"'`\\/#",
"attlen": "6",
"attnotnull": true,
"description": "test comment modification"
},
"expected_sql_file": "alter_column_timestamp_with_default_value_using_function.sql",
"expected_msql_file": "alter_column_timestamp_with_default_value_using_function.msql"
},
{
"type": "delete",
"name": "Drop Column with identity (ALWAYS)",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"data": {
"name": "col__2_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with interger_array and options",
"endpoint": "NODE-column.obj",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql",
"data": {
"name": "col__3_$%{}[]()&*^!@\"'`\\/#",
"cltype": "integer[]",
"attacl": [],
"description": "comment",
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "n",
"attoptions": [
{
"name": "n_distinct",
"value": "1"
}
],
"seclabels": []
},
"expected_sql_file": "create_column_with_interger_array_and_options.sql",
"expected_msql_file": "create_column_with_interger_array_and_options.msql"
},
{
"type": "alter",
"name": "Alter Column with interger_array and options",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"msql_endpoint": "NODE-column.msql_id",
"data": {
"name": "col__3_$%{}[]()&*^!@\"'`\\/#",
"attoptions": {
"changed": [
{
"name": "n_distinct",
"value": "2"
}
]
}
},
"expected_sql_file": "alter_column_with_interger_array_and_options.sql",
"expected_msql_file": "alter_column_with_interger_array_and_options.msql"
},
{
"type": "delete",
"name": "Drop Column with identity (ALWAYS)",
"endpoint": "NODE-column.obj_id",
"sql_endpoint": "NODE-column.sql_id",
"data": {
"name": "col__3_$%{}[]()&*^!@\"'`\\/#"
}
}
]
}

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -22,15 +22,15 @@
"data": {
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
},
"expected_sql_file": "create_column_int.sql",
"expected_msql_file": "create_column_int.msql"
@ -45,8 +45,37 @@
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"cltype":"real",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "real",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_int.sql",
"expected_msql_file": "alter_column_int.msql"
@ -60,7 +89,26 @@
"data": {
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"attacl":{"changed":[{"grantee":"postgres", "grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false}]}]}
"attacl": {
"changed": [
{
"grantee": "postgres",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_alt_privilege.sql",
"expected_msql_file": "alter_column_alt_privilege.msql"
@ -83,16 +131,15 @@
"data": {
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"character varying",
"cltype": "character varying",
"collspcname": "pg_catalog.\"C\"",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":"50",
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":null
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "50",
"attprecision": "",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_char.sql",
"expected_msql_file": "create_column_char.msql"
@ -110,8 +157,32 @@
"attstattarget": "5",
"attstorage": "p",
"description": "Comment for alter",
"cltype":"character",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "character",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_char.sql",
"expected_msql_file": "alter_column_char.msql"
@ -125,7 +196,6 @@
"name": "new_col_2_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column (Numeric type with Length Precision & Variables)",
@ -135,17 +205,22 @@
"data": {
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"min_val":0,
"max_val":1000,
"cltype":"numeric",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":"10",
"attprecision":"5",
"attidentity":"a",
"attoptions":[{"name":"n_distinct","value":"1"}],
"seclabels":[]
"min_val": 0,
"max_val": 1000,
"cltype": "numeric",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "10",
"attprecision": "5",
"attidentity": "a",
"attoptions": [
{
"name": "n_distinct",
"value": "1"
}
],
"seclabels": []
},
"expected_sql_file": "create_column_numeric.sql",
"expected_msql_file": "create_column_numeric.msql"
@ -159,10 +234,39 @@
"data": {
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
"attnum": 3,
"attlen":"15",
"attprecision":"6",
"attlen": "15",
"attprecision": "6",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "postgres",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_numeric.sql",
"expected_msql_file": "alter_column_numeric.msql"
@ -175,7 +279,7 @@
"msql_endpoint": "NODE-column.msql_id",
"data": {
"attnum": 3,
"attlen":""
"attlen": ""
},
"expected_sql_file": "alter_column_remove_length.sql",
"expected_msql_file": "alter_column_remove_length.msql"

View File

@ -0,0 +1,13 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
RENAME "col__1_$%{}[]()&*^!@""'`\/#" TO "col__1_$%{}[]&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__1_$%{}[]&*^!@""'`\/#" SET DEFAULT 'changed default value'::text;
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ALTER COLUMN "col__1_$%{}[]&*^!@""'`\/#" DROP NOT NULL;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]&*^!@""'`\/#"
IS 'test comment modify';
GRANT SELECT("col__1_$%{}[]&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -0,0 +1,11 @@
-- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]&*^!@""'`\/#"
-- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]&*^!@""'`\/#";
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col__1_$%{}[]&*^!@""'`\/#" text COLLATE pg_catalog."C" DEFAULT 'changed default value'::text;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]&*^!@""'`\/#"
IS 'test comment modify';
GRANT SELECT("col__1_$%{}[]&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
IS 'demo comments';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -26,8 +26,8 @@
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
@ -138,10 +138,9 @@
"is_primary_key": false,
"attnotnull": false,
"attlen": "50",
"attprecision": null,
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": null
"seclabels": []
},
"expected_sql_file": "create_column_char.sql",
"expected_msql_file": "create_column_char.msql"
@ -211,8 +210,8 @@
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "a",
@ -398,8 +397,8 @@
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "d",
@ -468,8 +467,8 @@
"description": "demo comments",
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attidentity": "d",
"seqincrement": "1",
"seqstart": "1",

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
IS 'demo comments';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint(None, None) GENERATED ALWAYS AS (1 + 2 + 3) STORED;
ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (1 + 2 + 3) STORED;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint(None, None) GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -22,15 +22,15 @@
"data": {
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
},
"expected_sql_file": "create_column_int.sql",
"expected_msql_file": "create_column_int.msql"
@ -45,8 +45,37 @@
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"cltype":"real",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "real",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_int.sql",
"expected_msql_file": "alter_column_int.msql"
@ -60,7 +89,26 @@
"data": {
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"attacl":{"changed":[{"grantee":"enterprisedb", "grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false}]}]}
"attacl": {
"changed": [
{
"grantee": "enterprisedb",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_alt_privilege.sql",
"expected_msql_file": "alter_column_alt_privilege.msql"
@ -83,16 +131,15 @@
"data": {
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"character varying",
"cltype": "character varying",
"collspcname": "pg_catalog.\"C\"",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":"50",
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":null
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "50",
"attprecision": "",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_char.sql",
"expected_msql_file": "create_column_char.msql"
@ -110,8 +157,32 @@
"attstattarget": "5",
"attstorage": "p",
"description": "Comment for alter",
"cltype":"character",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "character",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_char.sql",
"expected_msql_file": "alter_column_char.msql"
@ -134,22 +205,22 @@
"data": {
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"attidentity":"a",
"seqincrement":"1",
"seqstart":"1",
"seqmin":"1",
"seqmax":"99999",
"seqcache":"10",
"seqcycle":true,
"colconstype":"i"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "a",
"seqincrement": "1",
"seqstart": "1",
"seqmin": "1",
"seqmax": "99999",
"seqcache": "10",
"seqcycle": true,
"colconstype": "i"
},
"expected_sql_file": "create_column_int_identity.sql",
"expected_msql_file": "create_column_int_identity.msql"
@ -164,7 +235,31 @@
"attnum": 3,
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_identity.sql",
"expected_msql_file": "alter_column_identity.msql"
@ -200,17 +295,17 @@
"data": {
"name": "col_4_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":null,
"attprecision":null,
"attidentity":"a",
"colconstype":"g",
"genexpr":"1 + 2 + 3",
"attoptions":[],
"seclabels":[]
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "g",
"genexpr": "1 + 2 + 3",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_int_generated.sql",
"expected_msql_file": "create_column_int_generated.msql"
@ -225,7 +320,31 @@
"attnum": 4,
"name": "new_col_4_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_generated.sql",
"expected_msql_file": "alter_column_generated.msql"
@ -248,17 +367,22 @@
"data": {
"name": "col_5_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"min_val":0,
"max_val":1000,
"cltype":"numeric",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":"10",
"attprecision":"5",
"attidentity":"a",
"attoptions":[{"name":"n_distinct","value":"1"}],
"seclabels":[]
"min_val": 0,
"max_val": 1000,
"cltype": "numeric",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "10",
"attprecision": "5",
"attidentity": "a",
"attoptions": [
{
"name": "n_distinct",
"value": "1"
}
],
"seclabels": []
},
"expected_sql_file": "create_column_numeric.sql",
"expected_msql_file": "create_column_numeric.msql"
@ -272,10 +396,39 @@
"data": {
"name": "new_col_5_$%{}[]()&*^!@\"'`\\/#",
"attnum": 5,
"attlen":"15",
"attprecision":"6",
"attlen": "15",
"attprecision": "6",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_numeric.sql",
"expected_msql_file": "alter_column_numeric.msql"
@ -288,7 +441,7 @@
"msql_endpoint": "NODE-column.msql_id",
"data": {
"attnum": 3,
"attlen":""
"attlen": ""
},
"expected_sql_file": "alter_column_remove_length.sql",
"expected_msql_file": "alter_column_remove_length.msql"
@ -302,7 +455,6 @@
"name": "new_col_5_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Dummy Column (Integer/Numeric type)",
@ -312,15 +464,15 @@
"data": {
"name": "dummy1",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
}
},
{
@ -332,15 +484,15 @@
"data": {
"name": "dummy2",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
}
},
{
@ -352,17 +504,17 @@
"data": {
"name": "col_8_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":null,
"attprecision":null,
"attidentity":"a",
"colconstype":"g",
"genexpr":"dummy1 + dummy2",
"attoptions":[],
"seclabels":[]
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "",
"attprecision": "",
"attidentity": "a",
"colconstype": "g",
"genexpr": "dummy1 + dummy2",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_int_generated_with_existing_columns.sql",
"expected_msql_file": "create_column_int_generated_with_existing_columns.msql"
@ -376,9 +528,33 @@
"data": {
"attnum": 8,
"name": "new_col_8_$%{}[]()&*^!@\"'`\\/#",
"genexpr":"dummy1 - dummy2",
"genexpr": "dummy1 - dummy2",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_generated_with_existing_columns.sql",
"expected_msql_file": "alter_column_generated_with_existing_columns.msql"
@ -392,7 +568,6 @@
"name": "new_col_8_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column with identity (Generated by default)",
@ -402,22 +577,22 @@
"data": {
"name": "col_9_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"attidentity":"d",
"seqincrement":"1",
"seqstart":"1",
"seqmin":"1",
"seqmax":"99999",
"seqcache":"10",
"seqcycle":true,
"colconstype":"i"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"attidentity": "d",
"seqincrement": "1",
"seqstart": "1",
"seqmin": "1",
"seqmax": "99999",
"seqcache": "10",
"seqcycle": true,
"colconstype": "i"
},
"expected_sql_file": "create_column_int_identity_by_default.sql",
"expected_msql_file": "create_column_int_identity_by_default.msql"
@ -432,11 +607,11 @@
"attnum": 9,
"name": "new_col_9_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"seqincrement":"2",
"seqmax":"200",
"seqcache":"2",
"seqcycle":true,
"seqmin":"1"
"seqincrement": "2",
"seqmax": "200",
"seqcache": "2",
"seqcycle": true,
"seqmin": "1"
},
"expected_sql_file": "alter_column_identity_by_default.sql",
"expected_msql_file": "alter_column_identity_by_default.msql"
@ -476,8 +651,8 @@
"description": "demo comments",
"is_primary_key": false,
"attnotnull": true,
"attlen": null,
"attprecision": null,
"attlen": "",
"attprecision": "",
"attidentity": "d",
"seqincrement": "1",
"seqstart": "1",

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -1,5 +1,5 @@
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
IS 'Comment for create';

View File

@ -22,15 +22,15 @@
"data": {
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"bigint",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":null,
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":"1"
"cltype": "bigint",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "",
"attprecision": "",
"attoptions": [],
"seclabels": [],
"defval": "1"
},
"expected_sql_file": "create_column_int.sql",
"expected_msql_file": "create_column_int.msql"
@ -45,8 +45,37 @@
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for alter",
"cltype":"real",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "real",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_int.sql",
"expected_msql_file": "alter_column_int.msql"
@ -60,7 +89,26 @@
"data": {
"attnum": 1,
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
"attacl":{"changed":[{"grantee":"enterprisedb", "grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false}]}]}
"attacl": {
"changed": [
{
"grantee": "enterprisedb",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_alt_privilege.sql",
"expected_msql_file": "alter_column_alt_privilege.msql"
@ -83,16 +131,15 @@
"data": {
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"cltype":"character varying",
"cltype": "character varying",
"collspcname": "pg_catalog.\"C\"",
"attacl":[],
"is_primary_key":false,
"attnotnull":false,
"attlen":"50",
"attprecision":null,
"attoptions":[],
"seclabels":[],
"defval":null
"attacl": [],
"is_primary_key": false,
"attnotnull": false,
"attlen": "50",
"attprecision": "",
"attoptions": [],
"seclabels": []
},
"expected_sql_file": "create_column_char.sql",
"expected_msql_file": "create_column_char.msql"
@ -110,8 +157,32 @@
"attstattarget": "5",
"attstorage": "p",
"description": "Comment for alter",
"cltype":"character",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"cltype": "character",
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_char.sql",
"expected_msql_file": "alter_column_char.msql"
@ -125,7 +196,6 @@
"name": "new_col_2_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create Column (Numeric type with Length Precision & Variables)",
@ -135,17 +205,22 @@
"data": {
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
"description": "Comment for create",
"min_val":0,
"max_val":1000,
"cltype":"numeric",
"attacl":[],
"is_primary_key":false,
"attnotnull":true,
"attlen":"10",
"attprecision":"5",
"attidentity":"a",
"attoptions":[{"name":"n_distinct","value":"1"}],
"seclabels":[]
"min_val": 0,
"max_val": 1000,
"cltype": "numeric",
"attacl": [],
"is_primary_key": false,
"attnotnull": true,
"attlen": "10",
"attprecision": "5",
"attidentity": "a",
"attoptions": [
{
"name": "n_distinct",
"value": "1"
}
],
"seclabels": []
},
"expected_sql_file": "create_column_numeric.sql",
"expected_msql_file": "create_column_numeric.msql"
@ -159,10 +234,39 @@
"data": {
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
"attnum": 3,
"attlen":"15",
"attprecision":"6",
"attlen": "15",
"attprecision": "6",
"description": "Comment for alter",
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"enterprisedb","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
"attacl": {
"added": [
{
"grantee": "PUBLIC",
"grantor": "enterprisedb",
"privileges": [
{
"privilege_type": "a",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "r",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "w",
"privilege": true,
"with_grant": false
},
{
"privilege_type": "x",
"privilege": true,
"with_grant": false
}
]
}
]
}
},
"expected_sql_file": "alter_column_numeric.sql",
"expected_msql_file": "alter_column_numeric.msql"
@ -175,7 +279,7 @@
"msql_endpoint": "NODE-column.msql_id",
"data": {
"attnum": 3,
"attlen":""
"attlen": ""
},
"expected_sql_file": "alter_column_remove_length.sql",
"expected_msql_file": "alter_column_remove_length.msql"

View File

@ -0,0 +1,6 @@
ALTER TABLE public.tableforcon
ADD CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 1)
NOT VALID;
COMMENT ON CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" ON public.tableforcon
IS 'Comment for create';

View File

@ -0,0 +1,9 @@
-- Constraint: Chk_valid_$%{}[]()&*^!@"'`\/#
-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#";
ALTER TABLE testschema.tableforcon
ADD CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 200) NO INHERIT;
COMMENT ON CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
IS 'Comment for create';

View File

@ -0,0 +1,5 @@
ALTER TABLE testschema.tableforcon
ADD CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 200) NO INHERIT;
COMMENT ON CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
IS 'Comment for create';

View File

@ -30,7 +30,8 @@
"connoinherit": false,
"convalidated": true
},
"expected_sql_file": "create_check_constraint.sql"
"expected_sql_file": "create_check_constraint.sql",
"expected_msql_file": "create_check_constraint_msql.sql"
}, {
"type": "alter",
"name": "Alter Check Constraint",
@ -43,7 +44,7 @@
"comment": "Comment for alter"
},
"expected_sql_file": "alter_check_constraint.sql",
"expected_msql_file": "msql_check_constraint.sql"
"expected_msql_file": "alter_check_constraint_msql.sql"
}, {
"type": "delete",
"name": "Drop Check Constraint",
@ -51,6 +52,21 @@
"data": {
"name": "Chk_$%{}[]()&*^!@\"'`\\/#a"
}
},
{
"type": "create",
"name": "Create Check Constraint with valid = False, Inherit = True",
"endpoint": "NODE-check_constraint.obj",
"sql_endpoint": "NODE-check_constraint.sql_id",
"data": {
"name": "Chk_valid_$%{}[]()&*^!@\"'`\\/#",
"comment": "Comment for create",
"consrc": "col1 > 200",
"connoinherit": true,
"convalidated": false
},
"expected_sql_file": "create_check_constraint_with_valid.sql",
"expected_msql_file": "create_check_constraint_with_valid_msql.sql"
}, {
"type": "delete",
"name": "Drop Table for Check Constraint",

View File

@ -0,0 +1,10 @@
ALTER TABLE testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
(col1 + col3) WITH <>,
col2 WITH <>)
WITH (FILLFACTOR=12)
WHERE (col1 > 1)
DEFERRABLE INITIALLY DEFERRED;
COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" ON testschema.tableforexclusion
IS 'Comment for create';

View File

@ -0,0 +1,10 @@
ALTER TABLE testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING btree (
col2 text_pattern_ops WITH =)
INCLUDE (col1)
WITH (FILLFACTOR=12)
WHERE (col1 > 1)
DEFERRABLE INITIALLY DEFERRED;
COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" ON testschema.tableforexclusion
IS 'Comment for create';

View File

@ -7,23 +7,28 @@
"sql_endpoint": "NODE-table.sql_id",
"data": {
"name": "tableforexclusion",
"columns": [{
"columns": [
{
"name": "col1",
"cltype": "integer",
"is_primary_key": true
}, {
},
{
"name": "col2",
"cltype": "text"
}, {
},
{
"name": "col3",
"cltype": "integer"
}],
}
],
"is_partitioned": false,
"schema": "testschema",
"spcname": "pg_default"
},
"store_object_id": true
}, {
},
{
"type": "create",
"name": "Create Extension",
"endpoint": "NODE-extension.obj",
@ -33,7 +38,8 @@
"version": "",
"relocatable": true
}
}, {
},
{
"type": "create",
"name": "Create Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.obj",
@ -56,10 +62,14 @@
"oper_class": "text_pattern_ops"
}
],
"include": ["col1"]
"include": [
"col1"
]
},
"expected_sql_file": "create_exclusion_constraint.sql"
}, {
"expected_sql_file": "create_exclusion_constraint.sql",
"expected_msql_file": "create_exclusion_constraint_msql.sql"
},
{
"type": "alter",
"name": "Alter Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.obj_id",
@ -71,15 +81,17 @@
"fillfactor": "98"
},
"expected_sql_file": "alter_exclusion_constraint.sql",
"expected_msql_file": "msql_exclusion_constraint.sql"
}, {
"expected_msql_file": "alter_exclusion_constraint_msql.sql"
},
{
"type": "delete",
"name": "Drop Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.delete_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#a"
}
}, {
},
{
"type": "create",
"name": "Create Exclusion Constraint with expressions",
"endpoint": "NODE-exclusion_constraint.obj",
@ -111,8 +123,55 @@
}
]
},
"expected_sql_file": "create_exclusion_constraint_exp.sql"
}, {
"expected_sql_file": "create_exclusion_constraint_exp.sql",
"expected_msql_file": "create_exclusion_constraint_exp_msql.sql"
},
{
"type": "delete",
"name": "Drop Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.delete_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#_1a"
}
},
{
"type": "create",
"name": "Create Exclusion Constraint to remove Fillfactor",
"endpoint": "NODE-exclusion_constraint.obj",
"sql_endpoint": "NODE-exclusion_constraint.sql_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#_1",
"comment": "Comment for create",
"fillfactor": "12",
"amname": "gist",
"columns": [
{
"column": "col2",
"order": false,
"nulls_order": false,
"operator": "<>",
"is_sort_nulls_applicable": false,
"is_exp": false
}
]
},
"expected_sql_file": "create_without_fillfactor.sql"
},
{
"type": "alter",
"name": "Alter Exclusion Constraint to remove Fillfactor",
"endpoint": "NODE-exclusion_constraint.obj_id",
"sql_endpoint": "NODE-exclusion_constraint.sql_id",
"msql_endpoint": "NODE-exclusion_constraint.msql_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#_1a",
"comment": "Comment for alter",
"fillfactor": ""
},
"expected_sql_file": "alter_without_fillfactor.sql",
"expected_msql_file": "alter_without_fillfactor_msql.sql"
},
{
"type": "delete",
"name": "Drop Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.delete_id",

View File

@ -0,0 +1,9 @@
ALTER TABLE testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
col2 WITH <>)
WITH (FILLFACTOR=12)
WHERE (col1 > 1)
DEFERRABLE INITIALLY DEFERRED;
COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" ON testschema.tableforexclusion
IS 'Comment for create';

View File

@ -0,0 +1,7 @@
ALTER TABLE testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1" EXCLUDE USING gist (
col2 WITH <>)
WITH (FILLFACTOR=12);
COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1" ON testschema.tableforexclusion
IS 'Comment for create';

View File

@ -0,0 +1,10 @@
ALTER TABLE testschema.tableforexclusion
ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
col2 WITH <>,
(col1+col3) WITH <>)
WITH (FILLFACTOR=12)
WHERE (col1 > 1)
DEFERRABLE INITIALLY DEFERRED;
COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" ON testschema.tableforexclusion
IS 'Comment for create';

View File

@ -7,23 +7,28 @@
"sql_endpoint": "NODE-table.sql_id",
"data": {
"name": "tableforexclusion",
"columns": [{
"columns": [
{
"name": "col1",
"cltype": "integer",
"is_primary_key": true
}, {
},
{
"name": "col2",
"cltype": "text"
}, {
},
{
"name": "col3",
"cltype": "integer"
}],
}
],
"is_partitioned": false,
"schema": "testschema",
"spcname": "pg_default"
},
"store_object_id": true
}, {
},
{
"type": "create",
"name": "Create Extension",
"endpoint": "NODE-extension.obj",
@ -33,7 +38,8 @@
"version": "",
"relocatable": true
}
}, {
},
{
"type": "create",
"name": "Create Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.obj",
@ -57,8 +63,10 @@
}
]
},
"expected_sql_file": "create_exclusion_constraint.sql"
}, {
"expected_sql_file": "create_exclusion_constraint.sql",
"expected_msql_file": "create_exclusion_constraint_msql.sql"
},
{
"type": "alter",
"name": "Alter Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.obj_id",
@ -70,15 +78,17 @@
"fillfactor": "98"
},
"expected_sql_file": "alter_exclusion_constraint.sql",
"expected_msql_file": "msql_exclusion_constraint.sql"
}, {
"expected_msql_file": "alter_exclusion_constraint_msql.sql"
},
{
"type": "delete",
"name": "Drop Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.delete_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#a"
}
}, {
},
{
"type": "create",
"name": "Create Exclusion Constraint to remove Fillfactor",
"endpoint": "NODE-exclusion_constraint.obj",
@ -100,7 +110,8 @@
]
},
"expected_sql_file": "create_without_fillfactor.sql"
}, {
},
{
"type": "alter",
"name": "Alter Exclusion Constraint to remove Fillfactor",
"endpoint": "NODE-exclusion_constraint.obj_id",
@ -112,15 +123,17 @@
"fillfactor": ""
},
"expected_sql_file": "alter_without_fillfactor.sql",
"expected_msql_file": "msql_without_fillfactor.sql"
}, {
"expected_msql_file": "alter_without_fillfactor_msql.sql"
},
{
"type": "delete",
"name": "Drop Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.delete_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#_1a"
}
}, {
},
{
"type": "create",
"name": "Create Exclusion Constraint with expressions",
"endpoint": "NODE-exclusion_constraint.obj",
@ -152,14 +165,51 @@
}
]
},
"expected_sql_file": "create_exclusion_constraint_exp.sql"
}, {
"expected_sql_file": "create_exclusion_constraint_exp.sql",
"expected_msql_file": "exclusion_constraint_exp_msql.sql"
},
{
"type": "delete",
"name": "Drop Exclusion Constraint",
"endpoint": "NODE-exclusion_constraint.delete_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#_1a"
}
},
{
"type": "create",
"name": "Create Exclusion Constraint with expressions",
"endpoint": "NODE-exclusion_constraint.obj",
"sql_endpoint": "NODE-exclusion_constraint.sql_id",
"data": {
"name": "Exclusion_$%{}[]()&*^!@\"'`\\/#",
"comment": "Comment for create",
"fillfactor": "12",
"amname": "gist",
"condeferrable": true,
"condeferred": true,
"indconstraint": "col1 > 1",
"columns": [
{
"column": "col2",
"order": false,
"nulls_order": false,
"operator": "<>",
"is_sort_nulls_applicable": false,
"is_exp": false
},
{
"column": "(col1+col3)",
"order": false,
"nulls_order": false,
"operator": "<>",
"is_sort_nulls_applicable": false,
"is_exp": true
}
]
},
"expected_sql_file": "create_exclusion_constraint_exp.sql",
"expected_msql_file": "exclusion_constraint_exp_msql.sql"
}
]
}

View File

@ -20,7 +20,8 @@
"schema": "public"
},
"store_object_id": true
}, {
},
{
"type": "create",
"name": "Create btree index with ASC and NULLS LAST",
"endpoint": "NODE-index.obj",
@ -54,14 +55,16 @@
},
"expected_sql_file": "create_btree_asc_null_last.sql",
"expected_msql_file": "create_btree_asc_null_last_msql.sql"
}, {
},
{
"type": "delete",
"name": "Drop index",
"endpoint": "NODE-index.delete_id",
"data": {
"name": "Idx_$%{}[]()&*^!@\"'`\\/#"
}
}, {
},
{
"type": "create",
"name": "Create btree index with ASC and NULLS FIRST",
"endpoint": "NODE-index.obj",
@ -95,14 +98,16 @@
},
"expected_sql_file": "create_btree_asc_null_first.sql",
"expected_msql_file": "create_btree_asc_null_first_msql.sql"
}, {
},
{
"type": "delete",
"name": "Drop index",
"endpoint": "NODE-index.delete_id",
"data": {
"name": "Idx_$%{}[]()&*^!@\"'`\\/#"
}
}, {
},
{
"type": "create",
"name": "Create btree index with DESC and NULLS LAST",
"endpoint": "NODE-index.obj",
@ -136,14 +141,16 @@
},
"expected_sql_file": "create_btree_desc_null_last.sql",
"expected_msql_file": "create_btree_desc_null_last_msql.sql"
}, {
},
{
"type": "delete",
"name": "Drop index",
"endpoint": "NODE-index.delete_id",
"data": {
"name": "Idx_$%{}[]()&*^!@\"'`\\/#"
}
}, {
},
{
"type": "create",
"name": "Create btree index with DESC and NULLS FIRST",
"endpoint": "NODE-index.obj",
@ -174,7 +181,8 @@
},
"expected_sql_file": "create_btree_desc_null_first.sql",
"expected_msql_file": "create_btree_desc_null_first_msql.sql"
}, {
},
{
"type": "alter",
"name": "Alter index name, fill factor, comment and clustered",
"endpoint": "NODE-index.obj_id",
@ -201,14 +209,16 @@
},
"expected_sql_file": "alter_reset_fillfactor_cluster.sql",
"expected_msql_file": "alter_reset_fillfactor_cluster_msql.sql"
}, {
},
{
"type": "delete",
"name": "Drop index",
"endpoint": "NODE-index.delete_id",
"data": {
"name": "Idx1_$%{}[]()&*^!@\"'`\\/#"
}
}, {
},
{
"type": "create",
"name": "Create hash index",
"endpoint": "NODE-index.obj",
@ -232,14 +242,16 @@
},
"expected_sql_file": "create_hash_index.sql",
"expected_msql_file": "create_hash_index_msql.sql"
}, {
},
{
"type": "delete",
"name": "Drop hash index",
"endpoint": "NODE-index.delete_id",
"data": {
"name": "Idx_$%{}[]()&*^!@\"'`\\/#"
}
}, {
},
{
"type": "delete",
"name": "Drop Table",
"endpoint": "NODE-table.delete_id",

View File

@ -0,0 +1,10 @@
-- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR DELETE
TO public
USING ((salary < '1000000000000'::bigint));

View File

@ -0,0 +1,2 @@
ALTER POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
USING (salary < 1000000000000);

View File

@ -0,0 +1,10 @@
-- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR SELECT
TO public
USING ((name = (CURRENT_USER)::text));

View File

@ -0,0 +1,2 @@
ALTER POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
USING (name = current_user);

View File

@ -0,0 +1,11 @@
-- POLICY: test_all_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR ALL
TO public
USING (true)
WITH CHECK (true);

View File

@ -0,0 +1,5 @@
ALTER POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
USING (true);
ALTER POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
WITH CHECK (true);

View File

@ -0,0 +1,10 @@
-- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR INSERT
TO public
WITH CHECK (((CURRENT_USER)::text = name));

View File

@ -0,0 +1,2 @@
ALTER POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
WITH CHECK (current_user = name);

View File

@ -0,0 +1,11 @@
-- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR UPDATE
TO public
USING (((CURRENT_USER)::text = name))
WITH CHECK ((emp_id <> 0));

View File

@ -0,0 +1,5 @@
ALTER POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
USING (current_user=name);
ALTER POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy
WITH CHECK (emp_id != 0);

View File

@ -0,0 +1,10 @@
-- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR DELETE
TO public
USING (((CURRENT_USER)::text = name));

View File

@ -0,0 +1,6 @@
CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR DELETE
TO public
USING (current_user = name);

View File

@ -1,9 +0,0 @@
-- POLICY: insert_policy
-- DROP POLICY insert_policy ON public.test_rls_policy;
CREATE POLICY insert_policy
ON public.test_rls_policy
AS PERMISSIVE
FOR INSERT
TO public;

View File

@ -1,8 +1,8 @@
-- POLICY: select_policy
-- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
-- DROP POLICY select_policy ON public.test_rls_policy;
-- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY select_policy
CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR SELECT

View File

@ -0,0 +1,5 @@
CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR SELECT
TO public;

View File

@ -0,0 +1,9 @@
-- POLICY: test_all_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR ALL
TO public;

View File

@ -0,0 +1,5 @@
CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR ALL
TO public;

View File

@ -0,0 +1,9 @@
-- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR INSERT
TO public;

View File

@ -0,0 +1,5 @@
CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR INSERT
TO public;

View File

@ -0,0 +1,11 @@
-- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR UPDATE
TO public
USING (true)
WITH CHECK ((name <> NULL::text));

View File

@ -0,0 +1,7 @@
CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS RESTRICTIVE
FOR UPDATE
TO public
USING (true)
WITH CHECK (name != null);

View File

@ -30,29 +30,199 @@
},
{
"type": "create",
"name": "Create select RLS policy",
"name": "Create simple select event RLS policy",
"endpoint": "NODE-row_security_policy.obj",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql",
"data": {
"name": "select_policy",
"name": "test_select_policy_rls_$%{}[]()&*^!@\"'`\\/#",
"event": "SELECT",
"policyowner": "public",
"schema": "public",
"type": "PERMISSIVE"
},
"expected_sql_file": "create_select_policy.sql",
"expected_msql_file": "create_select_policy_msql.sql"
},
{
"type": "alter",
"name": "Alter simple select event RLS policy with using clause",
"endpoint": "NODE-row_security_policy.obj_id",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql_id",
"data": {
"name": "test_select_policy_rls_$%{}[]()&*^!@\"'`\\/#",
"using": "name = current_user",
"schema": "public"
},
"expected_sql_file": "create_select_policy.sql"
"expected_sql_file": "alter_select_policy.sql",
"expected_msql_file": "alter_select_policy_msql.sql"
},
{
"type": "delete",
"name": "Drop policy",
"endpoint": "NODE-row_security_policy.delete_id",
"data": {
"name": "test_select_rls_policy_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create INSERT RLS policy",
"name": "Create simple insert event RLS policy",
"endpoint": "NODE-row_security_policy.obj",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql",
"data": {
"name": "insert_policy",
"event": "INSERT",
"name": "test_simple_insert_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"policyowner": "public",
"event": "INSERT",
"withcheck": "",
"type": "PERMISSIVE",
"schema": "public"
},
"expected_sql_file": "create_insert_policy.sql"
"expected_sql_file": "create_simple_insert_policy.sql",
"expected_msql_file": "create_simple_insert_policy_msql.sql"
},
{
"type": "alter",
"name": "Alter simple insert event RLS policy by adding check",
"endpoint": "NODE-row_security_policy.obj_id",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql_id",
"data": {
"name": "test_simple_insert_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"withcheck": "current_user = name",
"schema": "public"
},
"expected_sql_file": "alter_simple_insert_policy.sql",
"expected_msql_file": "alter_simple_insert_policy_msql.sql"
},
{
"type": "delete",
"name": "Drop policy",
"endpoint": "NODE-row_security_policy.delete_id",
"data": {
"name": "test_simple_insert_rls_policy_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create update event restrictive RLS policy with check and using clause",
"endpoint": "NODE-row_security_policy.obj",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql",
"data": {
"name": "test_update_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"policyowner": "public",
"event": "UPDATE",
"using": "true",
"withcheck": "name != null",
"type": "RESTRICTIVE",
"schema": "public"
},
"expected_sql_file": "create_update_policy_with_check_and_using.sql",
"expected_msql_file": "create_update_policy_with_check_and_using_msql.sql"
},
{
"type": "alter",
"name": "Alter update event restrictive RLS policy with check and using clause",
"endpoint": "NODE-row_security_policy.obj_id",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql_id",
"data": {
"name": "test_update_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"withcheck": "emp_id != 0",
"using": "current_user=name"
},
"expected_sql_file": "alter_update_policy_with_check_and_using.sql",
"expected_msql_file": "alter_update_policy_with_check_and_using_msql.sql"
},
{
"type": "delete",
"name": "Drop policy",
"endpoint": "NODE-row_security_policy.delete_id",
"data": {
"name": "test_update_rls_policy_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create delete event restrictive RLS policy with check",
"endpoint": "NODE-row_security_policy.obj",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql",
"data": {
"name": "test_delete_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"policyowner": "public",
"event": "DELETE",
"using": "current_user = name",
"withcheck": "",
"type": "RESTRICTIVE",
"schema": "public"
},
"expected_sql_file": "create_delete_policy_with_using.sql",
"expected_msql_file": "create_delete_policy_with_using_msql.sql"
},
{
"type": "alter",
"name": "Alter delete event restrictive RLS policy by changing check clause",
"endpoint": "NODE-row_security_policy.obj_id",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql_id",
"data": {
"name": "test_delete_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"using": "salary < 1000000000000",
"schema": "public"
},
"expected_sql_file": "alter_delete_policy_with_using.sql",
"expected_msql_file": "alter_delete_policy_with_using_msql.sql"
},
{
"type": "delete",
"name": "Drop policy",
"endpoint": "NODE-row_security_policy.delete_id",
"data": {
"name": "test_delete_rls_policy_update_name_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
"name": "Create simple all event restrictive RLS policy",
"endpoint": "NODE-row_security_policy.obj",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql",
"data": {
"name": "test_all_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"policyowner": "public",
"event": "ALL",
"type": "RESTRICTIVE",
"schema": "public"
},
"expected_sql_file": "create_simple_all_policy.sql",
"expected_msql_file": "create_simple_all_policy_msql.sql"
},
{
"type": "alter",
"name": "Alter simple all event restrictive RLS policy with using & check clause",
"endpoint": "NODE-row_security_policy.obj_id",
"sql_endpoint": "NODE-row_security_policy.sql_id",
"msql_endpoint": "NODE-row_security_policy.msql_id",
"data": {
"name": "test_all_rls_policy_$%{}[]()&*^!@\"'`\\/#",
"using": "true",
"withcheck": "true",
"schema": "public"
},
"expected_sql_file": "alter_simple_all_policy.sql",
"expected_msql_file": "alter_simple_all_policy_msql.sql"
},
{
"type": "delete",
"name": "Drop policy",
"endpoint": "NODE-row_security_policy.delete_id",
"data": {
"name": "test_all_rls_policy_$%{}[]()&*^!@\"'`\\/#"
}
},
{
"type": "create",
@ -89,7 +259,7 @@
"schema": "public",
"using": "true",
"withcheck": "true",
"type":"RESTRICTIVE"
"type": "RESTRICTIVE"
},
"expected_sql_file": "create_all_event_policy.sql"
},

View File

@ -0,0 +1,10 @@
-- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
-- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
ON public.test_rls_policy
AS PERMISSIVE
FOR SELECT
TO public
USING ((name = CURRENT_USER));

Some files were not shown because too many files have changed in this diff Show More