mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add Reverse Engineered and Modified SQL tests for Column and Type.
This commit is contained in:
parent
cc2e3ece7a
commit
0fc2afb829
@ -0,0 +1,15 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
|
||||
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
|
@ -0,0 +1,7 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,8 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_5_$%{}[]()&*^!@""'`\/#" TO "new_col_5_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 2 SET MINVALUE 1 SET MAXVALUE 200 SET CACHE 2 ;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" TYPE real;
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_4_$%{}[]()&*^!@""'`\/#" TO "new_col_4_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" TYPE numeric(15, 6);
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT ALL("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" TYPE numeric;
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +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 );
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +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 );
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
||||
|
||||
ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "col_4_$%{}[]()&*^!@""'`\/#"
|
||||
SET (n_distinct=1);
|
@ -18,6 +18,7 @@
|
||||
"name": "Create Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -31,13 +32,15 @@
|
||||
"seclabels":[],
|
||||
"defval":"1"
|
||||
},
|
||||
"expected_sql_file": "create_column_int.sql"
|
||||
"expected_sql_file": "create_column_int.sql",
|
||||
"expected_msql_file": "create_column_int.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 1,
|
||||
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -45,7 +48,8 @@
|
||||
"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_sql_file": "alter_column_int.sql",
|
||||
"expected_msql_file": "alter_column_int.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -61,6 +65,7 @@
|
||||
"name": "Create Column (Character type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -75,13 +80,15 @@
|
||||
"seclabels":[],
|
||||
"defval":null
|
||||
},
|
||||
"expected_sql_file": "create_column_char.sql"
|
||||
"expected_sql_file": "create_column_char.sql",
|
||||
"expected_msql_file": "create_column_char.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Character type)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 2,
|
||||
"name": "new_col_2_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -92,7 +99,8 @@
|
||||
"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_sql_file": "alter_column_char.sql",
|
||||
"expected_msql_file": "alter_column_char.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -108,6 +116,7 @@
|
||||
"name": "Create Column (Integer/Numeric type) with identity",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -128,31 +137,36 @@
|
||||
"seqcycle":true,
|
||||
"colconstype":"i"
|
||||
},
|
||||
"expected_sql_file": "create_column_int_identity.sql"
|
||||
"expected_sql_file": "create_column_int_identity.sql",
|
||||
"expected_msql_file": "create_column_int_identity.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type) with identity",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_identity.sql"
|
||||
"expected_sql_file": "alter_column_identity.sql",
|
||||
"expected_msql_file": "alter_column_identity.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type) drop identity",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"colconstype": "n"
|
||||
},
|
||||
"expected_sql_file": "alter_column_drop_identity.sql"
|
||||
"expected_sql_file": "alter_column_drop_identity.sql",
|
||||
"expected_msql_file": "alter_column_drop_identity.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -169,6 +183,7 @@
|
||||
"name": "Create Column (Numeric type with Length Precision & Variables)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_4_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -184,13 +199,15 @@
|
||||
"attoptions":[{"name":"n_distinct","value":"1"}],
|
||||
"seclabels":[]
|
||||
},
|
||||
"expected_sql_file": "create_column_numeric.sql"
|
||||
"expected_sql_file": "create_column_numeric.sql",
|
||||
"expected_msql_file": "create_column_numeric.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Numeric type with Length Precision & Variables)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"name": "new_col_4_$%{}[]()&*^!@\"'`\\/#",
|
||||
"attnum": 4,
|
||||
@ -199,18 +216,21 @@
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_numeric.sql"
|
||||
"expected_sql_file": "alter_column_numeric.sql",
|
||||
"expected_msql_file": "alter_column_numeric.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Remove Length)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"attlen":""
|
||||
},
|
||||
"expected_sql_file": "alter_column_remove_length.sql"
|
||||
"expected_sql_file": "alter_column_remove_length.sql",
|
||||
"expected_msql_file": "alter_column_remove_length.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -227,6 +247,7 @@
|
||||
"name": "Create Column with identity (Generated by default)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_5_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -247,13 +268,15 @@
|
||||
"seqcycle":true,
|
||||
"colconstype":"i"
|
||||
},
|
||||
"expected_sql_file": "create_column_int_identity_by_default.sql"
|
||||
"expected_sql_file": "create_column_int_identity_by_default.sql",
|
||||
"expected_msql_file": "create_column_int_identity_by_default.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column with identity (Generated by default)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 5,
|
||||
"name": "new_col_5_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -264,18 +287,21 @@
|
||||
"seqcycle":true,
|
||||
"seqmin":"1"
|
||||
},
|
||||
"expected_sql_file": "alter_column_identity_by_default.sql"
|
||||
"expected_sql_file": "alter_column_identity_by_default.sql",
|
||||
"expected_msql_file": "alter_column_identity_by_default.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column with drop identity (Generated by default)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 5,
|
||||
"colconstype": "n"
|
||||
},
|
||||
"expected_sql_file": "alter_column_drop_identity_by_default.sql"
|
||||
"expected_sql_file": "alter_column_drop_identity_by_default.sql",
|
||||
"expected_msql_file": "alter_column_drop_identity_by_default.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -0,0 +1,15 @@
|
||||
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 TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
|
||||
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
|
@ -0,0 +1,7 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_4_$%{}[]()&*^!@""'`\/#" TO "new_col_4_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_4_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_4_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,7 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_8_$%{}[]()&*^!@""'`\/#" TO "new_col_8_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_8_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_8_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_8_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,7 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,8 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_9_$%{}[]()&*^!@""'`\/#" TO "new_col_9_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 2 SET MINVALUE 1 SET MAXVALUE 200 SET CACHE 2 ;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" TYPE real;
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_5_$%{}[]()&*^!@""'`\/#" TO "new_col_5_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" TYPE numeric(15, 6);
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT ALL("new_col_5_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" TYPE numeric;
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint(None, None) GENERATED ALWAYS AS (1 + 2 + 3) STORED;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint(None, None) GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +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 );
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +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 );
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
||||
|
||||
ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "col_5_$%{}[]()&*^!@""'`\/#"
|
||||
SET (n_distinct=1);
|
@ -18,6 +18,7 @@
|
||||
"name": "Create Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -31,13 +32,15 @@
|
||||
"seclabels":[],
|
||||
"defval":"1"
|
||||
},
|
||||
"expected_sql_file": "create_column_int.sql"
|
||||
"expected_sql_file": "create_column_int.sql",
|
||||
"expected_msql_file": "create_column_int.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 1,
|
||||
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -45,7 +48,8 @@
|
||||
"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_sql_file": "alter_column_int.sql",
|
||||
"expected_msql_file": "alter_column_int.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -61,6 +65,7 @@
|
||||
"name": "Create Column (Character type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -75,13 +80,15 @@
|
||||
"seclabels":[],
|
||||
"defval":null
|
||||
},
|
||||
"expected_sql_file": "create_column_char.sql"
|
||||
"expected_sql_file": "create_column_char.sql",
|
||||
"expected_msql_file": "create_column_char.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Character type)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 2,
|
||||
"name": "new_col_2_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -92,7 +99,8 @@
|
||||
"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_sql_file": "alter_column_char.sql",
|
||||
"expected_msql_file": "alter_column_char.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -108,6 +116,7 @@
|
||||
"name": "Create Column (Integer/Numeric type) with identity",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -128,31 +137,36 @@
|
||||
"seqcycle":true,
|
||||
"colconstype":"i"
|
||||
},
|
||||
"expected_sql_file": "create_column_int_identity.sql"
|
||||
"expected_sql_file": "create_column_int_identity.sql",
|
||||
"expected_msql_file": "create_column_int_identity.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type) with identity",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_identity.sql"
|
||||
"expected_sql_file": "alter_column_identity.sql",
|
||||
"expected_msql_file": "alter_column_identity.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type) drop identity",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"colconstype": "n"
|
||||
},
|
||||
"expected_sql_file": "alter_column_drop_identity.sql"
|
||||
"expected_sql_file": "alter_column_drop_identity.sql",
|
||||
"expected_msql_file": "alter_column_drop_identity.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -168,6 +182,7 @@
|
||||
"name": "Create Column (Integer/Numeric type) with Generated feature",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_4_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -183,20 +198,23 @@
|
||||
"attoptions":[],
|
||||
"seclabels":[]
|
||||
},
|
||||
"expected_sql_file": "create_column_int_generated.sql"
|
||||
"expected_sql_file": "create_column_int_generated.sql",
|
||||
"expected_msql_file": "create_column_int_generated.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type) with Generated feature",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 4,
|
||||
"name": "new_col_4_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_generated.sql"
|
||||
"expected_sql_file": "alter_column_generated.sql",
|
||||
"expected_msql_file": "alter_column_generated.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -212,6 +230,7 @@
|
||||
"name": "Create Column (Numeric type with Length Precision & Variables)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_5_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -227,13 +246,15 @@
|
||||
"attoptions":[{"name":"n_distinct","value":"1"}],
|
||||
"seclabels":[]
|
||||
},
|
||||
"expected_sql_file": "create_column_numeric.sql"
|
||||
"expected_sql_file": "create_column_numeric.sql",
|
||||
"expected_msql_file": "create_column_numeric.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Numeric type with Length Precision & Variables)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"name": "new_col_5_$%{}[]()&*^!@\"'`\\/#",
|
||||
"attnum": 5,
|
||||
@ -242,18 +263,21 @@
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_numeric.sql"
|
||||
"expected_sql_file": "alter_column_numeric.sql",
|
||||
"expected_msql_file": "alter_column_numeric.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Remove Length)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"attlen":""
|
||||
},
|
||||
"expected_sql_file": "alter_column_remove_length.sql"
|
||||
"expected_sql_file": "alter_column_remove_length.sql",
|
||||
"expected_msql_file": "alter_column_remove_length.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -270,6 +294,7 @@
|
||||
"name": "Create Dummy Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "dummy1",
|
||||
"description": "Comment for create",
|
||||
@ -289,6 +314,7 @@
|
||||
"name": "Create Dummy Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "dummy2",
|
||||
"description": "Comment for create",
|
||||
@ -308,6 +334,7 @@
|
||||
"name": "Create Column (Integer/Numeric type) with Generated feature with columns",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_8_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -323,13 +350,15 @@
|
||||
"attoptions":[],
|
||||
"seclabels":[]
|
||||
},
|
||||
"expected_sql_file": "create_column_int_generated_with_existing_columns.sql"
|
||||
"expected_sql_file": "create_column_int_generated_with_existing_columns.sql",
|
||||
"expected_msql_file": "create_column_int_generated_with_existing_columns.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type) with Generated feature with columns",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 8,
|
||||
"name": "new_col_8_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -337,7 +366,8 @@
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_generated_with_existing_columns.sql"
|
||||
"expected_sql_file": "alter_column_generated_with_existing_columns.sql",
|
||||
"expected_msql_file": "alter_column_generated_with_existing_columns.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -354,6 +384,7 @@
|
||||
"name": "Create Column with identity (Generated by default)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_9_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -374,13 +405,15 @@
|
||||
"seqcycle":true,
|
||||
"colconstype":"i"
|
||||
},
|
||||
"expected_sql_file": "create_column_int_identity_by_default.sql"
|
||||
"expected_sql_file": "create_column_int_identity_by_default.sql",
|
||||
"expected_msql_file": "create_column_int_identity_by_default.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column with identity (Generated by default)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 9,
|
||||
"name": "new_col_9_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -391,18 +424,21 @@
|
||||
"seqcycle":true,
|
||||
"seqmin":"1"
|
||||
},
|
||||
"expected_sql_file": "alter_column_identity_by_default.sql"
|
||||
"expected_sql_file": "alter_column_identity_by_default.sql",
|
||||
"expected_msql_file": "alter_column_identity_by_default.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column with drop identity (Generated by default)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 9,
|
||||
"colconstype": "n"
|
||||
},
|
||||
"expected_sql_file": "alter_column_drop_identity_by_default.sql"
|
||||
"expected_sql_file": "alter_column_drop_identity_by_default.sql",
|
||||
"expected_msql_file": "alter_column_drop_identity_by_default.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -0,0 +1,15 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
|
||||
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" TYPE real;
|
||||
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
|
||||
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" TYPE numeric(15, 6);
|
||||
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for alter';
|
||||
|
||||
GRANT ALL("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" TYPE numeric;
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50, None) COLLATE pg_catalog."C" DEFAULT None;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,5 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL DEFAULT 1;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
@ -0,0 +1,9 @@
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
|
||||
|
||||
COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'Comment for create';
|
||||
|
||||
ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
|
||||
ALTER COLUMN "col_3_$%{}[]()&*^!@""'`\/#"
|
||||
SET (n_distinct=1);
|
@ -18,6 +18,7 @@
|
||||
"name": "Create Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_1_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -31,13 +32,15 @@
|
||||
"seclabels":[],
|
||||
"defval":"1"
|
||||
},
|
||||
"expected_sql_file": "create_column_int.sql"
|
||||
"expected_sql_file": "create_column_int.sql",
|
||||
"expected_msql_file": "create_column_int.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Integer/Numeric type)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 1,
|
||||
"name": "new_col_1_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -45,7 +48,8 @@
|
||||
"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_sql_file": "alter_column_int.sql",
|
||||
"expected_msql_file": "alter_column_int.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -61,6 +65,7 @@
|
||||
"name": "Create Column (Character type)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_2_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -75,13 +80,15 @@
|
||||
"seclabels":[],
|
||||
"defval":null
|
||||
},
|
||||
"expected_sql_file": "create_column_char.sql"
|
||||
"expected_sql_file": "create_column_char.sql",
|
||||
"expected_msql_file": "create_column_char.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Character type)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 2,
|
||||
"name": "new_col_2_$%{}[]()&*^!@\"'`\\/#",
|
||||
@ -92,7 +99,8 @@
|
||||
"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_sql_file": "alter_column_char.sql",
|
||||
"expected_msql_file": "alter_column_char.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -109,6 +117,7 @@
|
||||
"name": "Create Column (Numeric type with Length Precision & Variables)",
|
||||
"endpoint": "NODE-column.obj",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql",
|
||||
"data": {
|
||||
"name": "col_3_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Comment for create",
|
||||
@ -124,13 +133,15 @@
|
||||
"attoptions":[{"name":"n_distinct","value":"1"}],
|
||||
"seclabels":[]
|
||||
},
|
||||
"expected_sql_file": "create_column_numeric.sql"
|
||||
"expected_sql_file": "create_column_numeric.sql",
|
||||
"expected_msql_file": "create_column_numeric.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Numeric type with Length Precision & Variables)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"name": "new_col_3_$%{}[]()&*^!@\"'`\\/#",
|
||||
"attnum": 3,
|
||||
@ -139,18 +150,21 @@
|
||||
"description": "Comment for alter",
|
||||
"attacl":{"added":[{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"a","privilege":true,"with_grant":false},{"privilege_type":"r","privilege":true,"with_grant":false},{"privilege_type":"w","privilege":true,"with_grant":false},{"privilege_type":"x","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_column_numeric.sql"
|
||||
"expected_sql_file": "alter_column_numeric.sql",
|
||||
"expected_msql_file": "alter_column_numeric.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter Column (Remove Length)",
|
||||
"endpoint": "NODE-column.obj_id",
|
||||
"sql_endpoint": "NODE-column.sql_id",
|
||||
"msql_endpoint": "NODE-column.msql_id",
|
||||
"data": {
|
||||
"attnum": 3,
|
||||
"attlen":""
|
||||
},
|
||||
"expected_sql_file": "alter_column_remove_length.sql"
|
||||
"expected_sql_file": "alter_column_remove_length.sql",
|
||||
"expected_msql_file": "alter_column_remove_length.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -0,0 +1,4 @@
|
||||
COMMENT ON TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'this is test';
|
||||
|
||||
GRANT USAGE ON TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
|
||||
ADD ATTRIBUTE mname4 bigint;
|
@ -0,0 +1,2 @@
|
||||
ALTER TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
|
||||
DROP ATTRIBUTE mname1;
|
@ -0,0 +1,4 @@
|
||||
COMMENT ON TYPE public."enum_type_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'this is test';
|
||||
|
||||
GRANT USAGE ON TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
ALTER TYPE public."enum_type_$%{}[]()&*^!@""'`\/#"
|
||||
ADD VALUE 'd' AFTER 'c';
|
@ -0,0 +1,4 @@
|
||||
COMMENT ON TYPE public."range_type_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'this is test';
|
||||
|
||||
GRANT USAGE ON TYPE public."range_type_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
|
@ -0,0 +1,2 @@
|
||||
COMMENT ON TYPE public."shell_type_$%{}[]()&*^!@""'`\/#"
|
||||
IS 'this is test';
|
@ -0,0 +1,6 @@
|
||||
CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
|
||||
(
|
||||
mname1 bigint,
|
||||
mname2 character varying(50) COLLATE pg_catalog."C",
|
||||
mname3 text[] COLLATE pg_catalog."C"
|
||||
);
|
@ -0,0 +1,2 @@
|
||||
CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
|
||||
('a', 'b', 'c');
|
@ -0,0 +1,4 @@
|
||||
CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
|
||||
(
|
||||
SUBTYPE=bool
|
||||
);
|
@ -0,0 +1 @@
|
||||
CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
|
@ -5,6 +5,7 @@
|
||||
"name": "Create ENUM type",
|
||||
"endpoint": "NODE-type.obj",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql",
|
||||
"data": {
|
||||
"name": "enum_type_$%{}[]()&*^!@\"'`\\/#",
|
||||
"is_sys_type":false,
|
||||
@ -16,28 +17,33 @@
|
||||
"seclabels":[],
|
||||
"description":""
|
||||
},
|
||||
"expected_sql_file": "create_enum_type.sql"
|
||||
"expected_sql_file": "create_enum_type.sql",
|
||||
"expected_msql_file": "create_enum_type.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter ENUM type and add new label",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"enum": {"added": [{"label": "d"}]}
|
||||
},
|
||||
"expected_sql_file": "alter_enum_type_label.sql"
|
||||
"expected_sql_file": "alter_enum_type_label.sql",
|
||||
"expected_msql_file": "alter_enum_type_label.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter ENUM type and add ACL, description",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"description":"this is test",
|
||||
"typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_enum_type_acl_description.sql"
|
||||
"expected_sql_file": "alter_enum_type_acl_description.sql",
|
||||
"expected_msql_file": "alter_enum_type_acl_description.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -53,6 +59,7 @@
|
||||
"name": "Create Composite type",
|
||||
"endpoint": "NODE-type.obj",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql",
|
||||
"data": {
|
||||
"name": "composite_type_$%{}[]()&*^!@\"'`\\/#",
|
||||
"is_sys_type":false,
|
||||
@ -67,38 +74,45 @@
|
||||
"seclabels":[],
|
||||
"description":""
|
||||
},
|
||||
"expected_sql_file": "create_composite_type.sql"
|
||||
"expected_sql_file": "create_composite_type.sql",
|
||||
"expected_msql_file": "create_composite_type.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter Composite type and add new label",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"composite": {"added": [{"member_name":"mname4","type":"bigint","is_tlength":false,"is_precision":false}]}
|
||||
},
|
||||
"expected_sql_file": "alter_composite_type_add_member.sql"
|
||||
"expected_sql_file": "alter_composite_type_add_member.sql",
|
||||
"expected_msql_file": "alter_composite_type_add_member.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter Composite type and delete label",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"composite": {"deleted":[{"attnum":1,"member_name":"mname1","type":"bigint","tlength":null,"is_tlength":false,"precision":null,"is_precision":false,"collation":"","cltype":"bigint","hasSqrBracket":false,"fulltype":"bigint"}]}
|
||||
},
|
||||
"expected_sql_file": "alter_composite_type_remove_member.sql"
|
||||
"expected_sql_file": "alter_composite_type_remove_member.sql",
|
||||
"expected_msql_file": "alter_composite_type_remove_member.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter Composite type and add ACL, description",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"description":"this is test",
|
||||
"typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_composite_type_acl_description.sql"
|
||||
"expected_sql_file": "alter_composite_type_acl_description.sql",
|
||||
"expected_msql_file": "alter_composite_type_acl_description.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -140,6 +154,7 @@
|
||||
"name": "Create SHELL type",
|
||||
"endpoint": "NODE-type.obj",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql",
|
||||
"data": {
|
||||
"name": "shell_type_$%{}[]()&*^!@\"'`\\/#",
|
||||
"is_sys_type":false,
|
||||
@ -150,17 +165,20 @@
|
||||
"typacl":[],
|
||||
"seclabels":[]
|
||||
},
|
||||
"expected_sql_file": "create_shell_type.sql"
|
||||
"expected_sql_file": "create_shell_type.sql",
|
||||
"expected_msql_file": "create_shell_type.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter SHELL type and add description",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"description":"this is test"
|
||||
},
|
||||
"expected_sql_file": "alter_shell_type_acl_description.sql"
|
||||
"expected_sql_file": "alter_shell_type_acl_description.sql",
|
||||
"expected_msql_file": "alter_shell_type_acl_description.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
@ -176,6 +194,7 @@
|
||||
"name": "Create RANGE type",
|
||||
"endpoint": "NODE-type.obj",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql",
|
||||
"data": {
|
||||
"name": "range_type_$%{}[]()&*^!@\"'`\\/#",
|
||||
"is_sys_type":false,
|
||||
@ -187,18 +206,21 @@
|
||||
"seclabels":[],
|
||||
"typname":"bool"
|
||||
},
|
||||
"expected_sql_file": "create_range_type.sql"
|
||||
"expected_sql_file": "create_range_type.sql",
|
||||
"expected_msql_file": "create_range_type.msql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "alter RANGE type and add ACL, description",
|
||||
"endpoint": "NODE-type.obj_id",
|
||||
"sql_endpoint": "NODE-type.sql_id",
|
||||
"msql_endpoint": "NODE-type.msql_id",
|
||||
"data": {
|
||||
"description":"this is test",
|
||||
"typacl": {"added": [{"grantee":"PUBLIC","grantor":"postgres","privileges":[{"privilege_type":"U","privilege":true,"with_grant":false}]}]}
|
||||
},
|
||||
"expected_sql_file": "alter_range_type_acl_description.sql"
|
||||
"expected_sql_file": "alter_range_type_acl_description.sql",
|
||||
"expected_msql_file": "alter_range_type_acl_description.msql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
Loading…
Reference in New Issue
Block a user