diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py
index fb733ad67..c45f243c0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/__init__.py
@@ -571,7 +571,8 @@ class IndexConstraintView(PGChildNodeView):
         for arg in required_args:
             if isinstance(arg, list):
                 for param in arg:
-                    if param in data and is_key_list(param, data):
+                    if param in data and (param != 'columns' or
+                                          is_key_list(param, data)):
                         break
                 else:
                     return make_json_response(
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
index 7d363c204..a9fb9a414 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
@@ -536,11 +536,7 @@ define('pgadmin.node.primary_key', [
           type: 'text', group: gettext('Definition'),
           control: Backform.NodeListByNameControl.extend({
             initialize:function() {
-              if (_.isUndefined(this.model.top)) {
-                Backform.NodeListByNameControl.prototype.initialize.apply(this,arguments);
-              } else {
-                Backform.Control.prototype.initialize.apply(this,arguments);
-              }
+              Backform.NodeListByNameControl.prototype.initialize.apply(this, arguments);
             },
           }),
           select2:{allowClear:true}, node: 'index',
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_index_constraint.sql
new file mode 100644
index 000000000..122dcdf7c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_index_constraint.sql
@@ -0,0 +1,13 @@
+-- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
+
+-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
+    INCLUDE (col2)
+    WITH (FILLFACTOR=90)
+    DEFERRABLE INITIALLY DEFERRED;
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
+    IS 'Comment for alter';
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_msql_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_msql_index_constraint.sql
new file mode 100644
index 000000000..db88f8d23
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_msql_index_constraint.sql
@@ -0,0 +1,6 @@
+ALTER TABLE testschema.tableforcon
+    RENAME CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" TO "Pk_$%{}[]()&*^!@""'`\/#a";
+ALTER INDEX testschema."Pk_$%{}[]()&*^!@""'`\/#a"
+    SET (FILLFACTOR=90);
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
+    IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_index_constraint.sql
new file mode 100644
index 000000000..3f8eec7cd
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_index_constraint.sql
@@ -0,0 +1,12 @@
+-- Constraint: Pk_$%{}[]()&*^!@"'`\/#
+
+-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
+    INCLUDE (col2)
+    WITH (FILLFACTOR=20)
+    DEFERRABLE INITIALLY DEFERRED;
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
+    IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_msql_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_msql_index_constraint.sql
new file mode 100644
index 000000000..35fcb959d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_msql_index_constraint.sql
@@ -0,0 +1,8 @@
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
+    INCLUDE (col2)
+    WITH (FILLFACTOR=20)
+    DEFERRABLE INITIALLY DEFERRED;
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
+    IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/test.json
new file mode 100644
index 000000000..faf4f1e45
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/test.json
@@ -0,0 +1,63 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create Table",
+      "endpoint": "NODE-table.obj",
+      "sql_endpoint": "NODE-table.sql_id",
+      "data": {
+        "name": "tableforcon",
+        "columns": [{
+          "name": "col1",
+          "cltype": "integer",
+          "is_primary_key": false
+        }, {
+          "name": "col2",
+          "cltype": "integer",
+          "is_primary_key": false
+        }],
+        "is_partitioned": false,
+        "schema": "testschema",
+        "spcname": "pg_default"
+      },
+      "store_object_id": true
+    },
+    {
+      "type": "create",
+      "name": "Create Primary Key Constraint -- 11 Plus",
+      "endpoint": "NODE-primary_key.obj",
+      "sql_endpoint": "NODE-primary_key.sql_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#",
+        "comment": "Comment for create",
+        "fillfactor": 20,
+        "columns": [{"column":"col1"}],
+        "include": ["col2"],
+        "condeferrable": true,
+        "condeferred": true
+      },
+      "expected_sql_file": "create_index_constraint.sql",
+      "expected_msql_file": "create_msql_index_constraint.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter Primary Key Constraint -- 11 Plus",
+      "endpoint": "NODE-primary_key.obj_id",
+      "sql_endpoint": "NODE-primary_key.sql_id",
+      "msql_endpoint": "NODE-primary_key.msql_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#a",
+        "fillfactor": 90,
+        "comment": "Comment for alter"
+      },
+      "expected_sql_file": "alter_index_constraint.sql",
+      "expected_msql_file": "alter_msql_index_constraint.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop Primary Key Constraint -- 11 plus",
+      "endpoint": "NODE-primary_key.delete_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#a"
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_index_constraint.sql
new file mode 100644
index 000000000..66fad982e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_index_constraint.sql
@@ -0,0 +1,12 @@
+-- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
+
+-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
+    WITH (FILLFACTOR=90)
+    DEFERRABLE INITIALLY DEFERRED;
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
+    IS 'Comment for alter';
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_index_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_index_constraint_with_index.sql
new file mode 100644
index 000000000..baeec14a2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_index_constraint_with_index.sql
@@ -0,0 +1,11 @@
+-- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
+
+-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
+    WITH (FILLFACTOR=90);
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
+    IS 'Comment for alter';
+
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_msql_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_msql_index_constraint.sql
new file mode 100644
index 000000000..db88f8d23
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_msql_index_constraint.sql
@@ -0,0 +1,6 @@
+ALTER TABLE testschema.tableforcon
+    RENAME CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" TO "Pk_$%{}[]()&*^!@""'`\/#a";
+ALTER INDEX testschema."Pk_$%{}[]()&*^!@""'`\/#a"
+    SET (FILLFACTOR=90);
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
+    IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_msql_index_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_msql_index_constraint_with_index.sql
new file mode 100644
index 000000000..db88f8d23
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_msql_index_constraint_with_index.sql
@@ -0,0 +1,6 @@
+ALTER TABLE testschema.tableforcon
+    RENAME CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" TO "Pk_$%{}[]()&*^!@""'`\/#a";
+ALTER INDEX testschema."Pk_$%{}[]()&*^!@""'`\/#a"
+    SET (FILLFACTOR=90);
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
+    IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_index_constraint.sql
new file mode 100644
index 000000000..eac34c394
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_index_constraint.sql
@@ -0,0 +1,11 @@
+-- Constraint: Pk_$%{}[]()&*^!@"'`\/#
+
+-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
+    WITH (FILLFACTOR=20)
+    DEFERRABLE INITIALLY DEFERRED;
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
+    IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_index_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_index_constraint_with_index.sql
new file mode 100644
index 000000000..88e39e0ef
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_index_constraint_with_index.sql
@@ -0,0 +1,10 @@
+-- Constraint: Pk_$%{}[]()&*^!@"'`\/#
+
+-- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
+    WITH (FILLFACTOR=20);
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
+    IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_msql_index_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_msql_index_constraint.sql
new file mode 100644
index 000000000..a17b5744a
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_msql_index_constraint.sql
@@ -0,0 +1,7 @@
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
+    WITH (FILLFACTOR=20)
+    DEFERRABLE INITIALLY DEFERRED;
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
+    IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_msql_index_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_msql_index_constraint_with_index.sql
new file mode 100644
index 000000000..e88f2d42d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_msql_index_constraint_with_index.sql
@@ -0,0 +1,6 @@
+ALTER TABLE testschema.tableforcon
+    ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
+    WITH (FILLFACTOR=20);
+
+COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
+    IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/test.json b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/test.json
new file mode 100644
index 000000000..a175bc29c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/test.json
@@ -0,0 +1,106 @@
+{
+  "scenarios": [
+    {
+      "type": "create",
+      "name": "Create Table",
+      "endpoint": "NODE-table.obj",
+      "sql_endpoint": "NODE-table.sql_id",
+      "data": {
+        "name": "tableforcon",
+        "columns": [{
+          "name": "col1",
+          "cltype": "integer",
+          "is_primary_key": false
+        }],
+        "is_partitioned": false,
+        "schema": "testschema",
+        "spcname": "pg_default"
+      },
+      "store_object_id": true
+    }, {
+      "type": "create",
+      "name": "Create Index",
+      "endpoint": "NODE-index.obj",
+      "sql_endpoint": "NODE-index.sql_id",
+      "data": {
+        "name": "uindex",
+        "spcname": "pg_default",
+        "amname": "btree",
+        "columns": [{
+          "colname": "col1",
+          "sort_order": false,
+          "nulls": false,
+          "is_sort_nulls_applicable": true
+        }],
+        "indisunique": true,
+        "fillfactor": 20
+      }
+    }, {
+      "type": "create",
+      "name": "Create Primary Key Constraint",
+      "endpoint": "NODE-primary_key.obj",
+      "sql_endpoint": "NODE-primary_key.sql_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#",
+        "comment": "Comment for create",
+        "fillfactor": 20,
+        "columns": [{"column":"col1"}],
+        "condeferrable": true,
+        "condeferred": true
+      },
+      "expected_sql_file": "create_index_constraint.sql",
+      "expected_msql_file": "create_msql_index_constraint.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter Primary Key Constraint",
+      "endpoint": "NODE-primary_key.obj_id",
+      "sql_endpoint": "NODE-primary_key.sql_id",
+      "msql_endpoint": "NODE-primary_key.msql_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#a",
+        "fillfactor": 90,
+        "comment": "Comment for alter"
+      },
+      "expected_sql_file": "alter_index_constraint.sql",
+      "expected_msql_file": "alter_msql_index_constraint.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop Primary Key Constraint",
+      "endpoint": "NODE-primary_key.delete_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#a"
+      }
+    }, {
+      "type": "create",
+      "name": "Create Primary Key Constraint with Index",
+      "endpoint": "NODE-primary_key.obj",
+      "sql_endpoint": "NODE-primary_key.sql_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#",
+        "comment": "Comment for create",
+        "index": "uindex"
+      },
+      "expected_sql_file": "create_index_constraint_with_index.sql"
+    }, {
+      "type": "alter",
+      "name": "Alter Primary Key Constraint with Index",
+      "endpoint": "NODE-primary_key.obj_id",
+      "sql_endpoint": "NODE-primary_key.sql_id",
+      "msql_endpoint": "NODE-primary_key.msql_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#a",
+        "fillfactor": 90,
+        "comment": "Comment for alter"
+      },
+      "expected_sql_file": "alter_index_constraint_with_index.sql",
+      "expected_msql_file": "alter_msql_index_constraint_with_index.sql"
+    }, {
+      "type": "delete",
+      "name": "Drop Primary Key Constraint with Index",
+      "endpoint": "NODE-primary_key.delete_id",
+      "data": {
+        "name": "Pk_$%{}[]()&*^!@\"'`\\/#a"
+      }
+    }
+  ]
+}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql
index 5d85ec7b1..8956cdc99 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql
@@ -1,9 +1,9 @@
 ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} {{constraint_name}} {% if data.index %}USING INDEX {{ conn|qtIdent(data.index) }}{% else %}
 ({% for columnobj in data.columns %}{% if loop.index != 1 %}
-, {% endif %}{{ conn|qtIdent(columnobj.column)}}{% endfor %})
-{% if data.include|length > 0 %}
-    INCLUDE({% for col in data.include %}{% if loop.index != 1 %}, {% endif %}{{conn|qtIdent(col)}}{% endfor %}){% endif %}
+, {% endif %}{{ conn|qtIdent(columnobj.column)}}{% endfor %}){% if data.include|length > 0 %}
+
+    INCLUDE ({% for col in data.include %}{% if loop.index != 1 %}, {% endif %}{{conn|qtIdent(col)}}{% endfor %}){% endif %}
 {% if data.fillfactor %}
 
     WITH (FILLFACTOR={{data.fillfactor}}){% endif %}{% if data.spcname and data.spcname != "pg_default" %}
@@ -12,7 +12,7 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
 
     DEFERRABLE{% if data.condeferred %}
  INITIALLY DEFERRED{% endif%}
-{% endif%};
+{% endif -%};
 {% if data.comment and data.name %}
 
 COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql
index 2bd34a473..c83dd99fe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql
@@ -9,9 +9,9 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
 
     DEFERRABLE{% if data.condeferred %}
  INITIALLY DEFERRED{% endif%}
-{% endif%};
+{% endif -%};
 {% if data.comment and data.name %}
 
 COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
     IS {{ data.comment|qtLiteral }};
-{% endif %}
\ No newline at end of file
+{% endif %}
