diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
index b105249..14fdef1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
@@ -269,6 +269,22 @@ class EventTriggerView(PGChildNodeView):
             status=200
         )
 
+    def _formatter(self, result):
+        """
+        This function is ued to parse security lables
+        """
+        seclabels = []
+        if 'seclabels' in result and result['seclabels'] is not None:
+            for sec in result['seclabels']:
+                sec = re.search(r'([^=]+)=(.*$)', sec)
+                seclabels.append({
+                    'provider': sec.group(1),
+                    'label': sec.group(2)
+                })
+
+        result['seclabels'] = seclabels
+        return result
+
     @check_precondition
     def properties(self, gid, sid, did, etid):
         """
@@ -290,16 +306,8 @@ class EventTriggerView(PGChildNodeView):
             return internal_server_error(errormsg=res)
 
         result = res['rows'][0]
-        sec_labels = []
+        result = self._formatter(result)
 
-        if 'seclabels' in result and result['seclabels'] is not None:
-            for sec in result['seclabels']:
-                sec = re.search(r'([^=]+)=(.*$)', sec)
-                sec_labels.append({
-                    'provider': sec.group(1),
-                    'securitylabel': sec.group(2)
-                })
-        result.update({"seclabels": sec_labels})
         return ajax_response(
             response=result,
             status=200
@@ -517,6 +525,8 @@ class EventTriggerView(PGChildNodeView):
             if not status:
                 return internal_server_error(errormsg=res)
             old_data = res['rows'][0]
+            old_data = self._formatter(old_data)
+
             for arg in required_args:
                 if arg not in data:
                     data[arg] = old_data[arg]
@@ -568,6 +578,7 @@ class EventTriggerView(PGChildNodeView):
                 return internal_server_error(errormsg=res)
 
             result = res['rows'][0]
+            result = self._formatter(result)
 
             sql = render_template("/".join([self.template_path, 'create.sql']), data=result, conn=self.conn)
             sql += "\n\n"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
index 195a292..af1f6e3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
@@ -2,35 +2,6 @@ define(
         ['jquery', 'underscore', 'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'],
 function($, _, S, pgAdmin, pgBrowser, alertify) {
 
-    // Extend the browser's node model class to create a security model
-    var SecurityLabelModel = pgAdmin.Browser.Node.Model.extend({
-        defaults: {
-          provider: undefined,
-          securitylabel: undefined
-        },
-        // Define the schema for the Security Label
-        schema: [
-          {id: 'provider', label:'Provider', type:'text', group: null, editable: true},
-          {id: 'securitylabel', label:'Security Label', type: 'text', group:null, extraHeaderClasses: 'cellwidth-40', editable: true},
-        ],
-        validate: function() {
-            // Clear any existing errors.
-
-            this.errorModel.clear()
-            if (_.isUndefined(this.get('provider')) || String(this.get('provider')).replace(/^\s+|\s+$/g, '') == '') {
-                var msg = '{{ _('Provider cannot be empty.') }}';
-                this.errorModel.set('provider',msg);
-                return msg;
-            }
-            if (_.isUndefined(this.get('securitylabel')) || String(this.get('securitylabel')).replace(/^\s+|\s+$/g, '') == '') {
-                var msg = '{{ _('Security Label cannot be empty.') }}';
-                this.errorModel.set('securitylabel',msg);
-                return msg;
-            }
-            return null;
-        }
-    });
-
   // Extend the browser's collection class for event trigger collection
   if (!pgBrowser.Nodes['coll-event_trigger']) {
     var databases = pgAdmin.Browser.Nodes['coll-event_trigger'] =
@@ -145,10 +116,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
         },{
           id: 'when', label:'{{ _('When') }}', type: 'multiline', group: "Definition",
         },{
-          id: 'providers', label: 'Security Labels', type: 'collection', group: "Security Labels",
-          model: SecurityLabelModel, control: 'unique-col-collection', mode: ['edit', 'create'],
-          canAdd: true, canDelete: true, uniqueCol : ['provider'],
-          columns: ['provider','securitylabel']
+          id: 'seclabels', label: '{{ _('Security Labels') }}',
+          model: pgBrowser.SecLabelModel, editable: false, type: 'collection',
+          group: '{{ _('Security') }}', mode: ['edit', 'create'],
+          min_version: 90200, canAdd: true,
+          canEdit: false, canDelete: true, control: 'unique-col-collection'
          }
         ],
         // event trigger model data validation.
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/grant.sql
index f8365ff..9002355 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/grant.sql
@@ -15,10 +15,10 @@ ALTER EVENT TRIGGER {{ conn|qtIdent(data.name) }}
 COMMENT ON EVENT TRIGGER {{ conn|qtIdent(data.name) }}
     IS {{ data.comment|qtLiteral }};
 {% endif %}
-{% if data.providers and data.providers|length > 0 %}
+{% if data.seclabels and data.seclabels|length > 0 %}
 
-{% for r in data.providers %}
-{{ SECLABLE.APPLY(conn, 'EVENT TRIGGER', data.name, r.provider, r.securitylabel) }}
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'EVENT TRIGGER', data.name, r.provider, r.label) }}
 {% endfor %}{% endif %}
 
 ALTER EVENT TRIGGER {{ conn|qtIdent(data.name) }}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql
index 0df12b3..d0a1009 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/properties.sql
@@ -4,7 +4,7 @@ e.evtenabled AS enabled,
 e.evtfoid AS eventfuncoid, quote_ident(n.nspname) || '.' || e.evtfoid::regproc AS eventfunname,
 array_to_string(array(select quote_literal(x) from unnest(evttags) as t(x)), ', ') AS when,
  pg_catalog.obj_description(e.oid, 'pg_event_trigger') AS comment,
- (SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=e.oid) AS seclabels,
+ (SELECT array_agg(provider || '=' || label) FROM pg_seclabel sl1 WHERE sl1.objoid=e.oid) AS seclabels,
  p.prosrc AS source, p.pronamespace AS schemaoid, l.lanname AS language
  FROM pg_event_trigger e
  LEFT OUTER JOIN pg_proc p ON p.oid=e.evtfoid
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/update.sql
index 34d9846..ee4ea01 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/sql/9.3_plus/update.sql
@@ -37,9 +37,9 @@ ALTER EVENT TRIGGER {{ conn|qtIdent(data.name) }}
 {% endif %}
 {% endif %}
 
-{% if data.providers and
-	data.providers|length > 0
-%}{% set seclabels = data.providers %}
+{% if data.seclabels and
+	data.seclabels|length > 0
+%}{% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 
 {% for r in seclabels.deleted %}
@@ -49,13 +49,13 @@ ALTER EVENT TRIGGER {{ conn|qtIdent(data.name) }}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'EVENT TRIGGER', data.name, r.provider, r.securitylabel) }}
+{{ SECLABLE.APPLY(conn, 'EVENT TRIGGER', data.name, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'EVENT TRIGGER', data.name, r.provider, r.securitylabel) }}
+{{ SECLABLE.APPLY(conn, 'EVENT TRIGGER', data.name, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py
index e1c31c4..04e87a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/__init__.py
@@ -325,6 +325,19 @@ class LanguageView(PGChildNodeView):
                 else:
                     res['rows'][0][row['deftype']] = [priv]
 
+        seclabels = []
+        if 'seclabels' in res['rows'][0] and res['rows'][0]['seclabels'] is not None:
+            import re
+            for sec in res['rows'][0]['seclabels']:
+                sec = re.search(r'([^=]+)=(.*$)', sec)
+                seclabels.append({
+                    'provider': sec.group(1),
+                    'label': sec.group(2)
+                })
+
+        res['rows'][0]['seclabels'] = seclabels
+
+
         return ajax_response(
             response=res['rows'][0],
             status=200
@@ -439,7 +452,7 @@ class LanguageView(PGChildNodeView):
                         data[arg] = old_data[arg]
                 sql = render_template("/".join([self.template_path, 'update.sql']), data=data,
                                       o_data=old_data, conn=self.conn)
-            return sql
+            return sql.strip('\n')
         except Exception as e:
             return internal_server_error(errormsg=str(e))
 
@@ -480,9 +493,33 @@ class LanguageView(PGChildNodeView):
 
         # Making copy of output for future use
         old_data = dict(res['rows'][0])
+
+        sql = render_template("/".join([self.template_path, 'acl.sql']), lid=lid)
+        status, result = self.conn.execute_dict(sql)
+        if not status:
+            return internal_server_error(errormsg=result)
+
+        for row in result['rows']:
+            priv = parse_priv_from_db(row)
+            if row['deftype'] in old_data:
+                old_data[row['deftype']].append(priv)
+            else:
+                old_data[row['deftype']] = [priv]
+
+        seclabels = []
+        if 'seclabels' in old_data and old_data['seclabels'] is not None:
+            import re
+            for sec in old_data['seclabels']:
+                sec = re.search(r'([^=]+)=(.*$)', sec)
+                seclabels.append({
+                    'provider': sec.group(1),
+                    'label': sec.group(2)
+                })
+
+        old_data['seclabels'] = seclabels
         sql = render_template("/".join([self.template_path, 'sqlpane.sql']), data=old_data, conn=self.conn)
 
-        return ajax_response(response=sql)
+        return ajax_response(response=sql.strip('\n'))
 
     @check_precondition
     def dependents(self, gid, sid, did, lid):
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/properties.sql
index 96884d4..5306642 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/properties.sql
@@ -3,8 +3,7 @@ SELECT
     array_to_string(lanacl::text[], ', ') as acl, hp.proname as lanproc,
     vp.proname as lanval, description,
     pg_get_userbyid(lan.lanowner) as lanowner, ip.proname as laninl,
-    (SELECT array_agg(label) FROM pg_seclabels sl1 WHERE sl1.objoid=lan.oid) AS labels,
-    (SELECT array_agg(provider) FROM pg_seclabels sl2 WHERE sl2.objoid=lan.oid) AS providers
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabel sl1 WHERE sl1.objoid=lan.oid) AS seclabels
 FROM
     pg_language lan JOIN pg_proc hp ON hp.oid=lanplcallfoid
     LEFT OUTER JOIN pg_proc ip ON ip.oid=laninline
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/sqlpane.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/sqlpane.sql
index f6978ba..4268e3e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/sqlpane.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/sqlpane.sql
@@ -1,3 +1,5 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/security.macros' as SECLABLE %}
 -- Language: {{data.name}}
 
 -- DROP LANGUAGE {{ conn|qtIdent(data.name) }}
@@ -12,15 +14,29 @@ CREATE {% if data.trusted %}TRUSTED{% endif %} PROCEDURAL LANGUAGE {{ conn|qtIde
 {% endif %}
 {% if data.lanval %}
     VALIDATOR {{ conn|qtIdent(data.lanval) }}{% endif %};
-  
-{# ============= ALTER LANGUAGE Query ============= #}
+  {# ============= ALTER LANGUAGE Query ============= #}
 {% if data.lanowner %}
+
 ALTER LANGUAGE {{ conn|qtIdent(data.name) }}
     OWNER TO {{ conn|qtIdent(data.lanowner) }};
 {% endif %}
-
 {# ============= Comment on LANGUAGE Query ============= #}
 {% if data.description %}
+
 COMMENT ON LANGUAGE {{ conn|qtIdent(data.name) }}
     IS {{ data.description|qtLiteral }};
+{% endif %}
+{# ============= PRIVILEGES on LANGUAGE ============= #}
+{% if data.lanacl and data.lanacl|length > 0 %}
+
+{% for priv in data.lanacl %}
+{{ PRIVILEGE.RESETALL(conn, 'LANGUAGE', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{# ============= PRIVILEGES on LANGUAGE ============= #}
+{% if data.seclabels and data.seclabels|length > 0 %}
+
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider, r.label) }}
+{% endfor %}
 {% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/update.sql
index 802ad83..1282e54 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.1_plus/update.sql
@@ -1,4 +1,5 @@
 {% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/security.macros' as SECLABLE %}
 {% if data %}
 {# ============= Update language name ============= #}
 {% if data.name != o_data.name %}
@@ -35,4 +36,27 @@ COMMENT ON LANGUAGE {{ conn|qtIdent(data.name) }}
 {{ PRIVILEGE.APPLY(conn, 'LANGUAGE', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
 {% endfor %}
 {% endif %}
+{% endif %}
+
+{% if data.seclabels and
+	data.seclabels|length > 0
+%}{% set seclabels = data.seclabels %}
+{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
+
+{% for r in seclabels.deleted %}
+{{ SECLABLE.DROP(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
 {% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/properties.sql
index 96884d4..5306642 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/properties.sql
@@ -3,8 +3,7 @@ SELECT
     array_to_string(lanacl::text[], ', ') as acl, hp.proname as lanproc,
     vp.proname as lanval, description,
     pg_get_userbyid(lan.lanowner) as lanowner, ip.proname as laninl,
-    (SELECT array_agg(label) FROM pg_seclabels sl1 WHERE sl1.objoid=lan.oid) AS labels,
-    (SELECT array_agg(provider) FROM pg_seclabels sl2 WHERE sl2.objoid=lan.oid) AS providers
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabel sl1 WHERE sl1.objoid=lan.oid) AS seclabels
 FROM
     pg_language lan JOIN pg_proc hp ON hp.oid=lanplcallfoid
     LEFT OUTER JOIN pg_proc ip ON ip.oid=laninline
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/sqlpane.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/sqlpane.sql
index 905ef1a..3805fc0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/sqlpane.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/sqlpane.sql
@@ -1,3 +1,5 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/security.macros' as SECLABLE %}
 -- Language: {{data.name}}
 
 -- DROP LANGUAGE {{ conn|qtIdent(data.name) }}
@@ -12,15 +14,29 @@ CREATE {% if data.trusted %}TRUSTED{% endif %} PROCEDURAL LANGUAGE {{ conn|qtIde
 {% endif %}
 {% if data.lanval %}
     VALIDATOR {{ conn|qtIdent(data.lanval) }}{% endif %};
-    
-{# ============= ALTER LANGUAGE Query ============= #}
+    {# ============= ALTER LANGUAGE Query ============= #}
 {% if data.lanowner %}
+
 ALTER LANGUAGE {{ conn|qtIdent(data.name) }}
     OWNER TO {{ conn|qtIdent(data.lanowner) }};
 {% endif %}
-
 {# ============= Comment on LANGUAGE Query ============= #}
 {% if data.description %}
+
 COMMENT ON LANGUAGE {{ conn|qtIdent(data.name) }}
     IS {{ data.description|qtLiteral }};
+{% endif %}
+{# ============= PRIVILEGES on LANGUAGE ============= #}
+{% if data.lanacl and data.lanacl|length > 0 %}
+
+{% for priv in data.lanacl %}
+{{ PRIVILEGE.RESETALL(conn, 'LANGUAGE', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{# ============= PRIVILEGES on LANGUAGE ============= #}
+{% if data.seclabels and data.seclabels|length > 0 %}
+
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider, r.label) }}
+{% endfor %}
 {% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/update.sql
index 802ad83..1282e54 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/9.3_plus/update.sql
@@ -1,4 +1,5 @@
 {% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/security.macros' as SECLABLE %}
 {% if data %}
 {# ============= Update language name ============= #}
 {% if data.name != o_data.name %}
@@ -35,4 +36,27 @@ COMMENT ON LANGUAGE {{ conn|qtIdent(data.name) }}
 {{ PRIVILEGE.APPLY(conn, 'LANGUAGE', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
 {% endfor %}
 {% endif %}
+{% endif %}
+
+{% if data.seclabels and
+	data.seclabels|length > 0
+%}{% set seclabels = data.seclabels %}
+{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
+
+{% for r in seclabels.deleted %}
+{{ SECLABLE.DROP(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'PROCEDURAL LANGUAGE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
 {% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/9.2_plus/properties.sql
index 2892988..87cc84c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/9.2_plus/properties.sql
@@ -10,7 +10,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=d.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/properties.sql
index c557c87..b2ef81d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/properties.sql
@@ -4,7 +4,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=c.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/properties.sql
index 3976a07..586c42a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/properties.sql
@@ -4,7 +4,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=c.oid) AS seclabels
     {% if foid %},
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js
index 7e4ffa7..2ef91f8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js
@@ -307,8 +307,11 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
           id: 'seclabels', label: '{{ _('Security Labels') }}', canAdd: true,
           model: pgBrowser.SecLabelModel, type: 'collection',
           min_version: 90100, group: 'security', mode: ['edit', 'create'],
-          canEdit: true, canDelete: true, uniqueCol : ['provider'],
-          disabled: 'isDisabled', control: 'unique-col-collection'
+          canEdit: false, canDelete: true, uniqueCol : ['provider'],
+          disabled: 'isDisabled', control: 'unique-col-collection',
+          visible: function() {
+            return this.node_data && this.node_data._type != 'procedure';
+          }
         }
         ],
         validate: function()
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/properties.sql
index ff78298..9e8a8ba 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.2_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/properties.sql
index ff78298..9e8a8ba 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/pg/sql/9.5_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/properties.sql
index ff78298..9e8a8ba 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.2_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/properties.sql
index ff78298..9e8a8ba 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/ppas/sql/9.5_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.2_plus/properties.sql
index 6cfec94..9492f3c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.2_plus/properties.sql
@@ -14,7 +14,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/properties.sql
index 6cfec94..9492f3c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedure/ppas/sql/9.5_plus/properties.sql
@@ -14,7 +14,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/properties.sql
index 9468871..409e0ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.2_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/properties.sql
index 9468871..409e0ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/pg/sql/9.5_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/properties.sql
index 9468871..409e0ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.2_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/properties.sql
index 9468871..409e0ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/trigger_function/ppas/sql/9.5_plus/properties.sql
@@ -7,7 +7,7 @@ SELECT
     (SELECT
         array_agg(provider || '=' || label)
     FROM
-        pg_shseclabel sl1
+        pg_seclabel sl1
     WHERE
         sl1.objoid=pr.oid) AS seclabels
 FROM
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py
index b5025a0..1aa5ae0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/__init__.py
@@ -241,16 +241,6 @@ class SequenceView(PGChildNodeView):
         if not status:
             return internal_server_error(errormsg=res)
 
-        sec_lbls = []
-        if 'securities' in res and res['securities'] is not None:
-            for sec in res['seclabels']:
-                sec = re.search(r'([^=]+)=(.*$)', sec)
-                sec_lbls.append({
-                    'provider': sec.group(1),
-                    'label': sec.group(2)
-                })
-        res['securities'] = sec_lbls
-
         for row in res['rows']:
             SQL = render_template("/".join([self.template_path, 'get_def.sql']), data=row)
             status, rset1 = self.conn.execute_dict(SQL)
@@ -264,6 +254,17 @@ class SequenceView(PGChildNodeView):
             row['cache'] = rset1['rows'][0]['cache_value']
             row['cycled'] = rset1['rows'][0]['is_cycled']
 
+            sec_lbls = []
+            if 'securities' in row and row['securities'] is not None:
+                for sec in row['securities']:
+                    import re
+                    sec = re.search(r'([^=]+)=(.*$)', sec)
+                    sec_lbls.append({
+                        'provider': sec.group(1),
+                        'label': sec.group(2)
+                    })
+            row['securities'] = sec_lbls
+
         SQL = render_template("/".join([self.template_path, 'acl.sql']), scid=scid, seid=seid)
         status, dataclres = self.conn.execute_dict(SQL)
         if not status:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql
index d536906..130b4a8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.1_plus/properties.sql
@@ -18,7 +18,7 @@ SELECT att.attname as name, att.*, def.*, pg_catalog.pg_get_expr(def.adbin, def.
 	ELSE format_type(ty.oid,att.atttypmod) END AS cltype,
 	-- End pgAdmin4
 	EXISTS(SELECT 1 FROM pg_constraint WHERE conrelid=att.attrelid AND contype='f' AND att.attnum=ANY(conkey)) As is_fk,
-	(SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=att.atttypid AND sl1.objsubid=0) AS seclabels,
+	(SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE WHERE sl1.objoid=att.attrelid AND sl1.objsubid=att.attnum) AS seclabels,
 	(CASE WHEN (att.attnum < 1) THEN true ElSE false END) AS is_sys_column
 FROM pg_attribute att
   JOIN pg_type ty ON ty.oid=atttypid
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql
index d536906..8c5b189 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/column/sql/9.2_plus/properties.sql
@@ -18,7 +18,7 @@ SELECT att.attname as name, att.*, def.*, pg_catalog.pg_get_expr(def.adbin, def.
 	ELSE format_type(ty.oid,att.atttypmod) END AS cltype,
 	-- End pgAdmin4
 	EXISTS(SELECT 1 FROM pg_constraint WHERE conrelid=att.attrelid AND contype='f' AND att.attnum=ANY(conkey)) As is_fk,
-	(SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=att.atttypid AND sl1.objsubid=0) AS seclabels,
+	(SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=att.attrelid AND sl1.objsubid=att.attnum) AS seclabels,
 	(CASE WHEN (att.attnum < 1) THEN true ElSE false END) AS is_sys_column
 FROM pg_attribute att
   JOIN pg_type ty ON ty.oid=atttypid
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/update.sql
index 8c64dad..1bb0607 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.1_plus/update.sql
@@ -184,7 +184,7 @@ COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABEL.UNSET(conn, 'TABLE', data.name, r.provider, data.schema) }}
+{{ SECLABLE.UNSET(conn, 'TABLE', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/update.sql
index 8c64dad..1bb0607 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/9.5_plus/update.sql
@@ -184,7 +184,7 @@ COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABEL.UNSET(conn, 'TABLE', data.name, r.provider, data.schema) }}
+{{ SECLABLE.UNSET(conn, 'TABLE', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.1_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.1_plus/sql/properties.sql
index 245d45f..41ee062 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.1_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.1_plus/sql/properties.sql
@@ -11,7 +11,8 @@ SELECT
     ELSE false END AS is_sys_object,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = nsp.oid) AS tblacl,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = nsp.oid) AS seqacl,
-    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = nsp.oid) AS funcacl
+    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = nsp.oid) AS funcacl,
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
 FROM
     pg_namespace nsp
     LEFT OUTER JOIN pg_description des ON
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.2_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.2_plus/sql/properties.sql
index abd4890..6dc8155 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.2_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/ppas/9.2_plus/sql/properties.sql
@@ -12,7 +12,8 @@ SELECT
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = nsp.oid) AS tblacl,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = nsp.oid) AS seqacl,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = nsp.oid) AS funcacl,
-    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'T' AND defaclnamespace = nsp.oid) AS typeacl
+    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'T' AND defaclnamespace = nsp.oid) AS typeacl,
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
 FROM
     pg_namespace nsp
     LEFT OUTER JOIN pg_description des ON
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.1_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.1_plus/sql/properties.sql
index c4940bd..8c9d47a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.1_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.1_plus/sql/properties.sql
@@ -14,7 +14,8 @@ SELECT
     ELSE false END AS is_sys_object,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = nsp.oid) AS tblacl,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = nsp.oid) AS seqacl,
-    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = nsp.oid) AS funcacl
+    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = nsp.oid) AS funcacl,
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
 FROM
     pg_namespace nsp
     LEFT OUTER JOIN pg_description des ON
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.2_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.2_plus/sql/properties.sql
index 0d7b339..e46a630 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.2_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/pg/9.2_plus/sql/properties.sql
@@ -15,7 +15,8 @@ SELECT
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = nsp.oid) AS tblacl,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = nsp.oid) AS seqacl,
     (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = nsp.oid) AS funcacl,
-    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'T' AND defaclnamespace = nsp.oid) AS typeacl
+    (SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'T' AND defaclnamespace = nsp.oid) AS typeacl,
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabels sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
 FROM
     pg_namespace nsp
     LEFT OUTER JOIN pg_description des ON
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
index 769ebb2..381232d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
@@ -418,6 +418,16 @@ class TypeView(PGChildNodeView, DataTypeReader):
             range_dict = dict(res['rows'][0])
             res.update(range_dict)
 
+        if 'seclabels' in copy_dict and copy_dict['seclabels'] is not None:
+            sec_labels = []
+            for sec in copy_dict['seclabels']:
+                sec = re.search(r'([^=]+)=(.*$)', sec)
+                sec_labels.append({
+                    'provider': sec.group(1),
+                    'label': sec.group(2)
+                })
+            res['seclabels'] = sec_labels
+
         # Returning only additional properties only
         return res
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/properties.sql
index de261a5..83c6a6a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/9.1_plus/properties.sql
@@ -6,7 +6,7 @@ SELECT t.oid, t.typname AS name,
     description, ct.oid AS taboid,
     nsp.nspname AS schema,
     --MinimumVersion 9.1 START
-    (SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=t.oid) AS seclabels,
+    (SELECT array_agg(provider || '=' || label) FROM pg_seclabel sl1 WHERE sl1.objoid=t.oid) AS seclabels,
     -- END
     (CASE WHEN (t.oid <= {{ datlastsysoid}}::oid OR ct.oid != 0) THEN true ElSE false END) AS is_sys_type
 FROM pg_type t
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
index 741423f..eef478b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
@@ -974,6 +974,11 @@ class ViewNode(PGChildNodeView, VacuumSettings):
             return internal_server_error(errormsg=res)
 
         result = res['rows'][0]
+        # sending result to formtter
+        frmtd_reslt = self.formatter(result)
+
+        # merging formated result with main result again
+        result.update(frmtd_reslt)
 
         # Fetch all privileges for view
         SQL = render_template("/".join(
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/properties.sql
index ce1d801..03aa2e6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/properties.sql
@@ -15,18 +15,12 @@ SELECT
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
     (SELECT
-        array_agg(label)
+        array_agg(provider || '=' || label)
      FROM
         pg_seclabels sl1
      WHERE
         sl1.objoid=c.oid AND sl1.objsubid=0
-    ) AS labels,
-    (SELECT
-        array_agg(provider)
-     FROM
-        pg_seclabels sl2
-     WHERE sl2.objoid=c.oid AND sl2.objsubid=0
-    ) AS providers
+    ) AS seclabels,
 FROM pg_class c
     LEFT OUTER JOIN pg_namespace nsp on nsp.oid = c.relnamespace
     LEFT OUTER JOIN pg_tablespace spc on spc.oid=c.reltablespace
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/update.sql
index 16a11e8..65f8383 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.1_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -50,17 +50,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/properties.sql
index a36de26..8ad3b36 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/properties.sql
@@ -15,18 +15,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     (substring(array_to_string(c.reloptions, ',')
         FROM 'security_barrier=([a-z|0-9]*)'))::boolean AS security_barrier
 FROM pg_class c
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/update.sql
index b008ede..b4468ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.2_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -58,17 +58,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/properties.sql
index 0fc7a2f..045cc9a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/properties.sql
@@ -16,18 +16,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     (substring(array_to_string(c.reloptions, ',')
         FROM 'security_barrier=([a-z|0-9]*)'))::boolean AS security_barrier
 FROM pg_class c
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/update.sql
index b008ede..b4468ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.3_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -58,17 +58,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/properties.sql
index 4e5a889..6dea869 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/properties.sql
@@ -17,18 +17,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     substring(array_to_string(c.reloptions, ',')
         FROM 'check_option=([a-z]*)') AS check_option,
     (substring(array_to_string(c.reloptions, ',')
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/update.sql
index 78b655e..f1664bc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/pg/9.4_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -64,17 +64,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/properties.sql
index aa270e2..da9053c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/properties.sql
@@ -16,18 +16,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     substring(array_to_string(c.reloptions, ',')
         FROM 'check_option=([a-z]*)') AS check_option,
     (substring(array_to_string(c.reloptions, ',')
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/update.sql
index b008ede..b4468ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.1_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -58,17 +58,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/properties.sql
index 20eb3df..43d53e7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/properties.sql
@@ -14,18 +14,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     (substring(array_to_string(c.reloptions, ',')
         FROM 'security_barrier=([a-z|0-9]*)'))::boolean AS security_barrier
 FROM pg_class c
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/update.sql
index b008ede..b4468ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.2_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -58,17 +58,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/properties.sql
index 0fc7a2f..045cc9a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/properties.sql
@@ -16,18 +16,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     (substring(array_to_string(c.reloptions, ',')
         FROM 'security_barrier=([a-z|0-9]*)'))::boolean AS security_barrier
 FROM pg_class c
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/update.sql
index b008ede..b4468ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.3_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -58,17 +58,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/grant.sql
index 35a5e25..45b50dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/grant.sql
@@ -1,6 +1,6 @@
 {# ===== Grant Permissions to User Role on Views/Tables ===== #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {# ===== We will generate Security Label SQL using macro ===== #}
-{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
+{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}{{'\r'}}{% endfor %}{{'\r'}}{% endif %}{% if data.datacl %}
 {% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/properties.sql
index 4e5a889..6dea869 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/properties.sql
@@ -17,18 +17,13 @@ SELECT
     {% if vid and datlastsysoid %}
     CASE WHEN {{vid}} <= {{datlastsysoid}} THEN True ELSE False END AS system_view,
     {% endif %}
-(SELECT
-    array_agg(label)
-FROM
-    pg_seclabels sl1
-WHERE
-    sl1.objoid=c.oid AND sl1.objsubid=0) AS labels,
-(SELECT
-    array_agg(provider)
-FROM
-    pg_seclabels sl2
-WHERE
-    sl2.objoid=c.oid AND sl2.objsubid=0) AS providers,
+    (SELECT
+        array_agg(provider || '=' || label)
+     FROM
+        pg_seclabels sl1
+     WHERE
+        sl1.objoid=c.oid AND sl1.objsubid=0
+    ) AS seclabels,
     substring(array_to_string(c.reloptions, ',')
         FROM 'check_option=([a-z]*)') AS check_option,
     (substring(array_to_string(c.reloptions, ',')
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/update.sql
index 78b655e..f1664bc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/view/ppas/9.4_plus/sql/update.sql
@@ -1,5 +1,5 @@
 {# ============================ Update View ========================= #}
-{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/schemas/security.macros' as SECLABLE %}
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% set view_name = data.name if data.name else o_data.name %}
@@ -64,17 +64,17 @@ COMMENT ON VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% set seclabels = data.seclabels %}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 {% for r in seclabels.deleted %}
-{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
+{{ SECLABLE.UNSET(conn, 'VIEW', data.name, r.provider, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 {% for r in seclabels.added %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 {% for r in seclabels.changed %}
-{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
+{{ SECLABLE.SET(conn, 'VIEW', data.name, r.provider, r.label, data.schema) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
index 61671f4..b65bc23 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/js/databases.js
@@ -289,7 +289,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
           canAdd: true, canEdit: false, canDelete: true, hasRole: true,
           control: Backform.VariableCollectionControl, node: 'role'
         },{
-          id: 'securities', label: '{{ _('Security Labels') }}',
+          id: 'seclabels', label: '{{ _('Security Labels') }}',
           model: pgBrowser.SecLabelModel,
           editable: false, type: 'collection', canEdit: false,
           group: '{{ _('Security') }}', canDelete: true,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/alter_online.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/alter_online.sql
index ff32925..e69c9b5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/alter_online.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/alter_online.sql
@@ -1,3 +1,4 @@
+{% import 'macros/security.macros' as SECLABEL %}
 {% import 'macros/variable.macros' as VARIABLE %}
 {% import 'macros/privilege.macros' as PRIVILEGE %}
 {% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
@@ -128,3 +129,22 @@ ALTER DATABASE {{ conn|qtIdent(data.name) }} WITH CONNECTION LIMIT = {{ data.dat
 {% endif %}
 
 {% endif %}
+{# Change the security labels #}
+{% if data.seclabels and data.seclabels|length > 0 %}
+{% set seclabels = data.seclabels %}
+{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
+{% for r in seclabels.deleted %}
+{{ SECLABEL.DROP(conn, 'DATABASE', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABEL.APPLY(conn, 'DATABASE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABEL.APPLY(conn, 'DATABASE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/grant.sql
index 4572cc9..b9275c6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.1_plus/grant.sql
@@ -3,6 +3,7 @@
 # other sql statments along with it, so we wrote
 # seprate sql for rest alter sql statments here
 #}
+{% import 'macros/security.macros' as SECLABEL %}
 {% import 'macros/variable.macros' as VARIABLE %}
 {% import 'macros/privilege.macros' as PRIVILEGE %}
 {% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
@@ -11,6 +12,12 @@ COMMENT ON DATABASE {{ conn|qtIdent(data.name) }}
     IS {{ data.comments|qtLiteral }};
 {% endif %}
 
+{# Generate the security labels #}
+{% if data.seclabels %}
+{% for r in data.seclabels %}
+{{ SECLABEL.APPLY(conn, 'DATABASE', data.name, r.provider, r.label) }}
+{% endfor %}
+{% endif %}
 {# TO generate Variable SQL using macro #}
 {% if data.variables %}
 {% for var in data.variables %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.2_plus/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.2_plus/grant.sql
index 2884956..94f2bf4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.2_plus/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.2_plus/grant.sql
@@ -13,8 +13,8 @@ COMMENT ON DATABASE {{ conn|qtIdent(data.name) }}
 {% endif %}
 
 {# Generate the security labels #}
-{% if data.securities %}
-{% for r in data.securities %}
+{% if data.seclabels %}
+{% for r in data.seclabels %}
 {{ SECLABEL.APPLY(conn, 'DATABASE', data.name, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.3_plus/grant.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.3_plus/grant.sql
index 3731a55..6aa4af6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.3_plus/grant.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.3_plus/grant.sql
@@ -13,8 +13,8 @@ COMMENT ON DATABASE {{ conn|qtIdent(data.name) }}
 {% endif %}
 
 {# Change the security labels #}
-{% if data.securities %}
-{% for r in data.securities %}
+{% if data.seclabels %}
+{% for r in data.seclabels %}
 {{ SECLABEL.APPLY(conn, 'DATABASE', data.name, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/utils.py b/web/pgadmin/browser/server_groups/servers/databases/utils.py
index 1048489..534bd17 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/utils.py
@@ -26,6 +26,7 @@ def parse_sec_labels_from_db(db_sec_labels):
 
     if db_sec_labels is not None:
         for sec in db_sec_labels:
+            import re
             sec = re.search(r'([^=]+)=(.*$)', sec)
             sec_lbls.append({
                 'provider': sec.group(1),
diff --git a/web/pgadmin/browser/server_groups/servers/roles/__init__.py b/web/pgadmin/browser/server_groups/servers/roles/__init__.py
index ddb55b9..4e0379a 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/roles/__init__.py
@@ -653,6 +653,7 @@ rolmembership:{
                         'provider': sec.group(1),
                         'label': sec.group(2)
                     })
+                row['seclabels'] = res
 
     @check_precondition(action='properties')
     def properties(self, gid, sid, rid):
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_1/update.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_1/update.sql
index dd79100..ae5bef6 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_1/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_1/update.sql
@@ -90,19 +90,19 @@ GRANT {{ conn|qtIdent(data.members)|join(', ') }} TO {{ conn|qtIdent(rolname) }}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 
 {% for r in seclabels.deleted %}
-{{ SECLABEL.DROP(conn, 'ROLE', data.rolname, r.provider) }}
+{{ SECLABEL.DROP(conn, 'ROLE', rolname, r.provider) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 
 {% for r in seclabels.added %}
-{{ SECLABEL.APPLY(conn, 'ROLE', data.rolname, r.provider, r.label) }}
+{{ SECLABEL.APPLY(conn, 'ROLE', rolname, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 
 {% for r in seclabels.changed %}
-{{ SECLABEL.APPLY(conn, 'ROLE', data.rolname, r.provider, r.label) }}
+{{ SECLABEL.APPLY(conn, 'ROLE', rolname, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/update.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/update.sql
index 2f7574f..2c4a70f 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post9_4/update.sql
@@ -65,19 +65,19 @@ GRANT {{ conn|qtIdent(data.members)|join(', ') }} TO {{ conn|qtIdent(rolname) }}
 {% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
 
 {% for r in seclabels.deleted %}
-{{ SECLABEL.DROP(conn, 'ROLE', data.rolname, r.provider) }}
+{{ SECLABEL.DROP(conn, 'ROLE', rolname, r.provider) }}
 {% endfor %}
 {% endif %}
 {% if 'added' in seclabels and seclabels.added|length > 0 %}
 
 {% for r in seclabels.added %}
-{{ SECLABEL.APPLY(conn, 'ROLE', data.rolname, r.provider, r.label) }}
+{{ SECLABEL.APPLY(conn, 'ROLE', rolname, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
 {% if 'changed' in seclabels and seclabels.changed|length > 0 %}
 
 {% for r in seclabels.changed %}
-{{ SECLABEL.APPLY(conn, 'ROLE', data.rolname, r.provider, r.label) }}
+{{ SECLABEL.APPLY(conn, 'ROLE', rolname, r.provider, r.label) }}
 {% endfor %}
 {% endif %}
 {% endif %}
