diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/sql/default/update.sql
index 661ac9f1..bd589f37 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/sql/default/update.sql
@@ -130,12 +130,12 @@ ALTER TYPE {{ conn|qtIdent(o_data.schema, o_data.name) }}
 {% if 'changed' in data.typacl %}
 {% for priv in data.typacl.changed %}
 {{ PRIVILEGE.UNSETALL(conn, 'TYPE', priv.grantee, o_data.name, o_data.schema) }}
-{{ PRIVILEGE.SET(conn, 'TYPE', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.schema) }}
+{{ PRIVILEGE.SET(conn, 'TYPE', priv.grantee, o_data.name, priv.without_grant, priv.with_grant, o_data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in data.typacl %}
 {% for priv in data.typacl.added %}
-{{ PRIVILEGE.SET(conn, 'TYPE', priv.grantee, name, priv.without_grant, priv.with_grant, o_data.schema) }}
+{{ PRIVILEGE.SET(conn, 'TYPE', priv.grantee, o_data.name, priv.without_grant, priv.with_grant, o_data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_acl_description.sql
new file mode 100644
index 00000000..eb5c7747
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_acl_description.sql
@@ -0,0 +1,20 @@
+-- Type: composite_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
+(
+	mname2 character varying(50) COLLATE pg_catalog."C",
+	mname3 text[] COLLATE pg_catalog."C",
+	mname4 bigint
+);
+
+ALTER TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
+
+COMMENT ON TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
+    IS 'this is test';
+
+GRANT USAGE ON TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" TO <OWNER>;
+
+GRANT USAGE ON TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_add_member.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_add_member.sql
new file mode 100644
index 00000000..b864240c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_add_member.sql
@@ -0,0 +1,14 @@
+-- Type: composite_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
+(
+	mname1 bigint,
+	mname2 character varying(50) COLLATE pg_catalog."C",
+	mname3 text[] COLLATE pg_catalog."C",
+	mname4 bigint
+);
+
+ALTER TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_remove_member.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_remove_member.sql
new file mode 100644
index 00000000..013245da
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_composite_type_remove_member.sql
@@ -0,0 +1,13 @@
+-- Type: composite_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
+(
+	mname2 character varying(50) COLLATE pg_catalog."C",
+	mname3 text[] COLLATE pg_catalog."C",
+	mname4 bigint
+);
+
+ALTER TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_enum_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_enum_type_acl_description.sql
new file mode 100644
index 00000000..fd619221
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_enum_type_acl_description.sql
@@ -0,0 +1,16 @@
+-- Type: enum_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
+    ('a', 'b', 'c', 'd');
+
+ALTER TYPE public."enum_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
+
+COMMENT ON TYPE public."enum_type_$%{}[]()&*^!@""'`\/#"
+    IS 'this is test';
+
+GRANT USAGE ON TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" TO <OWNER>;
+
+GRANT USAGE ON TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_enum_type_label.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_enum_type_label.sql
new file mode 100644
index 00000000..1a7a1530
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_enum_type_label.sql
@@ -0,0 +1,9 @@
+-- Type: enum_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
+    ('a', 'b', 'c', 'd');
+
+ALTER TYPE public."enum_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_range_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_range_type_acl_description.sql
new file mode 100644
index 00000000..8f3d3f62
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_range_type_acl_description.sql
@@ -0,0 +1,19 @@
+-- Type: range_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
+(
+    SUBTYPE=bool,
+    SUBTYPE_OPCLASS = bool_ops
+);
+
+ALTER TYPE public."range_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
+
+COMMENT ON TYPE public."range_type_$%{}[]()&*^!@""'`\/#"
+    IS 'this is test';
+
+GRANT USAGE ON TYPE public."range_type_$%{}[]()&*^!@""'`\/#" TO <OWNER>;
+
+GRANT USAGE ON TYPE public."range_type_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_shell_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_shell_type_acl_description.sql
new file mode 100644
index 00000000..3f78bfd2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/alter_shell_type_acl_description.sql
@@ -0,0 +1,11 @@
+-- Type: shell_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+
+ALTER TYPE public."shell_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
+
+COMMENT ON TYPE public."shell_type_$%{}[]()&*^!@""'`\/#"
+    IS 'this is test';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_composite_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_composite_type.sql
new file mode 100644
index 00000000..d48f7053
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_composite_type.sql
@@ -0,0 +1,13 @@
+-- Type: composite_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
+(
+	mname1 bigint,
+	mname2 character varying(50) COLLATE pg_catalog."C",
+	mname3 text[] COLLATE pg_catalog."C"
+);
+
+ALTER TYPE public."composite_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_enum_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_enum_type.sql
new file mode 100644
index 00000000..ebccea87
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_enum_type.sql
@@ -0,0 +1,9 @@
+-- Type: enum_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
+    ('a', 'b', 'c');
+
+ALTER TYPE public."enum_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_range_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_range_type.sql
new file mode 100644
index 00000000..be9c1a75
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_range_type.sql
@@ -0,0 +1,12 @@
+-- Type: range_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
+(
+    SUBTYPE=bool,
+    SUBTYPE_OPCLASS = bool_ops
+);
+
+ALTER TYPE public."range_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_shell_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_shell_type.sql
new file mode 100644
index 00000000..126f2b7f
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/create_shell_type.sql
@@ -0,0 +1,8 @@
+-- Type: shell_type_$%{}[]()&*^!@"'`\/#
+
+-- DROP TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+
+CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+
+ALTER TYPE public."shell_type_$%{}[]()&*^!@""'`\/#"
+    OWNER TO <OWNER>;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/tests.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/tests.json
new file mode 100644
index 00000000..caded769
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/default/tests.json
@@ -0,0 +1,185 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create ENUM type",
+      "endpoint": "NODE-type.obj",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "name": "enum_type_$%{}[]()&*^!@\"'`\\/#",
+        "is_sys_type":false,
+        "typtype":"e",
+        "schema":"public",
+        "composite":[],
+        "enum":[{"label":"a"},{"label":"b"},{"label":"c"}],
+        "typacl":[],
+        "seclabels":[],
+        "description":""
+      },
+      "expected_sql_file": "create_enum_type.sql"
+    },
+    {
+      "type": "alter",
+      "name": "alter ENUM type and add new label",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "enum": {"added": [{"label": "d"}]}
+      },
+      "expected_sql_file": "alter_enum_type_label.sql"
+    },
+    {
+      "type": "alter",
+      "name": "alter ENUM type and add ACL, description",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_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"
+    },
+    {
+      "type": "delete",
+      "name": "Drop ENUM type",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {}
+    },
+
+
+    {
+      "type": "create",
+      "name": "Create Composite type",
+      "endpoint": "NODE-type.obj",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "name": "composite_type_$%{}[]()&*^!@\"'`\\/#",
+        "is_sys_type":false,
+        "typtype":"c",
+        "schema":"public",
+        "composite":[
+            {"member_name":"mname1","type":"bigint","is_tlength":false,"is_precision":false},
+            {"member_name":"mname2","type":"character varying","tlength":50,"is_tlength":true,"is_precision":false,"collation":"pg_catalog.\"C\"","min_val":1,"max_val":2147483647,"collspcname":""},
+            {"member_name":"mname3","type":"text[]","is_tlength":false,"is_precision":false,"collation":"pg_catalog.\"C\"","collspcname":""}
+        ],
+        "typacl":[],
+        "seclabels":[],
+        "description":""
+      },
+      "expected_sql_file": "create_composite_type.sql"
+    },
+    {
+      "type": "alter",
+      "name": "alter Composite type and add new label",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "composite": {"added": [{"member_name":"mname4","type":"bigint","is_tlength":false,"is_precision":false}]}
+      },
+      "expected_sql_file": "alter_composite_type_add_member.sql"
+    },
+    {
+      "type": "alter",
+      "name": "alter Composite type and delete label",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_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"
+    },
+    {
+      "type": "alter",
+      "name": "alter Composite type and add ACL, description",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_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"
+    },
+    {
+      "type": "delete",
+      "name": "Drop Composite type",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {}
+    },
+
+
+    {
+      "type": "create",
+      "name": "Create SHELL type",
+      "endpoint": "NODE-type.obj",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "name": "shell_type_$%{}[]()&*^!@\"'`\\/#",
+        "is_sys_type":false,
+        "typtype":"p",
+        "schema":"public",
+        "composite":[],
+        "enum":[],
+        "typacl":[],
+        "seclabels":[]
+      },
+      "expected_sql_file": "create_shell_type.sql"
+    },
+    {
+      "type": "alter",
+      "name": "alter SHELL type and add description",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "description":"this is test"
+      },
+      "expected_sql_file": "alter_shell_type_acl_description.sql"
+    },
+    {
+      "type": "delete",
+      "name": "Drop SHELL type",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {}
+    },
+
+
+    {
+      "type": "create",
+      "name": "Create RANGE type",
+      "endpoint": "NODE-type.obj",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {
+        "name": "range_type_$%{}[]()&*^!@\"'`\\/#",
+        "is_sys_type":false,
+        "typtype":"r",
+        "schema":"public",
+        "composite":[],
+        "enum":[],
+        "typacl":[],
+        "seclabels":[],
+        "typname":"bool"
+      },
+      "expected_sql_file": "create_range_type.sql"
+    },
+    {
+      "type": "alter",
+      "name": "alter RANGE type and add ACL, description",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_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"
+    },
+    {
+      "type": "delete",
+      "name": "Drop RANGE type",
+      "endpoint": "NODE-type.obj_id",
+      "sql_endpoint": "NODE-type.sql_id",
+      "data": {}
+    }
+  ]
+}
diff --git a/web/regression/re_sql/tests/test_resql.py b/web/regression/re_sql/tests/test_resql.py
index 6b87f030..471571a5 100644
--- a/web/regression/re_sql/tests/test_resql.py
+++ b/web/regression/re_sql/tests/test_resql.py
@@ -104,7 +104,15 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
                     complete_file_name = os.path.join(self.test_folder,
                                                       filename)
                     with open(complete_file_name) as jsonfp:
-                        data = json.load(jsonfp)
+                        try:
+                            data = json.load(jsonfp)
+                        except Exception as e:
+                            print(
+                                "Unable to read the json file: {0}".format(
+                                    complete_file_name))
+                            traceback.print_exc()
+                            continue
+
                         for key, scenarios in data.items():
                             self.execute_test_case(scenarios)
 
