diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py
new file mode 100644
index 0000000..19a15d9
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py
@@ -0,0 +1,1248 @@
+##########################################################################
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##########################################################################
+import json
+import re
+from flask import render_template, make_response, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+    make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers as servers
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from pgadmin.browser.server_groups.servers.utils import parse_priv_from_db, \
+    parse_priv_to_db
+from functools import wraps
+
+"""
+    This module is responsible for generating two nodes
+    1) Schema
+    2) Catalog
+
+    We have created single file because catalog & schema has same functionality,
+    the only difference is we can not perform DDL/DML operations on
+    catalog.
+
+    This modules uses separate template paths for each respective node
+    - templates/catalog for Catalog node
+    - templates/schema for Schema node
+
+    [ Each path contains node specific js files as well as sql
+    template files]
+"""
+
+
+class SchemaModule(CollectionNodeModule):
+    """
+     class SchemaModule(CollectionNodeModule)
+
+        A module class for Schema node derived from CollectionNodeModule.
+
+    Methods:
+    -------
+    * __init__(*args, **kwargs)
+      - Method is used to initialize the Schema and it's base module.
+
+    * get_nodes(gid, sid, did)
+      - Method is used to generate the browser collection node.
+
+    * node_inode()
+      - Method is overridden from its base class to make the node as leaf node.
+
+    * script_load()
+      - Load the module script for schema, when any of the server node is
+        initialized.
+    """
+    NODE_TYPE = 'schema'
+    COLLECTION_LABEL = gettext("Schemas")
+
+    def __init__(self, *args, **kwargs):
+        """
+        Method is used to initialize the SchemaModule and it's base module.
+
+        Args:
+            *args:
+            **kwargs:
+        """
+        self.min_ver = None
+        self.max_ver = None
+
+        super(SchemaModule, self).__init__(*args, **kwargs)
+
+    def get_nodes(self, gid, sid, did):
+        """
+        Generate the collection node
+        """
+        yield self.generate_browser_collection_node(did)
+
+    @property
+    def script_load(self):
+        """
+        Load the module script for server, when any of the server-group node is
+        initialized.
+        """
+        return servers.ServerModule.NODE_TYPE
+
+    @property
+    def show_system_objects(self):
+        return True
+
+
+blueprint = SchemaModule(__name__)
+
+
+class SchemaView(PGChildNodeView):
+    """
+    This class is responsible for generating routes for schema node
+
+    Methods:
+    -------
+    * __init__(**kwargs)
+      - Method is used to initialize the SchemaView and it's base view.
+
+    * module_js()
+      - This property defines (if javascript) exists for this node.
+        Override this property for your own logic
+
+    * check_precondition()
+      - This function will behave as a decorator which will checks
+        database connection before running view, it will also attaches
+        manager,conn & template_path properties to self
+
+    * list()
+      - This function is used to list all the schema nodes within that
+      collection.
+
+    * nodes()
+      - This function will used to create all the child node within that
+        collection, Here it will create all the schema node.
+
+    * properties(gid, sid, did, scid)
+      - This function will show the properties of the selected schema node
+
+    * create(gid, sid, did, scid)
+      - This function will create the new schema object
+
+    * update(gid, sid, did, scid)
+      - This function will update the data for the selected schema node
+
+    * delete(self, gid, sid, scid):
+      - This function will drop the schema object
+
+    * msql(gid, sid, did, scid)
+      - This function is used to return modified SQL for the selected
+        schema node
+
+    * get_sql(data, scid)
+      - This function will generate sql from model data
+
+    * sql(gid, sid, did, scid):
+      - This function will generate sql to show it in sql pane for the
+        selected schema node.
+
+    * dependency(gid, sid, did, scid):
+      - This function will generate dependency list show it in dependency
+        pane for the selected schema node.
+
+    * dependent(gid, sid, did, scid):
+      - This function will generate dependent list to show it in dependent
+        pane for the selected schema node.
+    """
+    node_type = blueprint.node_type
+
+    parent_ids = [
+            {'type': 'int', 'id': 'gid'},
+            {'type': 'int', 'id': 'sid'},
+            {'type': 'int', 'id': 'did'}
+            ]
+    ids = [
+            {'type': 'int', 'id': 'scid'}
+            ]
+
+    operations = dict({
+        'obj': [
+            {'get': 'properties', 'delete': 'delete', 'put': 'update'},
+            {'get': 'list', 'post': 'create'}
+        ],
+        'children': [{
+            'get': 'children'
+        }],
+        'nodes': [{'get': 'node'}, {'get': 'nodes'}],
+        'sql': [{'get': 'sql'}],
+        'msql': [{'get': 'msql'}, {'get': 'msql'}],
+        'stats': [{'get': 'statistics'}],
+        'dependency': [{'get': 'dependencies'}],
+        'dependent': [{'get': 'dependents'}],
+        'module.js': [{}, {}, {'get': 'module_js'}],
+        'delete': [{'delete': 'delete'}]
+    })
+
+    @staticmethod
+    def ppas_template_path(ver):
+        """
+        Returns the template path for the PPAS servers.
+        """
+        if ver >= 90200:
+            return 'edb_9.2_plus'
+        elif ver >= 90100:
+            return 'edb_9.1_plus'
+
+        return 'edb_pre_9.1'
+
+    @staticmethod
+    def pg_template_path(ver):
+        """
+        Returns the template path for the PostgreSQL servers.
+        """
+        if ver >= 90200:
+            return '9.2_plus'
+        elif ver >= 90100:
+            return '9.1_plus'
+
+        return 'pre_9.1'
+
+    def check_precondition(f):
+        """
+        This function will behave as a decorator which will checks
+        database connection before running view, it will also attaches
+        manager,conn & template_path properties to self
+        """
+        @wraps(f)
+        def wrap(*args, **kwargs):
+            # Here args[0] will hold self & kwargs will hold gid,sid,did
+            self = args[0]
+            self.manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(
+                kwargs['sid']
+            )
+            self.conn = self.manager.connection(did=kwargs['did'])
+            # If DB not connected then return error to browser
+            if not self.conn.connected():
+                return precondition_required(
+                    gettext("Connection to the server has been lost!")
+                )
+
+            # Set template path for sql scripts
+            self.template_path = 'schema/sql/' + (
+                self.ppas_template_path(self.manager.version)
+                if self.manager.server_type == 'ppas' else
+                self.pg_template_path(self.manager.version)
+            )
+
+            # Use formatter according to PG version
+            self._formatter = self._formatter_91_plus \
+                if self.manager.version >= 90100 else self._formatter_pre_91
+
+            # ACL for schema
+            self.acl = ['C', 'U']
+
+            return f(*args, **kwargs)
+
+        return wrap
+
+    @staticmethod
+    def formatdbacl(acl):
+        """
+        Args:
+            acl: Privileges from ACL query
+
+        Returns:
+            Formatted output required for client side parsing
+        """
+        # Reset any data for that acl if its already present in result set
+        data = dict()
+        for row in acl['rows']:
+            priv = parse_priv_from_db(row)
+            if row['deftype'] in data:
+                data[row['deftype']].append(priv)
+            else:
+                data[row['deftype']] = [priv]
+        return data
+
+    def _formatter_pre_91(self, data, scid=None):
+        """
+        Args:
+            data: Result of properties query
+            scid: Schema OID
+
+        Returns:
+            It will return formatted output of collections like
+            security lables, privileges
+        """
+        # Need to format security labels according to client js collection
+        seclabels = []
+        if 'seclabels' in data and data['seclabels'] is not None:
+            for sec in data['seclabels']:
+                sec = re.search(r'([^=]+)=(.*$)', sec)
+                seclabels.append({
+                    'provider': sec.group(1),
+                    'security_label': sec.group(2)
+                    })
+
+        data['seclabels'] = seclabels
+
+        # We need to parse & convert ACL coming from database to json format
+        SQL = render_template("/".join([self.template_path, 'acl.sql']),
+                              scid=scid)
+        status, acl = self.conn.execute_dict(SQL)
+        if not status:
+            return internal_server_error(errormsg=acl)
+
+        data.update(self.formatdbacl(acl))
+
+        return data
+
+    def _formatter_91_plus(self, data, scid=None):
+
+        self._formatter_pre_91(data, scid)
+
+        # We need to parse & convert DEFAULT ACL coming from
+        # database to json format
+        SQL = render_template("/".join([self.template_path, 'defacl.sql']),
+                              scid=scid)
+        status, defacl = self.conn.execute_dict(SQL)
+        if not status:
+            return internal_server_error(errormsg=defacl)
+
+        data.update(self.formatdbacl(defacl))
+
+        return data
+
+    @check_precondition
+    def list(self, gid, sid, did):
+        """
+        This function is used to list all the schema nodes within that collection.
+
+        Args:
+            gid: Server group ID
+            sid: Server ID
+            did: Database ID
+
+        Returns:
+            JSON of available schema nodes
+        """
+        SQL = render_template("/".join([self.template_path, 'properties.sql']),
+                              show_sysobj=self.blueprint.show_system_objects
+                              )
+        status, res = self.conn.execute_dict(SQL)
+
+        if not status:
+            return internal_server_error(errormsg=res)
+        return ajax_response(
+                response=res['rows'],
+                status=200
+                )
+
+    @check_precondition
+    def nodes(self, gid, sid, did):
+        """
+        This function will used to create all the child node within that collection.
+        Here it will create all the schema node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did: Database ID
+
+        Returns:
+            JSON of available schema child nodes
+        """
+        res = []
+        SQL = render_template("/".join([self.template_path, 'properties.sql']),
+                              show_sysobj=self.blueprint.show_system_objects
+                              )
+        status, rset = self.conn.execute_2darray(SQL)
+        if not status:
+            return internal_server_error(errormsg=rset)
+
+        for row in rset['rows']:
+            res.append(
+                    self.blueprint.generate_browser_node(
+                        row['oid'],
+                        did,
+                        row['name'],
+                        icon="icon-schema"
+                    ))
+
+        return make_json_response(
+                data=res,
+                status=200
+                )
+
+    @check_precondition
+    def properties(self, gid, sid, did, scid):
+        """
+        This function will show the properties of the selected schema node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did:  Database ID
+            scid: Schema ID
+
+        Returns:
+            JSON of selected schema node
+        """
+
+        SQL = render_template("/".join([self.template_path,
+                                        'properties.sql']), scid=scid,
+                              show_sysobj=self.blueprint.show_system_objects
+                              )
+        status, res = self.conn.execute_dict(SQL)
+
+        if not status:
+            return internal_server_error(errormsg=res)
+
+        # Making copy of output for future use
+        copy_data = dict(res['rows'][0])
+        copy_data = self._formatter(copy_data, scid)
+
+        return ajax_response(
+                response=copy_data,
+                status=200
+                )
+
+    @check_precondition
+    def create(self, gid, sid, did):
+        """
+        This function will creates new the schema object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+        """
+        data = request.form if request.form else \
+            json.loads(request.data.decode())
+
+        required_args = {
+            'name': 'Name'
+        }
+
+        for arg in required_args:
+            if arg not in data:
+                return make_json_response(
+                    status=410,
+                    success=0,
+                    errormsg=gettext(
+                        "Couldn't find the required parameter (%s)." %
+                        required_args[arg]
+                    )
+                )
+        try:
+            SQL = render_template("/".join([self.template_path, 'create.sql']),
+                                  data=data, conn=self.conn)
+            status, res = self.conn.execute_scalar(SQL)
+            if not status:
+                return make_json_response(
+                    status=410,
+                    success=0,
+                    errormsg=res + '\n' +
+                    'Operation failed while running create statement'
+                    )
+
+            if 'nspacl' in data:
+                data['nspacl'] = parse_priv_to_db(data['nspacl'], self.acl)
+
+            SQL = render_template("/".join([self.template_path, 'alter.sql']),
+                                  data=data, conn=self.conn)
+            # Checking if we are not executing empty query
+            if SQL and SQL.strip('\n') and SQL.strip(' '):
+                status, res = self.conn.execute_scalar(SQL)
+                if not status:
+                    return make_json_response(
+                        status=410,
+                        success=0,
+                        errormsg=res + '\n' +
+                        'Operation failed while running alter statement'
+                        )
+
+            # we need oid to to add object in tree at browser,
+            # below sql will gives the same
+            SQL = render_template("/".join([self.template_path, 'alter.sql']),
+                                  schema=data['name'])
+            status, scid = self.conn.execute_scalar(SQL)
+            if not status:
+                return internal_server_error(errormsg=scid)
+
+            return jsonify(
+                node=self.blueprint.generate_browser_node(
+                    scid,
+                    did,
+                    data['name'],
+                    icon="icon-schema"
+                )
+            )
+        except Exception as e:
+            return internal_server_error(errormsg=str(e))
+
+    @check_precondition
+    def update(self, gid, sid, did, scid):
+        """
+        This function will updates existing the schema object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: Schema ID
+        """
+        data = request.form if request.form else json.loads(
+            request.data.decode()
+        )
+        try:
+            SQL = self.getSQL(gid, sid, data, scid)
+
+            if SQL and SQL.strip('\n') and SQL.strip(' '):
+                status, res = self.conn.execute_scalar(SQL)
+                if not status:
+                    return internal_server_error(errormsg=res)
+
+                return make_json_response(
+                    success=1,
+                    info="Schema updated",
+                    data={
+                        'id': scid,
+                        'sid': sid,
+                        'gid': gid,
+                        'did': did
+                    }
+                )
+            else:
+                return make_json_response(
+                    success=1,
+                    info="Nothing to update",
+                    data={
+                        'id': scid,
+                        'sid': sid,
+                        'gid': gid,
+                        'did': did
+                    }
+                )
+        except Exception as e:
+            return internal_server_error(errormsg=str(e))
+
+    @check_precondition
+    def delete(self, gid, sid, did, scid):
+        """
+        This function will deletes existing the schema object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: Schema ID
+        """
+        # Below will decide if it's simple drop or drop with cascade call
+        if self.cmd == 'delete':
+            # This is a cascade operation
+            cascade = True
+        else:
+            cascade = False
+
+        try:
+            # Get name for schema from did
+            SQL = render_template("/".join([self.template_path,
+                                            'delete.sql']), scid=scid)
+            status, name = self.conn.execute_scalar(SQL)
+            if not status:
+                return internal_server_error(errormsg=name)
+            # drop schema
+            SQL = render_template("/".join([self.template_path, 'delete.sql']),
+                                  name=name, cascade=cascade, conn=self.conn)
+            status, res = self.conn.execute_scalar(SQL)
+            if not status:
+                return internal_server_error(errormsg=res)
+
+            return make_json_response(
+                success=1,
+                info=gettext("Schema dropped"),
+                data={
+                    'id': scid,
+                    'sid': sid,
+                    'gid': gid,
+                    'did': did
+                }
+            )
+
+        except Exception as e:
+            return internal_server_error(errormsg=str(e))
+
+    @check_precondition
+    def msql(self, gid, sid, did, scid=None):
+        """
+        This function will generates modified sql for schema object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: Schema ID (When working with existing schema node)
+        """
+        data = dict()
+        for k, v in request.args.items():
+            try:
+                data[k] = json.loads(v)
+            except ValueError:
+                data[k] = v
+
+        try:
+            SQL = self.getSQL(gid, sid, data, scid)
+            if SQL and SQL.strip('\n') and SQL.strip(' '):
+                return make_json_response(
+                        data=SQL,
+                        status=200
+                        )
+        except Exception as e:
+            return internal_server_error(errormsg=str(e))
+
+    def getSQL(self, gid, sid, data, scid=None):
+        """
+        This function will generate sql from model data received from client
+        """
+        if scid is not None:
+            SQL = render_template("/".join([self.template_path,
+                                            'properties.sql']), scid=scid)
+            status, res = self.conn.execute_dict(SQL)
+            if not status:
+                return internal_server_error(errormsg=res)
+            old_data = res['rows'][0]
+            # old_data contains all the existing data for requested schema
+            old_data = self._formatter(old_data, scid)
+
+            # if name is not present in request data then use old name
+            if 'name' not in data:
+                data['name'] = old_data['name']
+
+            # Privileges
+            for key in ['nspacl']:
+                if key in data and data[key] is not None:
+                    if 'added' in data[key]:
+                      data[key]['added'] = parse_priv_to_db(
+                          data[key]['added'], self.acl
+                      )
+                    if 'changed' in data[key]:
+                      data[key]['changed'] = parse_priv_to_db(
+                          data[key]['changed'], self.acl
+                      )
+                    if 'deleted' in data[key]:
+                      data[key]['deleted'] = parse_priv_to_db(
+                          data[key]['deleted'], self.acl
+                      )
+
+            # Default privileges
+            for key in ['deftblacl', 'defseqacl', 'deffuncacl', 'deftypeacl']:
+                if key in data and data[key] is not None:
+                    if 'added' in data[key]:
+                      data[key]['added'] = parse_priv_to_db(
+                          data[key]['added']
+                      )
+                    if 'changed' in data[key]:
+                      data[key]['changed'] = parse_priv_to_db(
+                          data[key]['changed']
+                      )
+                    if 'deleted' in data[key]:
+                      data[key]['deleted'] = parse_priv_to_db(
+                          data[key]['deleted']
+                      )
+
+            SQL = render_template(
+                "/".join([self.template_path, 'update.sql']),
+                data=data, o_data=old_data, conn=self.conn
+                )
+        else:
+            required_args = [
+                'name'
+            ]
+
+            for arg in required_args:
+                if arg not in data:
+                    return " -- definition incomplete",
+
+            # Privileges
+            if 'nspacl' in data and data['nspacl'] is not None:
+                data['nspacl'] = parse_priv_to_db(data['nspacl'], self.acl)
+
+            SQL = render_template("/".join([self.template_path, 'create.sql'])
+                                  , data=data, conn=self.conn)
+            SQL += "\n"
+            SQL += render_template("/".join([self.template_path, 'alter.sql'])
+                                   , data=data, conn=self.conn)
+
+        return SQL
+
+    @check_precondition
+    def sql(self, gid, sid, did, scid):
+        """
+        This function will generates reverse engineered sql for schema object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: Schema ID
+        """
+        SQL = render_template("/".join([self.template_path,
+                                        'properties.sql']), scid=scid)
+        status, res = self.conn.execute_dict(SQL)
+        if not status:
+            return internal_server_error(errormsg=res)
+
+        old_data = res['rows'][0]
+        old_data = self._formatter(old_data, scid)
+
+        # Privileges
+        if 'nspacl' in old_data and old_data['nspacl'] is not None:
+            old_data['nspacl'] = parse_priv_to_db(old_data['nspacl'], self.acl)
+
+        # Default privileges
+        for key in ['deftblacl', 'defseqacl', 'deffuncacl', 'deftypeacl']:
+            if key in old_data and old_data[key] is not None:
+                old_data[key] = parse_priv_to_db(old_data[key])
+
+        # Render sql from create & alter sql using properties & acl data
+        SQL = ''
+        SQL = render_template("/".join([self.template_path, 'create.sql']),
+                              data=old_data, conn=self.conn)
+        SQL += "\n"
+        SQL += render_template("/".join([self.template_path, 'alter.sql']),
+                               data=old_data, conn=self.conn)
+
+        sql_header = """
+-- SCHEMA: {0};
+
+-- DROP SCHEMA {0};
+
+""".format(old_data['name'])
+
+        SQL = sql_header + SQL
+
+        return ajax_response(response=SQL)
+
+    @check_precondition
+    def dependents(self, gid, sid, did, scid):
+        """
+        This function get the dependents and return ajax response
+        for the schema node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did: Database ID
+            scid: Schema ID
+        """
+        dependents_result = self.get_dependents(self.conn, scid)
+        return ajax_response(
+                response=dependents_result,
+                status=200
+                )
+
+    @check_precondition
+    def dependencies(self, gid, sid, did, scid):
+        """
+        This function get the dependencies and return ajax response
+        for the schema node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did: Database ID
+            scid: Schema ID
+        """
+        dependencies_result = self.get_dependencies(self.conn, scid)
+        return ajax_response(
+                response=dependencies_result,
+                status=200
+                )
+
+SchemaView.register_node_view(blueprint)
+
+
+class CatalogModule(CollectionNodeModule):
+    """
+     class CatalogModule(CollectionNodeModule)
+
+        A module class for Catalog node derived from CollectionNodeModule.
+
+    Methods:
+    -------
+    * __init__(*args, **kwargs)
+      - Method is used to initialize the Catalog and it's base module.
+
+    * get_nodes(gid, sid, did)
+      - Method is used to generate the browser collection node.
+
+    * node_inode()
+      - Method is overridden from its base class to make the node as leaf node.
+
+    * script_load()
+      - Load the module script for schema, when any of the server node is
+        initialized.
+    """
+
+    NODE_TYPE = 'catalog'
+    COLLECTION_LABEL = gettext("Catalogs")
+
+    def __init__(self, *args, **kwargs):
+        """
+        Method is used to initialize the CatalogModule and it's base module.
+
+        Args:
+            *args:
+            **kwargs:
+        """
+        self.min_ver = None
+        self.max_ver = None
+
+        super(CatalogModule, self).__init__(*args, **kwargs)
+
+    def get_nodes(self, gid, sid, did):
+        """
+        Generate the collection node
+        """
+        yield self.generate_browser_collection_node(did)
+
+    @property
+    def script_load(self):
+        """
+        Load the module script for server, when any of the server-group node is
+        initialized.
+        """
+        return servers.ServerModule.NODE_TYPE
+
+    @property
+    def show_system_objects(self):
+        return True
+
+catalog_blueprint = CatalogModule(__name__)
+
+
+class CatalogView(PGChildNodeView):
+    """
+    This class is responsible for generating routes for schema node
+
+    Methods:
+    -------
+    * __init__(**kwargs)
+      - Method is used to initialize the ResourceGroupView and it's base view.
+
+    * module_js()
+      - This property defines (if javascript) exists for this node.
+        Override this property for your own logic
+
+    * check_precondition()
+      - This function will behave as a decorator which will checks
+        database connection before running view, it will also attaches
+        manager,conn & template_path properties to self
+
+    * list()
+      - This function is used to list all the catalog nodes within that collection.
+
+    * nodes()
+      - This function will used to create all the child node within that collection.
+        Here it will create all the catalog node.
+
+    * properties(gid, sid, did, scid)
+      - This function will show the properties of the selected catalog node
+
+    * update(gid, sid, did, scid)
+      - This function will update the data for the selected catalog node
+
+    * msql(gid, sid, did, scid)
+      - This function is used to return modified SQL for the selected catalog node
+
+    * get_sql(data, scid)
+      - This function will generate sql from model data
+
+    * sql(gid, sid, did, scid):
+      - This function will generate sql to show it in sql pane for the selected catalog node.
+
+    * dependency(gid, sid, did, scid):
+      - This function will generate dependency list show it in dependency
+        pane for the selected catalog node.
+
+    * dependent(gid, sid, did, scid):
+      - This function will generate dependent list to show it in dependent
+        pane for the selected catalog node.
+
+    """
+
+    node_type = catalog_blueprint.node_type
+
+    parent_ids = [
+        {'type': 'int', 'id': 'gid'},
+        {'type': 'int', 'id': 'sid'},
+        {'type': 'int', 'id': 'did'}
+        ]
+    ids = [
+                    {'type': 'int', 'id': 'scid'}
+            ]
+
+    operations = dict({
+        'obj': [
+            {'get': 'properties', 'delete': 'delete', 'put': 'update'},
+            {'get': 'list', 'post': 'create'}
+        ],
+        'children': [{'get': 'children'}],
+        'nodes': [{'get': 'node'}, {'get': 'nodes'}],
+        'sql': [{'get': 'sql'}],
+        'msql': [{'get': 'msql'}, {'get': 'msql'}],
+        'stats': [{'get': 'statistics'}],
+        'dependency': [{'get': 'dependencies'}],
+        'dependent': [{'get': 'dependents'}],
+        'module.js': [{}, {}, {'get': 'module_js'}],
+        'configs': [{'get': 'configs'}]
+    })
+
+    @staticmethod
+    def ppas_template_path(ver):
+        """
+        Returns the template path for the PPAS servers.
+        """
+        if ver >= 90200:
+            return 'edb_9.2_plus'
+        elif ver >= 90100:
+            return 'edb_9.1_plus'
+
+        return 'edb_pre_9.1'
+
+    @staticmethod
+    def pg_template_path(ver):
+        """
+        Returns the template path for the PostgreSQL servers.
+        """
+        if ver >= 90200:
+            return '9.2_plus'
+        elif ver >= 90100:
+            return '9.1_plus'
+
+        return 'pre_9.1'
+
+    def check_precondition(f):
+        """
+        This function will behave as a decorator which will checks
+        database connection before running view, it will also attaches
+        manager,conn & template_path properties to self
+        """
+        @wraps(f)
+        def wrap(*args, **kwargs):
+            # Here args[0] will hold self & kwargs will hold gid,sid,did
+            self = args[0]
+            self.manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(
+                kwargs['sid']
+            )
+            self.conn = self.manager.connection()
+
+            # If DB not connected then return error to browser
+            if not self.conn.connected():
+                return precondition_required(
+                    gettext(
+                            "Connection to the server has been lost!"
+                    )
+                )
+
+            # Set template path for sql scripts
+            self.template_path = 'catalog/sql/' + (
+                self.ppas_template_path(self.manager.version)
+                if self.manager.server_type == 'ppas' else
+                self.pg_template_path(self.manager.version)
+            )
+
+            # ACL for catalog
+            self.acl = ['C', 'U']
+
+            return f(*args, **kwargs)
+
+        return wrap
+
+
+    @check_precondition
+    def list(self, gid, sid, did):
+        """
+        This function is used to list all the catalog nodes within that collection.
+
+        Args:
+            gid: Server group ID
+            sid: Server ID
+            did: Database ID
+
+        Returns:
+            JSON of available schema nodes
+        """
+
+        SQL = render_template("/".join([self.template_path, 'properties.sql']),
+                              show_sysobj=self.blueprint.show_system_objects)
+        status, res = self.conn.execute_dict(SQL)
+
+        if not status:
+            return internal_server_error(errormsg=res)
+        return ajax_response(
+                response=res['rows'],
+                status=200
+                )
+
+    @check_precondition
+    def nodes(self, gid, sid, did):
+        """
+        This function will used to create all the child node within that collection.
+        Here it will create all the catalog node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did: Database ID
+
+        Returns:
+            JSON of available catalog child nodes
+        """
+
+        res = []
+        SQL = render_template("/".join([self.template_path, 'properties.sql']),
+                              show_sysobj=self.blueprint.show_system_objects)
+        status, rset = self.conn.execute_2darray(SQL)
+        if not status:
+            return internal_server_error(errormsg=rset)
+
+        for row in rset['rows']:
+            res.append(
+                    self.blueprint.generate_browser_node(
+                        row['oid'],
+                        did,
+                        row['name'],
+                        icon="icon-catalog"
+                    ))
+
+        return make_json_response(
+                data=res,
+                status=200
+                )
+
+    @check_precondition
+    def properties(self, gid, sid, did, scid):
+        """
+        This function will show the properties of the selected catalog node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did:  Database ID
+            scid: catalog ID
+
+        Returns:
+            JSON of selected catalog node
+        """
+
+        SQL = render_template("/".join([self.template_path, 'properties.sql']),
+                              show_sysobj=self.blueprint.show_system_objects,
+                              cid=scid)
+        status, res = self.conn.execute_dict(SQL)
+
+        if not status:
+            return internal_server_error(errormsg=res)
+        data = dict(res['rows'][0])
+
+        seclabels = []
+        if 'seclabels' in data and data['seclabels'] is not None:
+            for sec in data['seclabels']:
+                sec = re.search(r'([^=]+)=(.*$)', sec)
+                seclabels.append({
+                    'provider': sec.group(1),
+                    'security_label': sec.group(2)
+                    })
+
+        data['seclabels'] = seclabels
+
+
+        return ajax_response(
+                response=data,
+                status=200
+                )
+
+    @check_precondition
+    def update(self, gid, sid, did, scid):
+        """
+        This function will updates existing the catalog object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: catalog ID
+        """
+        data = request.form if request.form else json.loads(request.data.decode())
+
+        try:
+            SQL = self.getSQL(gid, sid, data, scid)
+            if SQL and SQL.strip('\n') and SQL.strip(' '):
+                status, res = self.conn.execute_scalar(SQL)
+                if not status:
+                    return internal_server_error(errormsg=res)
+
+                return make_json_response(
+                    success=1,
+                    info="Catalog updated",
+                    data={
+                        'id': scid,
+                        'sid': sid,
+                        'gid': gid,
+                        'did': did
+                    }
+                )
+            else:
+                return make_json_response(
+                    success=1,
+                    info="Nothing to update",
+                    data={
+                        'id': scid,
+                        'sid': sid,
+                        'gid': gid,
+                        'did': did
+                    }
+                )
+
+        except Exception as e:
+            return internal_server_error(errormsg=str(e))
+
+    @check_precondition
+    def msql(self, gid, sid, did, scid):
+        """
+        This function will generates modified sql for Catalog object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: Catalog ID (When working with existing catalog node)
+        """
+        data = dict()
+        # Converting it into json format
+        for k, v in request.args.items():
+            try:
+                data[k] = json.loads(v)
+            except ValueError:
+                data[k] = v
+
+        try:
+            SQL = self.getSQL(gid, sid, data, scid)
+            if SQL and SQL.strip('\n') and SQL.strip(' '):
+                return make_json_response(
+                        data=SQL,
+                        status=200
+                )
+        except Exception as e:
+            return internal_server_error(errormsg=str(e))
+
+    def getSQL(self, gid, sid, data, scid=None):
+        """
+        This function will genrate sql from model data
+        """
+        if scid is not None:
+            SQL = render_template("/".join([self.template_path,
+                                            'properties.sql']), cid=scid)
+            status, res = self.conn.execute_dict(SQL)
+            if not status:
+                return internal_server_error(errormsg=res)
+            old_data = res['rows'][0]
+            SQL = render_template("/".join([self.template_path, 'update.sql']),
+                                  data=data, o_data=old_data, conn=self.conn)
+        else:
+            SQL = '-- No change!'
+        return SQL
+
+    @check_precondition
+    def sql(self, gid, sid, did, scid):
+        """
+        This function will generates reverse engineered sql for schema object
+
+         Args:
+           gid: Server Group ID
+           sid: Server ID
+           did: Database ID
+           scid: Schema ID
+        """
+        SQL = render_template("/".join([self.template_path,
+                                        'properties.sql']), cid=scid)
+        status, res = self.conn.execute_dict(SQL)
+        if not status:
+            return internal_server_error(errormsg=res)
+        old_data = res['rows'][0]
+
+        # We need to parse & convert ACL coming from database to json format
+        SQL = render_template("/".join([self.template_path, 'acl.sql']),
+                              cid=scid)
+        status, acl = self.conn.execute_dict(SQL)
+        if not status:
+            return internal_server_error(errormsg=acl)
+
+        # We will set get privileges from acl sql so we don't need
+        # it from properties sql
+        old_data['nspacl'] = []
+
+        for row in acl['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]
+
+        old_data['nspacl'] = parse_priv_to_db(old_data['nspacl'], self.acl)
+
+        SQL = render_template("/".join([self.template_path, 'create.sql']),
+                              data=old_data, conn=self.conn)
+
+        sql_header = """
+-- SCHEMA: {0};
+
+-- DROP SCHEMA {0};
+
+""".format(old_data['name'])
+
+        SQL = sql_header + SQL
+
+        return ajax_response(response=SQL)
+
+    @check_precondition
+    def dependents(self, gid, sid, did, scid):
+        """
+        This function get the dependents and return ajax response
+        for the catalog node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did: Database ID
+            scid: Schema ID
+        """
+        dependents_result = self.get_dependents(self.conn, scid)
+        return ajax_response(
+                response=dependents_result,
+                status=200
+                )
+
+    @check_precondition
+    def dependencies(self, gid, sid, did, scid):
+        """
+        This function get the dependencies and return ajax response
+        for the catalog node.
+
+        Args:
+            gid: Server Group ID
+            sid: Server ID
+            did: Database ID
+            scid: Schema ID
+        """
+        dependencies_result = self.get_dependencies(self.conn, scid)
+        return ajax_response(
+                response=dependencies_result,
+                status=200
+                )
+
+
+CatalogView.register_node_view(catalog_blueprint)
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/catalog.png b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/catalog.png
new file mode 100644
index 0000000000000000000000000000000000000000..7c0ef24ff5843867fb64d97cc419a7150da5f441
GIT binary patch
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/coll-catalog.png b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/coll-catalog.png
new file mode 100644
index 0000000000000000000000000000000000000000..caa6d3d40d55d990351465cebacbffde95eeb63d
GIT binary patch
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/coll-schema.png b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/coll-schema.png
new file mode 100644
index 0000000000000000000000000000000000000000..9733882b720b39bfed266843f84e1278c9bc588f
GIT binary patch
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/schema.png b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/img/schema.png
new file mode 100644
index 0000000000000000000000000000000000000000..4dacf1856fe53575aa1ee93bc146fd2a37b32650
GIT binary patch
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/js/catalog.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/js/catalog.js
new file mode 100644
index 0000000..0d40ba6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/js/catalog.js
@@ -0,0 +1,118 @@
+ define(
+        ['jquery', 'underscore', 'underscore.string', 'pgadmin',
+        'pgadmin.browser', 'backform', 'alertify', 'pgadmin.browser.collection'],
+function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+   // Extend the browser's collection class for SecurityLabel control
+    var SecurityModel = Backform.SecurityModel = pgAdmin.Browser.Node.Model.extend({
+    defaults: {
+      provider: null,
+      security_label: null
+    },
+    schema: [{
+      id: 'provider', label: '{{ _('Provider') }}',
+      type: 'text', disabled: false
+    },{
+      id: 'security_label', label: '{{ _('Security Label') }}',
+      type: 'text', disabled: false
+    }],
+    validate: function() {
+      var err = {},
+          errmsg = null;
+
+      if (_.isUndefined(this.get('security_label')) ||
+        _.isNull(this.get('security_label')) ||
+        String(this.get('security_label')).replace(/^\s+|\s+$/g, '') == '') {
+            errmsg =  '{{ _('Please specify the value for all the security providers.')}}';
+            this.errorModel.set('security_label', errmsg);
+            return errmsg;
+          } else {
+            this.errorModel.unset('security_label');
+          }
+      return null;
+    }
+  });
+
+  // Extend the browser's collection class for catalog collection
+  if (!pgBrowser.Nodes['coll-catalog']) {
+    var databases = pgAdmin.Browser.Nodes['coll-catalog'] =
+      pgAdmin.Browser.Collection.extend({
+        node: 'catalog',
+        label: '{{ _('Catalogs') }}',
+        type: 'coll-catalog',
+        columns: ['name', 'oid', 'description']
+      });
+  };
+  // Extend the browser's node class for catalog node
+  if (!pgBrowser.Nodes['catalog']) {
+    pgAdmin.Browser.Nodes['catalog'] = pgAdmin.Browser.Node.extend({
+      parent_type: 'database',
+      type: 'catalog',
+      label: '{{ _('Catalog') }}',
+      hasSQL:  true,
+      hasDepends: true,
+      Init: function() {
+        /* Avoid mulitple registration of menus */
+        if (this.initialized)
+            return;
+
+        this.initialized = true;
+
+      },
+      model: pgAdmin.Browser.Node.Model.extend({
+        defaults: {
+          name: undefined,
+          namespaceowner: undefined,
+          nspacl: undefined,
+          description: undefined,
+          acltbl: undefined,
+          aclseq: undefined,
+          aclfunc: undefined,
+          acltype: undefined,
+          slony: undefined,
+          securitylabel: []
+        },
+        schema: [{
+          id: 'name', label: '{{ _('Name') }}', cell: 'string',
+          type: 'text', disabled: true
+        },{
+          id: 'oid', label:'{{ _('Oid') }}', cell: 'string',
+          type: 'text', disabled: true
+        },{
+          id: 'namespaceowner', label:'{{ _('Owner') }}', cell: 'string',
+          type: 'text', disabled: true
+        },{
+          id: 'nspacl', label:'{{ _('ACL') }}', cell: 'string',
+          type: 'text', mode: ['properties']
+        },{
+          id: 'acltbl', label:'{{ _('Default table ACL') }}', cell: 'string',
+          type: 'text', mode: ['properties']
+        },{
+          id: 'aclseq', label:'{{ _('Default sequence ACL') }}', cell: 'string',
+          type: 'text', mode: ['properties']
+        },{
+          id: 'aclfunc', label:'{{ _('Default function ACL') }}', cell: 'string',
+          type: 'text', mode: ['properties']
+        },{
+          id: 'acltype', label:'{{ _('Default type ACL') }}', cell: 'string',
+          type: 'text', mode: ['properties']
+       },{
+          id: 'description', label:'{{ _('Comment') }}', cell: 'string',
+          type: 'multiline'
+       },{
+          id: 'seclabels', label: '{{ _('Security Labels') }}',
+          model: SecurityModel, editable: false, type: 'collection',
+          group: '{{ _('Security') }}', mode: ['edit', 'create'],
+          min_version: 90200, canAdd: true,
+          canEdit: false, canDelete: true, control: 'unique-col-collection'
+         }
+        ],
+        validate: function() {
+          return null;
+        }
+      })
+  });
+
+  }
+
+  return pgBrowser.Nodes['catalog'];
+});
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/acl.sql
new file mode 100644
index 0000000..6bf9c86
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/acl.sql
@@ -0,0 +1,62 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/create.sql
new file mode 100644
index 0000000..92480ea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/create.sql
@@ -0,0 +1,18 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}
+{% if data.namespaceowner %}
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/properties.sql
new file mode 100644
index 0000000..a8a6b2c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/properties.sql
@@ -0,0 +1,30 @@
+SELECT nsp.nspname AS name, nsp.oid AS oid, pg_get_userbyid(nsp.nspowner) AS namespaceowner, nsp.nspacl AS nspacl,
+ des.description,
+ CASE WHEN dacl.defaclobjtype='r' THEN dacl.defaclacl END AS acltbl,
+ CASE WHEN dacl.defaclobjtype='S' THEN dacl.defaclacl END AS aclseq,
+ CASE WHEN dacl.defaclobjtype='f' THEN dacl.defaclacl END AS aclfunc
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+{% if show_sysobj %}
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+{% endif %}
+{% if cid %}
+AND
+ nsp.oid={{cid}}::int
+{% endif %}
+ORDER BY nsp.nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/update.sql
new file mode 100644
index 0000000..7ac1193
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.1_plus/update.sql
@@ -0,0 +1,30 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% if data %}
+{# ==== To update catalog comments ==== #}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(o_data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{# ==== To update catalog securitylabel ==== #}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', o_data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/acl.sql
new file mode 100644
index 0000000..6bf9c86
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/acl.sql
@@ -0,0 +1,62 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/create.sql
new file mode 100644
index 0000000..92480ea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/create.sql
@@ -0,0 +1,18 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}
+{% if data.namespaceowner %}
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/properties.sql
new file mode 100644
index 0000000..d7e613d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/properties.sql
@@ -0,0 +1,32 @@
+SELECT nsp.nspname AS name, nsp.oid AS oid, pg_get_userbyid(nsp.nspowner) AS namespaceowner, nsp.nspacl AS nspacl,
+ des.description,
+ CASE WHEN dacl.defaclobjtype='r' THEN dacl.defaclacl END AS acltbl,
+ CASE WHEN dacl.defaclobjtype='S' THEN dacl.defaclacl END AS aclseq,
+ CASE WHEN dacl.defaclobjtype='f' THEN dacl.defaclacl END AS aclfunc,
+ CASE WHEN dacl.defaclobjtype='T' THEN dacl.defaclacl END AS acltype,
+ (SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+{% if show_sysobj %}
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+{% endif %}
+{% if cid %}
+AND
+ nsp.oid={{cid}}::int
+{% endif %}
+ORDER BY nsp.nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/update.sql
new file mode 100644
index 0000000..7ac1193
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/9.2_plus/update.sql
@@ -0,0 +1,30 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% if data %}
+{# ==== To update catalog comments ==== #}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(o_data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{# ==== To update catalog securitylabel ==== #}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', o_data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/acl.sql
new file mode 100644
index 0000000..2b3618b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/acl.sql
@@ -0,0 +1,66 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+  (nspname = 'dbo' OR nspname = 'sys')
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+  (nspname = 'dbo' OR nspname = 'sys')
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/create.sql
new file mode 100644
index 0000000..92480ea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/create.sql
@@ -0,0 +1,18 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}
+{% if data.namespaceowner %}
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/properties.sql
new file mode 100644
index 0000000..7b2f489
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/properties.sql
@@ -0,0 +1,34 @@
+SELECT nsp.nspname AS name, nsp.oid AS oid, pg_get_userbyid(nsp.nspowner) AS namespaceowner, nsp.nspacl AS nspacl,
+ des.description,
+ CASE WHEN dacl.defaclobjtype='r' THEN dacl.defaclacl END AS acltbl,
+ CASE WHEN dacl.defaclobjtype='S' THEN dacl.defaclacl END AS aclseq,
+ CASE WHEN dacl.defaclobjtype='f' THEN dacl.defaclacl END AS aclfunc
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+	(nspname = 'dbo' OR nspname = 'sys')
+)
+{% if show_sysobj %}
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+{% endif %}
+AND
+ nsp.nspparent = 0
+{% if cid %}
+AND
+ nsp.oid={{cid}}::int
+{% endif %}
+ORDER BY nsp.nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/update.sql
new file mode 100644
index 0000000..7ac1193
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.1_plus/update.sql
@@ -0,0 +1,30 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% if data %}
+{# ==== To update catalog comments ==== #}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(o_data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{# ==== To update catalog securitylabel ==== #}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', o_data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/acl.sql
new file mode 100644
index 0000000..2b3618b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/acl.sql
@@ -0,0 +1,66 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+  (nspname = 'dbo' OR nspname = 'sys')
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+  (nspname = 'dbo' OR nspname = 'sys')
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/create.sql
new file mode 100644
index 0000000..92480ea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/create.sql
@@ -0,0 +1,18 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}
+{% if data.namespaceowner %}
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/properties.sql
new file mode 100644
index 0000000..048c324
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/properties.sql
@@ -0,0 +1,36 @@
+SELECT nsp.nspname AS name, nsp.oid AS oid, pg_get_userbyid(nsp.nspowner) AS namespaceowner, nsp.nspacl AS nspacl,
+ des.description,
+ CASE WHEN dacl.defaclobjtype='r' THEN dacl.defaclacl END AS acltbl,
+ CASE WHEN dacl.defaclobjtype='S' THEN dacl.defaclacl END AS aclseq,
+ CASE WHEN dacl.defaclobjtype='f' THEN dacl.defaclacl END AS aclfunc,
+ CASE WHEN dacl.defaclobjtype='T' THEN dacl.defaclacl END AS acltype,
+ (SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+	(nspname = 'dbo' OR nspname = 'sys')
+)
+{% if show_sysobj %}
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+{% endif %}
+AND
+ nsp.nspparent = 0
+{% if cid %}
+AND
+ nsp.oid={{cid}}::int
+{% endif %}
+ORDER BY nsp.nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/update.sql
new file mode 100644
index 0000000..7ac1193
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_9.2_plus/update.sql
@@ -0,0 +1,30 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% if data %}
+{# ==== To update catalog comments ==== #}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(o_data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{# ==== To update catalog securitylabel ==== #}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', o_data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', o_data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/acl.sql
new file mode 100644
index 0000000..2b3618b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/acl.sql
@@ -0,0 +1,66 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+  (nspname = 'dbo' OR nspname = 'sys')
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+  (nspname = 'dbo' OR nspname = 'sys')
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/create.sql
new file mode 100644
index 0000000..92480ea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/create.sql
@@ -0,0 +1,18 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}
+{% if data.namespaceowner %}
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/properties.sql
new file mode 100644
index 0000000..7b2f489
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/properties.sql
@@ -0,0 +1,34 @@
+SELECT nsp.nspname AS name, nsp.oid AS oid, pg_get_userbyid(nsp.nspowner) AS namespaceowner, nsp.nspacl AS nspacl,
+ des.description,
+ CASE WHEN dacl.defaclobjtype='r' THEN dacl.defaclacl END AS acltbl,
+ CASE WHEN dacl.defaclobjtype='S' THEN dacl.defaclacl END AS aclseq,
+ CASE WHEN dacl.defaclobjtype='f' THEN dacl.defaclacl END AS aclfunc
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+OR
+	(nspname = 'dbo' OR nspname = 'sys')
+)
+{% if show_sysobj %}
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+{% endif %}
+AND
+ nsp.nspparent = 0
+{% if cid %}
+AND
+ nsp.oid={{cid}}::int
+{% endif %}
+ORDER BY nsp.nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/update.sql
new file mode 100644
index 0000000..d7224c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/edb_pre_9.1/update.sql
@@ -0,0 +1,9 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% if data %}
+{# ==== To update catalog comments ==== #}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(o_data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/acl.sql
new file mode 100644
index 0000000..6bf9c86
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/acl.sql
@@ -0,0 +1,62 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+AND
+ nsp.oid={{cid}}::int
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/create.sql
new file mode 100644
index 0000000..92480ea
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/create.sql
@@ -0,0 +1,18 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}
+{% if data.namespaceowner %}
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/properties.sql
new file mode 100644
index 0000000..a8a6b2c
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/properties.sql
@@ -0,0 +1,30 @@
+SELECT nsp.nspname AS name, nsp.oid AS oid, pg_get_userbyid(nsp.nspowner) AS namespaceowner, nsp.nspacl AS nspacl,
+ des.description,
+ CASE WHEN dacl.defaclobjtype='r' THEN dacl.defaclacl END AS acltbl,
+ CASE WHEN dacl.defaclobjtype='S' THEN dacl.defaclacl END AS aclseq,
+ CASE WHEN dacl.defaclobjtype='f' THEN dacl.defaclacl END AS aclfunc
+FROM pg_namespace nsp
+LEFT OUTER JOIN
+ pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE (
+(nspname = 'pg_catalog' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'pgagent' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname = 'information_schema' AND EXISTS
+                               (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1))
+OR (nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)
+{% if show_sysobj %}
+AND
+ nspname NOT LIKE E'pg\\temp\\%'
+AND
+ nspname NOT LIKE E'pg\\toast_temp\\%'
+{% endif %}
+{% if cid %}
+AND
+ nsp.oid={{cid}}::int
+{% endif %}
+ORDER BY nsp.nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/update.sql
new file mode 100644
index 0000000..d7224c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/catalog/sql/pre_9.1/update.sql
@@ -0,0 +1,9 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% if data %}
+{# ==== To update catalog comments ==== #}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(o_data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js
new file mode 100644
index 0000000..25a1017
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js
@@ -0,0 +1,205 @@
+define(
+        ['jquery', 'underscore', 'underscore.string', 'pgadmin',
+        'pgadmin.browser', 'backform', 'alertify',
+        'pgadmin.browser.collection',
+        'pgadmin.browser.server.privilege'],
+function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
+   // Extend the browser's collection class for SecurityLabel control
+    var SecurityModel = Backform.SecurityModel = pgAdmin.Browser.Node.Model.extend({
+    defaults: {
+      provider: null,
+      security_label: null
+    },
+    schema: [{
+      id: 'provider', label: '{{ _('Provider') }}',
+      type: 'text', disabled: false
+    },{
+      id: 'security_label', label: '{{ _('Security Label') }}',
+      type: 'text', disabled: false
+    }],
+    validate: function() {
+      var err = {},
+          errmsg = null;
+
+      if (_.isUndefined(this.get('security_label')) ||
+        _.isNull(this.get('security_label')) ||
+        String(this.get('security_label')).replace(/^\s+|\s+$/g, '') == '') {
+            errmsg =  '{{ _('Please specify the value for all the security providers.')}}';
+            this.errorModel.set('security_label', errmsg);
+            return errmsg;
+          } else {
+            this.errorModel.unset('security_label');
+          }
+      return null;
+    }
+  });
+
+  // Extend the browser's collection class for schema collection
+  if (!pgBrowser.Nodes['coll-schema']) {
+    var databases = pgAdmin.Browser.Nodes['coll-schema'] =
+      pgAdmin.Browser.Collection.extend({
+        node: 'schema',
+        label: '{{ _('Schemas') }}',
+        type: 'coll-schema',
+        columns: ['name', 'oid', 'description']
+      });
+  };
+  // Extend the browser's node class for schema node
+  if (!pgBrowser.Nodes['schema']) {
+    pgAdmin.Browser.Nodes['schema'] = pgAdmin.Browser.Node.extend({
+      parent_type: 'database',
+      type: 'schema',
+      label: '{{ _('Schema') }}',
+      hasSQL:  true,
+      canDrop: true,
+      canDropCascade: true,
+      hasDepends: true,
+      Init: function() {
+        /* Avoid mulitple registration of menus */
+        if (this.initialized)
+            return;
+
+        this.initialized = true;
+
+        pgBrowser.add_menus([{
+          name: 'create_schema_on_coll', node: 'coll-schema', module: this,
+          applies: ['object', 'context'], callback: 'show_obj_properties',
+          category: 'create', priority: 4, label: '{{ _('Schema...') }}',
+          icon: 'wcTabIcon icon-schema', data: {action: 'create'}
+        },{
+          name: 'create_schema', node: 'schema', module: this,
+          applies: ['object', 'context'], callback: 'show_obj_properties',
+          category: 'create', priority: 4, label: '{{ _('Schema...') }}',
+          icon: 'wcTabIcon icon-schema', data: {action: 'create'}
+        },{
+          name: 'create_schema', node: 'database', module: this,
+          applies: ['object', 'context'], callback: 'show_obj_properties',
+          category: 'create', priority: 4, label: '{{ _('Schema...') }}',
+          icon: 'wcTabIcon icon-schema', data: {action: 'create'}
+        }
+        ]);
+      },
+      model: pgAdmin.Browser.Node.Model.extend({
+        defaults: {
+          name: undefined,
+          namespaceowner: undefined,
+          description: undefined,
+          is_system_obj: undefined,
+        },
+        schema: [{
+          id: 'name', label: '{{ _('Name') }}', cell: 'string',
+          type: 'text'
+        },{
+          id: 'oid', label:'{{ _('Oid') }}', cell: 'string',
+          type: 'text', disabled: true, mode: ['edit', 'properties']
+        },{
+          id: 'namespaceowner', label:'{{ _('Owner') }}', cell: 'string',
+          type: 'text', control: 'node-list-by-name', node: 'role',
+          select2: { allowClear: false }
+        },{
+          id: 'description', label:'{{ _('Comment') }}', cell: 'string',
+          type: 'multiline'
+        },{
+          id: 'is_sys_object', label:'{{ _('System schema?') }}', cell: 'switch',
+          type: 'switch', mode: ['properties'], disabled: true, options: {
+            'onText': 'Yes', 'offText': 'No',
+            'onColor': 'success', 'offColor': 'primary',
+            'size': 'small'
+          }
+        },{
+          id: 'nspacl', label: '{{ _('Privileges') }}',
+          model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend(
+          {privileges: ['C', 'U']}), uniqueCol : ['grantee', 'grantor'],
+          editable: false, type: 'collection', group: '{{ _('Security') }}',
+          mode: ['properties', 'edit', 'create'],
+          canAdd: true, canDelete: true, control: 'unique-col-collection',
+        },{
+          id: 'seclabels', label: '{{ _('Security Labels') }}',
+          model: SecurityModel, editable: false, type: 'collection',
+          group: '{{ _('Security') }}', mode: ['edit', 'create'],
+          min_version: 90200, canAdd: true,
+          canEdit: false, canDelete: true, control: 'unique-col-collection'
+        },{
+          type: 'nested', control: 'tab', group: '{{ _('Default Privileges') }}',
+          mode: ['edit'],
+          schema:[{
+              id: 'deftblacl', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend(
+              {privileges: ['a', 'r', 'w', 'd', 'D', 'x', 't']}),
+              label: '{{ _('Default Privileges: Tables') }}',
+              editable: false, type: 'collection', group: '{{ _('Tables') }}',
+              mode: ['edit', 'create'], control: 'unique-col-collection',
+              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
+            },{
+              id: 'defseqacl', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend(
+              {privileges: ['r', 'w', 'U']}),
+              label: '{{ _('Default Privileges: Sequences') }}',
+              editable: false, type: 'collection', group: '{{ _('Sequences') }}',
+              mode: ['edit', 'create'], control: 'unique-col-collection',
+              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
+            },{
+              id: 'deffuncacl', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend(
+              {privileges: ['X']}),
+              label: '{{ _('Default Privileges: Functions') }}',
+              editable: false, type: 'collection', group: '{{ _('Functions') }}',
+              mode: ['edit', 'create'], control: 'unique-col-collection',
+              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor']
+            },{
+              id: 'deftypeacl', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend(
+              {privileges: ['U']}),
+              label: '{{ _('Default Privileges: Types') }}',
+              editable: false, type: 'collection', group: '{{ _('Types') }}',
+              mode: ['edit', 'create'], control: 'unique-col-collection',
+              canAdd: true, canDelete: true, uniqueCol : ['grantee', 'grantor'],
+              min_version: 90200
+            }]
+         }
+        ],
+        validate: function() {
+          var err = {},
+              errmsg = null;
+          // Validation of mandatory fields
+          this.errorModel.clear();
+          if (_.isUndefined(this.get('name')) ||
+            _.isNull(this.get('name')) ||
+            String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
+                errmsg = '{{ _('Name can not be empty.')}}';
+                this.errorModel.set('name', errmsg);
+                return errmsg;
+          } else if (_.isUndefined(this.get('namespaceowner')) ||
+            _.isNull(this.get('namespaceowner')) ||
+            String(this.get('namespaceowner')).replace(/^\s+|\s+$/g, '') == '') {
+                errmsg = '{{ _('Owner can not be empty.')}}';
+                this.errorModel.set('namespaceowner', errmsg);
+                return errmsg;
+          }
+          return null;
+        }
+      }),
+      // This function will checks whether we can allow user to
+      // drop object or not based on location within schema & catalog
+      canChildDrop: function(itemData, item) {
+        var t = pgBrowser.tree, i = item, d = itemData;
+        // To iterate over tree to check parent node
+        while (i) {
+          // If it is schema then allow user to create collation
+          if (_.indexOf(['schema'], d._type) > -1)
+            return true;
+
+            //Check if we are not child of catalog
+            prev_i = t.hasParent(i) ? t.parent(i) : null;
+            prev_d = prev_i ? t.itemData(prev_i) : null;
+            if( prev_d._type == 'catalog') {
+              return false;
+            }
+          i = t.hasParent(i) ? t.parent(i) : null;
+          d = i ? t.itemData(i) : null;
+        }
+        // by default we do not want to allow create menu
+        return true;
+      }
+  });
+
+  }
+
+  return pgBrowser.Nodes['schema'];
+});
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/acl.sql
new file mode 100644
index 0000000..5121270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/acl.sql
@@ -0,0 +1,54 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/alter.sql
new file mode 100644
index 0000000..e5e8060
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/alter.sql
@@ -0,0 +1,58 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{###  To alter description ###}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Security Labels on schema ###}
+{% if data.seclabels and data.seclabels|length > 0 %}
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+
+{% endif %}
+{###  ACL on schema ###}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% for priv in data.deftblacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% for priv in data.defseqacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% for priv in data.deffuncacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for types ###}
+{% if data.deftypeacl %}
+{% for priv in data.deftypeacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### End of main if ###}
+{% endif %}
+{# ======== Below SQL will fetch id for given dataspace ======== #}
+{% if schema %}
+SELECT nsp.oid FROM pg_namespace nsp WHERE nsp.nspname = {{schema|qtLiteral}};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/create.sql
new file mode 100644
index 0000000..45ab7c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/create.sql
@@ -0,0 +1,5 @@
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}{% if data.namespaceowner %}
+
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }}{% endif %};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/defacl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/defacl.sql
new file mode 100644
index 0000000..4167168
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/defacl.sql
@@ -0,0 +1,39 @@
+SELECT
+	CASE (a.deftype)
+	WHEN 'r' THEN 'deftblacl'
+	WHEN 'S' THEN 'defseqacl'
+	WHEN 'f' THEN 'deffuncacl'
+	WHEN 'T' THEN 'deftypeacl'
+	END AS deftype,
+	COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
+FROM
+	(SELECT
+		(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,
+		CASE (acl).privilege_type
+		WHEN 'CONNECT' THEN 'c'
+		WHEN 'CREATE' THEN 'C'
+		WHEN 'DELETE' THEN 'd'
+		WHEN 'EXECUTE' THEN 'X'
+		WHEN 'INSERT' THEN 'a'
+		WHEN 'REFERENCES' THEN 'x'
+		WHEN 'SELECT' THEN 'r'
+		WHEN 'TEMPORARY' THEN 'T'
+		WHEN 'TRIGGER' THEN 't'
+		WHEN 'TRUNCATE' THEN 'D'
+		WHEN 'UPDATE' THEN 'w'
+		WHEN 'USAGE' THEN 'U'
+		ELSE 'UNKNOWN'
+		END AS privilege_type,
+		defaclobjtype as deftype
+	FROM
+		(SELECT defaclobjtype, aclexplode(defaclacl) as acl
+			FROM
+				pg_namespace nsp
+				LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+			WHERE
+				nsp.oid={{scid}}::int
+        ) d) a
+	LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
+	LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname, a.deftype
+ORDER BY a.deftype
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/delete.sql
new file mode 100644
index 0000000..7686040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/delete.sql
@@ -0,0 +1,8 @@
+{% if scid %}
+SELECT nsp.nspname as name, nsp.oid
+FROM pg_namespace nsp
+WHERE nsp.oid = {{scid}};
+{% endif %}
+{% if name %}
+DROP SCHEMA {{ conn|qtIdent(name) }} {% if cascade %}CASCADE{%endif%};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/properties.sql
new file mode 100644
index 0000000..83d26a5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/properties.sql
@@ -0,0 +1,30 @@
+SELECT
+	CASE
+	WHEN (nspname LIKE E'pg\\\\_temp\\\\_%') THEN 1
+	WHEN (nspname LIKE E'pg\\\\_%') THEN 0
+	ELSE 3 END
+	AS nsptyp,
+	nsp.nspname as name, nsp.oid,
+	pg_get_userbyid(nspowner) AS namespaceowner, description,
+	has_schema_privilege(nsp.oid, 'CREATE') as cancreate,
+	CASE WHEN nspname LIKE E'pg\\_%' THEN true ELSE false END as is_sys_object
+FROM
+	pg_namespace nsp
+	LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+WHERE
+	NOT ((nspname = 'pg_catalog' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'pgagent' AND EXISTS
+	(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'information_schema' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+	){% if scid %}
+	AND nsp.oid={{scid}}::int
+	{% endif %}
+	{% if show_sysobj %}
+	AND nspname NOT LIKE E'pg\\temp\\%'
+	AND nspname NOT LIKE E'pg\\toast_temp\\%'
+	{% endif %}
+ORDER BY 1, nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/update.sql
new file mode 100644
index 0000000..fe3fcad
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.1_plus/update.sql
@@ -0,0 +1,125 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{### To update SCHEMA name ###}
+{% if data.name and data.name != o_data.name %}
+ALTER SCHEMA {{ conn|qtIdent(o_data.name) }}
+  RENAME TO {{ conn|qtIdent(data.name) }};
+
+{% endif %}
+{### To update SCHEMA owner ###}
+{% if data.namespaceowner and data.namespaceowner != o_data.namespaceowner %}
+ALTER SCHEMA {{ conn|qtIdent(data.name) }}
+  OWNER TO {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{### To update SCHEMA comments ###}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Change the security labels ###}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### Change the privileges ###}
+{% if data.nspacl %}
+{% if 'deleted' in data.nspacl %}
+{% for priv in data.nspacl.deleted %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.nspacl %}
+{% for priv in data.nspacl.changed %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.nspacl %}
+{% for priv in data.nspacl.added %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% if 'deleted' in data.deftblacl %}
+{% for priv in data.deftblacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deftblacl %}
+{% for priv in data.deftblacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deftblacl %}
+{% for priv in data.deftblacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% if 'deleted' in data.defseqacl %}
+{% for priv in data.defseqacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.defseqacl %}
+{% for priv in data.defseqacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.defseqacl %}
+{% for priv in data.defseqacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% if 'deleted' in data.deffuncacl %}
+{% for priv in data.deffuncacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deffuncacl %}
+{% for priv in data.deffuncacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deffuncacl %}
+{% for priv in data.deffuncacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{###  End main if data ###}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/acl.sql
new file mode 100644
index 0000000..5121270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/acl.sql
@@ -0,0 +1,54 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/alter.sql
new file mode 100644
index 0000000..e5e8060
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/alter.sql
@@ -0,0 +1,58 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{###  To alter description ###}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Security Labels on schema ###}
+{% if data.seclabels and data.seclabels|length > 0 %}
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+
+{% endif %}
+{###  ACL on schema ###}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% for priv in data.deftblacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% for priv in data.defseqacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% for priv in data.deffuncacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for types ###}
+{% if data.deftypeacl %}
+{% for priv in data.deftypeacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### End of main if ###}
+{% endif %}
+{# ======== Below SQL will fetch id for given dataspace ======== #}
+{% if schema %}
+SELECT nsp.oid FROM pg_namespace nsp WHERE nsp.nspname = {{schema|qtLiteral}};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/create.sql
new file mode 100644
index 0000000..45ab7c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/create.sql
@@ -0,0 +1,5 @@
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}{% if data.namespaceowner %}
+
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }}{% endif %};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/defacl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/defacl.sql
new file mode 100644
index 0000000..4167168
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/defacl.sql
@@ -0,0 +1,39 @@
+SELECT
+	CASE (a.deftype)
+	WHEN 'r' THEN 'deftblacl'
+	WHEN 'S' THEN 'defseqacl'
+	WHEN 'f' THEN 'deffuncacl'
+	WHEN 'T' THEN 'deftypeacl'
+	END AS deftype,
+	COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
+FROM
+	(SELECT
+		(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,
+		CASE (acl).privilege_type
+		WHEN 'CONNECT' THEN 'c'
+		WHEN 'CREATE' THEN 'C'
+		WHEN 'DELETE' THEN 'd'
+		WHEN 'EXECUTE' THEN 'X'
+		WHEN 'INSERT' THEN 'a'
+		WHEN 'REFERENCES' THEN 'x'
+		WHEN 'SELECT' THEN 'r'
+		WHEN 'TEMPORARY' THEN 'T'
+		WHEN 'TRIGGER' THEN 't'
+		WHEN 'TRUNCATE' THEN 'D'
+		WHEN 'UPDATE' THEN 'w'
+		WHEN 'USAGE' THEN 'U'
+		ELSE 'UNKNOWN'
+		END AS privilege_type,
+		defaclobjtype as deftype
+	FROM
+		(SELECT defaclobjtype, aclexplode(defaclacl) as acl
+			FROM
+				pg_namespace nsp
+				LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+			WHERE
+				nsp.oid={{scid}}::int
+        ) d) a
+	LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
+	LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname, a.deftype
+ORDER BY a.deftype
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/delete.sql
new file mode 100644
index 0000000..7686040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/delete.sql
@@ -0,0 +1,8 @@
+{% if scid %}
+SELECT nsp.nspname as name, nsp.oid
+FROM pg_namespace nsp
+WHERE nsp.oid = {{scid}};
+{% endif %}
+{% if name %}
+DROP SCHEMA {{ conn|qtIdent(name) }} {% if cascade %}CASCADE{%endif%};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/properties.sql
new file mode 100644
index 0000000..eb2b97b
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/properties.sql
@@ -0,0 +1,31 @@
+SELECT
+	CASE
+	WHEN (nspname LIKE E'pg\\\\_temp\\\\_%') THEN 1
+	WHEN (nspname LIKE E'pg\\\\_%') THEN 0
+	ELSE 3 END
+	AS nsptyp,
+	nsp.nspname as name, nsp.oid,
+	pg_get_userbyid(nspowner) AS namespaceowner, description,
+	has_schema_privilege(nsp.oid, 'CREATE') as cancreate,
+	CASE WHEN nspname LIKE E'pg\\_%' THEN true ELSE false END as is_sys_object,
+    (SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
+FROM
+	pg_namespace nsp
+	LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+WHERE
+	NOT ((nspname = 'pg_catalog' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'pgagent' AND EXISTS
+	(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'information_schema' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+	){% if scid %}
+	AND nsp.oid={{scid}}::int
+	{% endif %}
+	{% if show_sysobj %}
+	AND nspname NOT LIKE E'pg\\temp\\%'
+	AND nspname NOT LIKE E'pg\\toast_temp\\%'
+	{% endif %}
+ORDER BY 1, nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/update.sql
new file mode 100644
index 0000000..d8bc687
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/9.2_plus/update.sql
@@ -0,0 +1,145 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{### To update SCHEMA name ###}
+{% if data.name and data.name != o_data.name %}
+ALTER SCHEMA {{ conn|qtIdent(o_data.name) }}
+  RENAME TO {{ conn|qtIdent(data.name) }};
+
+{% endif %}
+{### To update SCHEMA owner ###}
+{% if data.namespaceowner and data.namespaceowner != o_data.namespaceowner %}
+ALTER SCHEMA {{ conn|qtIdent(data.name) }}
+  OWNER TO {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{### To update SCHEMA comments ###}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Change the security labels ###}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### Change the privileges ###}
+{% if data.nspacl %}
+{% if 'deleted' in data.nspacl %}
+{% for priv in data.nspacl.deleted %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.nspacl %}
+{% for priv in data.nspacl.changed %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.nspacl %}
+{% for priv in data.nspacl.added %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% if 'deleted' in data.deftblacl %}
+{% for priv in data.deftblacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deftblacl %}
+{% for priv in data.deftblacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deftblacl %}
+{% for priv in data.deftblacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% if 'deleted' in data.defseqacl %}
+{% for priv in data.defseqacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.defseqacl %}
+{% for priv in data.defseqacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.defseqacl %}
+{% for priv in data.defseqacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% if 'deleted' in data.deffuncacl %}
+{% for priv in data.deffuncacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deffuncacl %}
+{% for priv in data.deffuncacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deffuncacl %}
+{% for priv in data.deffuncacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for types ###}
+{% if data.deftypeacl %}
+{% if 'deleted' in data.deftypeacl %}
+{% for priv in data.deftypeacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deftypeacl %}
+{% for priv in data.deftypeacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deftypeacl %}
+{% for priv in data.deftypeacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{###  End main if data ###}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/acl.sql
new file mode 100644
index 0000000..5121270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/acl.sql
@@ -0,0 +1,54 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/alter.sql
new file mode 100644
index 0000000..a5c2bd5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/alter.sql
@@ -0,0 +1,30 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{###  To alter description ###}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Security Labels on schema ###}
+{% if data.seclabels and data.seclabels|length > 0 %}
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+
+{% endif %}
+{###  ACL on schema ###}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### End of main if ###}
+{% endif %}
+{# ======== Below SQL will fetch id for given dataspace ======== #}
+{% if schema %}
+SELECT nsp.oid FROM pg_namespace nsp WHERE nsp.nspname = {{schema|qtLiteral}};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/create.sql
new file mode 100644
index 0000000..45ab7c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/create.sql
@@ -0,0 +1,5 @@
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}{% if data.namespaceowner %}
+
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }}{% endif %};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/defacl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/defacl.sql
new file mode 100644
index 0000000..4167168
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/defacl.sql
@@ -0,0 +1,39 @@
+SELECT
+	CASE (a.deftype)
+	WHEN 'r' THEN 'deftblacl'
+	WHEN 'S' THEN 'defseqacl'
+	WHEN 'f' THEN 'deffuncacl'
+	WHEN 'T' THEN 'deftypeacl'
+	END AS deftype,
+	COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
+FROM
+	(SELECT
+		(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,
+		CASE (acl).privilege_type
+		WHEN 'CONNECT' THEN 'c'
+		WHEN 'CREATE' THEN 'C'
+		WHEN 'DELETE' THEN 'd'
+		WHEN 'EXECUTE' THEN 'X'
+		WHEN 'INSERT' THEN 'a'
+		WHEN 'REFERENCES' THEN 'x'
+		WHEN 'SELECT' THEN 'r'
+		WHEN 'TEMPORARY' THEN 'T'
+		WHEN 'TRIGGER' THEN 't'
+		WHEN 'TRUNCATE' THEN 'D'
+		WHEN 'UPDATE' THEN 'w'
+		WHEN 'USAGE' THEN 'U'
+		ELSE 'UNKNOWN'
+		END AS privilege_type,
+		defaclobjtype as deftype
+	FROM
+		(SELECT defaclobjtype, aclexplode(defaclacl) as acl
+			FROM
+				pg_namespace nsp
+				LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+			WHERE
+				nsp.oid={{scid}}::int
+        ) d) a
+	LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
+	LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname, a.deftype
+ORDER BY a.deftype
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/delete.sql
new file mode 100644
index 0000000..7686040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/delete.sql
@@ -0,0 +1,8 @@
+{% if scid %}
+SELECT nsp.nspname as name, nsp.oid
+FROM pg_namespace nsp
+WHERE nsp.oid = {{scid}};
+{% endif %}
+{% if name %}
+DROP SCHEMA {{ conn|qtIdent(name) }} {% if cascade %}CASCADE{%endif%};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/properties.sql
new file mode 100644
index 0000000..753c2b3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/properties.sql
@@ -0,0 +1,33 @@
+SELECT
+	CASE
+	WHEN (nspname LIKE E'pg\\\\_temp\\\\_%') THEN 1
+	WHEN (nspname LIKE E'pg\\\\_%') THEN 0
+	ELSE 3 END
+	AS nsptyp,
+	nsp.nspname as name, nsp.oid,
+	pg_get_userbyid(nspowner) AS namespaceowner, nspacl, description,
+	has_schema_privilege(nsp.oid, 'CREATE') as cancreate,
+	CASE WHEN nspname LIKE E'pg\\_%' THEN true ELSE false END as is_sys_object
+FROM
+	pg_namespace nsp
+	LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+WHERE
+	NOT ((nspname = 'pg_catalog' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'pgagent' AND EXISTS
+	(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'information_schema' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'dbo' OR nspname = 'sys')
+	){% if scid %}
+	AND nsp.oid={{scid}}::int
+	{% endif %}
+	{% if show_sysobj %}
+	AND nspname NOT LIKE E'pg\\temp\\%'
+	AND nspname NOT LIKE E'pg\\toast_temp\\%'
+	{% endif %}
+	AND nsp.nspparent = 0 AND NOT
+		(nspname = 'dbms_job_procedure' AND EXISTS(SELECT 1 FROM pg_proc WHERE pronamespace = nsp.oid and proname = 'run_job' LIMIT 1))
+ORDER BY 1, nspname;
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/update.sql
new file mode 100644
index 0000000..fe3fcad
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.1_plus/update.sql
@@ -0,0 +1,125 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{### To update SCHEMA name ###}
+{% if data.name and data.name != o_data.name %}
+ALTER SCHEMA {{ conn|qtIdent(o_data.name) }}
+  RENAME TO {{ conn|qtIdent(data.name) }};
+
+{% endif %}
+{### To update SCHEMA owner ###}
+{% if data.namespaceowner and data.namespaceowner != o_data.namespaceowner %}
+ALTER SCHEMA {{ conn|qtIdent(data.name) }}
+  OWNER TO {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{### To update SCHEMA comments ###}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Change the security labels ###}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### Change the privileges ###}
+{% if data.nspacl %}
+{% if 'deleted' in data.nspacl %}
+{% for priv in data.nspacl.deleted %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.nspacl %}
+{% for priv in data.nspacl.changed %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.nspacl %}
+{% for priv in data.nspacl.added %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% if 'deleted' in data.deftblacl %}
+{% for priv in data.deftblacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deftblacl %}
+{% for priv in data.deftblacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deftblacl %}
+{% for priv in data.deftblacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% if 'deleted' in data.defseqacl %}
+{% for priv in data.defseqacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.defseqacl %}
+{% for priv in data.defseqacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.defseqacl %}
+{% for priv in data.defseqacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% if 'deleted' in data.deffuncacl %}
+{% for priv in data.deffuncacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deffuncacl %}
+{% for priv in data.deffuncacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deffuncacl %}
+{% for priv in data.deffuncacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{###  End main if data ###}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/acl.sql
new file mode 100644
index 0000000..5121270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/acl.sql
@@ -0,0 +1,54 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/alter.sql
new file mode 100644
index 0000000..a5c2bd5
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/alter.sql
@@ -0,0 +1,30 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{###  To alter description ###}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Security Labels on schema ###}
+{% if data.seclabels and data.seclabels|length > 0 %}
+{% for r in data.seclabels %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+
+{% endif %}
+{###  ACL on schema ###}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### End of main if ###}
+{% endif %}
+{# ======== Below SQL will fetch id for given dataspace ======== #}
+{% if schema %}
+SELECT nsp.oid FROM pg_namespace nsp WHERE nsp.nspname = {{schema|qtLiteral}};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/create.sql
new file mode 100644
index 0000000..45ab7c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/create.sql
@@ -0,0 +1,5 @@
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}{% if data.namespaceowner %}
+
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }}{% endif %};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/defacl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/defacl.sql
new file mode 100644
index 0000000..4167168
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/defacl.sql
@@ -0,0 +1,39 @@
+SELECT
+	CASE (a.deftype)
+	WHEN 'r' THEN 'deftblacl'
+	WHEN 'S' THEN 'defseqacl'
+	WHEN 'f' THEN 'deffuncacl'
+	WHEN 'T' THEN 'deftypeacl'
+	END AS deftype,
+	COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
+FROM
+	(SELECT
+		(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,
+		CASE (acl).privilege_type
+		WHEN 'CONNECT' THEN 'c'
+		WHEN 'CREATE' THEN 'C'
+		WHEN 'DELETE' THEN 'd'
+		WHEN 'EXECUTE' THEN 'X'
+		WHEN 'INSERT' THEN 'a'
+		WHEN 'REFERENCES' THEN 'x'
+		WHEN 'SELECT' THEN 'r'
+		WHEN 'TEMPORARY' THEN 'T'
+		WHEN 'TRIGGER' THEN 't'
+		WHEN 'TRUNCATE' THEN 'D'
+		WHEN 'UPDATE' THEN 'w'
+		WHEN 'USAGE' THEN 'U'
+		ELSE 'UNKNOWN'
+		END AS privilege_type,
+		defaclobjtype as deftype
+	FROM
+		(SELECT defaclobjtype, aclexplode(defaclacl) as acl
+			FROM
+				pg_namespace nsp
+				LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+			WHERE
+				nsp.oid={{scid}}::int
+        ) d) a
+	LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
+	LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname, a.deftype
+ORDER BY a.deftype
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/delete.sql
new file mode 100644
index 0000000..7686040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/delete.sql
@@ -0,0 +1,8 @@
+{% if scid %}
+SELECT nsp.nspname as name, nsp.oid
+FROM pg_namespace nsp
+WHERE nsp.oid = {{scid}};
+{% endif %}
+{% if name %}
+DROP SCHEMA {{ conn|qtIdent(name) }} {% if cascade %}CASCADE{%endif%};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/properties.sql
new file mode 100644
index 0000000..d325022
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/properties.sql
@@ -0,0 +1,34 @@
+SELECT
+	CASE
+	WHEN (nspname LIKE E'pg\\\\_temp\\\\_%') THEN 1
+	WHEN (nspname LIKE E'pg\\\\_%') THEN 0
+	ELSE 3 END
+	AS nsptyp,
+	nsp.nspname as name, nsp.oid,
+	pg_get_userbyid(nspowner) AS namespaceowner, nspacl, description,
+	has_schema_privilege(nsp.oid, 'CREATE') as cancreate,
+	CASE WHEN nspname LIKE E'pg\\_%' THEN true ELSE false END as is_sys_object,
+	(SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=nsp.oid) AS seclabels
+FROM
+	pg_namespace nsp
+	LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+WHERE
+	NOT ((nspname = 'pg_catalog' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'pgagent' AND EXISTS
+	(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'information_schema' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'dbo' OR nspname = 'sys')
+	){% if scid %}
+	AND nsp.oid={{scid}}::int
+	{% endif %}
+	{% if show_sysobj %}
+	AND nspname NOT LIKE E'pg\\temp\\%'
+	AND nspname NOT LIKE E'pg\\toast_temp\\%'
+	{% endif %}
+	AND nsp.nspparent = 0 AND NOT
+		(nspname = 'dbms_job_procedure' AND EXISTS(SELECT 1 FROM pg_proc WHERE pronamespace = nsp.oid and proname = 'run_job' LIMIT 1))
+ORDER BY 1, nspname;
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/update.sql
new file mode 100644
index 0000000..d8bc687
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_9.2_plus/update.sql
@@ -0,0 +1,145 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{### To update SCHEMA name ###}
+{% if data.name and data.name != o_data.name %}
+ALTER SCHEMA {{ conn|qtIdent(o_data.name) }}
+  RENAME TO {{ conn|qtIdent(data.name) }};
+
+{% endif %}
+{### To update SCHEMA owner ###}
+{% if data.namespaceowner and data.namespaceowner != o_data.namespaceowner %}
+ALTER SCHEMA {{ conn|qtIdent(data.name) }}
+  OWNER TO {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{### To update SCHEMA comments ###}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Change the security labels ###}
+{# The SQL generated below will change Security Label #}
+{% 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, 'SCHEMA', data.name, r.provider) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in seclabels and seclabels.added|length > 0 %}
+{% for r in seclabels.added %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
+{% for r in seclabels.changed %}
+{{ SECLABLE.APPLY(conn, 'SCHEMA', data.name, r.provider, r.security_label) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### Change the privileges ###}
+{% if data.nspacl %}
+{% if 'deleted' in data.nspacl %}
+{% for priv in data.nspacl.deleted %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.nspacl %}
+{% for priv in data.nspacl.changed %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.nspacl %}
+{% for priv in data.nspacl.added %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% if 'deleted' in data.deftblacl %}
+{% for priv in data.deftblacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deftblacl %}
+{% for priv in data.deftblacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn, 'SCHEMA', data.name, 'TABLES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deftblacl %}
+{% for priv in data.deftblacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% if 'deleted' in data.defseqacl %}
+{% for priv in data.defseqacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.defseqacl %}
+{% for priv in data.defseqacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.defseqacl %}
+{% for priv in data.defseqacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% if 'deleted' in data.deffuncacl %}
+{% for priv in data.deffuncacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deffuncacl %}
+{% for priv in data.deffuncacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deffuncacl %}
+{% for priv in data.deffuncacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{### To change default privileges for types ###}
+{% if data.deftypeacl %}
+{% if 'deleted' in data.deftypeacl %}
+{% for priv in data.deftypeacl.deleted %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.deftypeacl %}
+{% for priv in data.deftypeacl.changed %}
+{{ DEFAULT_PRIVILEGE.UNSET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee) }}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.deftypeacl %}
+{% for priv in data.deftypeacl.added %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{###  End main if data ###}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/acl.sql
new file mode 100644
index 0000000..5121270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/acl.sql
@@ -0,0 +1,54 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/alter.sql
new file mode 100644
index 0000000..ee0e591
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/alter.sql
@@ -0,0 +1,21 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+{###  To alter description ###}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{###  ACL on schema ###}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### End of main if ###}
+{% endif %}
+{# ======== Below SQL will fetch id for given dataspace ======== #}
+{% if schema %}
+SELECT nsp.oid FROM pg_namespace nsp WHERE nsp.nspname = {{schema|qtLiteral}};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/create.sql
new file mode 100644
index 0000000..45ab7c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/create.sql
@@ -0,0 +1,5 @@
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}{% if data.namespaceowner %}
+
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }}{% endif %};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/defacl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/defacl.sql
new file mode 100644
index 0000000..4167168
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/defacl.sql
@@ -0,0 +1,39 @@
+SELECT
+	CASE (a.deftype)
+	WHEN 'r' THEN 'deftblacl'
+	WHEN 'S' THEN 'defseqacl'
+	WHEN 'f' THEN 'deffuncacl'
+	WHEN 'T' THEN 'deftypeacl'
+	END AS deftype,
+	COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
+FROM
+	(SELECT
+		(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,
+		CASE (acl).privilege_type
+		WHEN 'CONNECT' THEN 'c'
+		WHEN 'CREATE' THEN 'C'
+		WHEN 'DELETE' THEN 'd'
+		WHEN 'EXECUTE' THEN 'X'
+		WHEN 'INSERT' THEN 'a'
+		WHEN 'REFERENCES' THEN 'x'
+		WHEN 'SELECT' THEN 'r'
+		WHEN 'TEMPORARY' THEN 'T'
+		WHEN 'TRIGGER' THEN 't'
+		WHEN 'TRUNCATE' THEN 'D'
+		WHEN 'UPDATE' THEN 'w'
+		WHEN 'USAGE' THEN 'U'
+		ELSE 'UNKNOWN'
+		END AS privilege_type,
+		defaclobjtype as deftype
+	FROM
+		(SELECT defaclobjtype, aclexplode(defaclacl) as acl
+			FROM
+				pg_namespace nsp
+				LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+			WHERE
+				nsp.oid={{scid}}::int
+        ) d) a
+	LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
+	LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname, a.deftype
+ORDER BY a.deftype
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/delete.sql
new file mode 100644
index 0000000..7686040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/delete.sql
@@ -0,0 +1,8 @@
+{% if scid %}
+SELECT nsp.nspname as name, nsp.oid
+FROM pg_namespace nsp
+WHERE nsp.oid = {{scid}};
+{% endif %}
+{% if name %}
+DROP SCHEMA {{ conn|qtIdent(name) }} {% if cascade %}CASCADE{%endif%};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/properties.sql
new file mode 100644
index 0000000..7e832e6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/properties.sql
@@ -0,0 +1,33 @@
+SELECT
+	CASE
+	WHEN (nspname LIKE E'pg\\\\_temp\\\\_%') THEN 1
+	WHEN (nspname LIKE E'pg\\\\_%') THEN 0
+	ELSE 3 END
+	AS nsptyp,
+	nsp.nspname as name, nsp.oid,
+	pg_get_userbyid(nspowner) AS namespaceowner, nspacl, description,
+	has_schema_privilege(nsp.oid, 'CREATE') as cancreate,
+	CASE WHEN nspname LIKE E'pg\\_%' THEN true ELSE false END as is_sys_object,
+FROM
+	pg_namespace nsp
+	LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+WHERE
+	NOT ((nspname = 'pg_catalog' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'pgagent' AND EXISTS
+	(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'information_schema' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'dbo' OR nspname = 'sys')
+	){% if scid %}
+	AND nsp.oid={{scid}}::int
+	{% endif %}
+	{% if show_sysobj %}
+	AND nspname NOT LIKE E'pg\\temp\\%'
+	AND nspname NOT LIKE E'pg\\toast_temp\\%'
+	{% endif %}
+	AND nsp.nspparent = 0 AND NOT
+		(nspname = 'dbms_job_procedure' AND EXISTS(SELECT 1 FROM pg_proc WHERE pronamespace = nsp.oid and proname = 'run_job' LIMIT 1))
+ORDER BY 1, nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/update.sql
new file mode 100644
index 0000000..4fea7ca
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/edb_pre_9.1/update.sql
@@ -0,0 +1,42 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+{### To update SCHEMA name ###}
+{% if data.name and data.name != o_data.name %}
+ALTER SCHEMA {{ conn|qtIdent(o_data.name) }}
+  RENAME TO {{ conn|qtIdent(data.name) }};
+
+{% endif %}
+{### To update SCHEMA owner ###}
+{% if data.namespaceowner and data.namespaceowner != o_data.namespaceowner %}
+ALTER SCHEMA {{ conn|qtIdent(data.name) }}
+  OWNER TO {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{### To update SCHEMA comments ###}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Change the privileges ###}
+{% if data.nspacl %}
+{% if 'deleted' in data.nspacl %}
+{% for priv in data.nspacl.deleted %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.nspacl %}
+{% for priv in data.nspacl.changed %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.nspacl %}
+{% for priv in data.nspacl.added %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{###  End main if data ###}
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/acl.sql
new file mode 100644
index 0000000..5121270
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/acl.sql
@@ -0,0 +1,54 @@
+{### SQL to fetch privileges for catalog ###}
+SELECT 'nspacl' as deftype, COALESCE(gt.rolname, 'public') grantee, g.rolname grantor,
+    array_agg(privilege_type) as privileges, array_agg(is_grantable) as grantable
+FROM
+  (SELECT
+    d.grantee, d.grantor, d.is_grantable,
+    CASE d.privilege_type
+    WHEN 'CREATE' THEN 'C'
+    WHEN 'USAGE' THEN 'U'
+    ELSE 'UNKNOWN'
+    END AS privilege_type
+  FROM
+    ( SELECT nsp.nspacl
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+    ) acl,
+    (SELECT (d).grantee AS grantee, (d).grantor AS grantor, (d).is_grantable
+        AS is_grantable, (d).privilege_type AS privilege_type FROM (SELECT
+        aclexplode(nsp.nspacl) as d
+FROM pg_namespace nsp
+LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+WHERE
+NOT ((nspname = 'pg_catalog' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'pgagent' AND EXISTS
+(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname = 'information_schema' AND EXISTS
+  (SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+(nspname LIKE '_%' AND EXISTS
+                             (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+)AND
+nsp.oid={{scid}}::int AND
+nspname NOT LIKE E'pg\\temp\\%' AND
+nspname NOT LIKE E'pg\\toast_temp\\%'
+        ) a) d
+    ) d
+  LEFT JOIN pg_catalog.pg_roles g ON (d.grantor = g.oid)
+  LEFT JOIN pg_catalog.pg_roles gt ON (d.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/alter.sql
new file mode 100644
index 0000000..d9721b3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/alter.sql
@@ -0,0 +1,51 @@
+{% import 'macros/security.macros' as SECLABLE %}
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% import 'macros/default_privilege.macros' as DEFAULT_PRIVILEGE %}
+{% if data %}
+{###  To alter description ###}
+{% if data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{###  ACL on schema ###}
+{% if data.nspacl %}
+{% for priv in data.nspacl %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for tables ###}
+{% if data.deftblacl %}
+{% for priv in data.deftblacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TABLES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for sequences ###}
+{% if data.defseqacl %}
+{% for priv in data.defseqacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'SEQUENCES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for functions ###}
+{% if data.deffuncacl %}
+{% for priv in data.deffuncacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'FUNCTIONS', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### To change default privileges for types ###}
+{% if data.deftypeacl %}
+{% for priv in data.deftypeacl %}
+{{ DEFAULT_PRIVILEGE.SET(conn,'SCHEMA', data.name, 'TYPES', priv.grantee, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+
+{% endif %}
+{### End of main if ###}
+{% endif %}
+{# ======== Below SQL will fetch id for given dataspace ======== #}
+{% if schema %}
+SELECT nsp.oid FROM pg_namespace nsp WHERE nsp.nspname = {{schema|qtLiteral}};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/create.sql
new file mode 100644
index 0000000..45ab7c3
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/create.sql
@@ -0,0 +1,5 @@
+{% if data %}
+CREATE SCHEMA {{ conn|qtIdent(data.name) }}{% if data.namespaceowner %}
+
+  AUTHORIZATION {{ conn|qtIdent(data.namespaceowner) }}{% endif %};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/defacl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/defacl.sql
new file mode 100644
index 0000000..4167168
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/defacl.sql
@@ -0,0 +1,39 @@
+SELECT
+	CASE (a.deftype)
+	WHEN 'r' THEN 'deftblacl'
+	WHEN 'S' THEN 'defseqacl'
+	WHEN 'f' THEN 'deffuncacl'
+	WHEN 'T' THEN 'deftypeacl'
+	END AS deftype,
+	COALESCE(gt.rolname, 'public') grantee, g.rolname grantor, array_agg(a.privilege_type) as privileges, array_agg(a.is_grantable) as grantable
+FROM
+	(SELECT
+		(acl).grantee as grantee, (acl).grantor AS grantor, (acl).is_grantable AS is_grantable,
+		CASE (acl).privilege_type
+		WHEN 'CONNECT' THEN 'c'
+		WHEN 'CREATE' THEN 'C'
+		WHEN 'DELETE' THEN 'd'
+		WHEN 'EXECUTE' THEN 'X'
+		WHEN 'INSERT' THEN 'a'
+		WHEN 'REFERENCES' THEN 'x'
+		WHEN 'SELECT' THEN 'r'
+		WHEN 'TEMPORARY' THEN 'T'
+		WHEN 'TRIGGER' THEN 't'
+		WHEN 'TRUNCATE' THEN 'D'
+		WHEN 'UPDATE' THEN 'w'
+		WHEN 'USAGE' THEN 'U'
+		ELSE 'UNKNOWN'
+		END AS privilege_type,
+		defaclobjtype as deftype
+	FROM
+		(SELECT defaclobjtype, aclexplode(defaclacl) as acl
+			FROM
+				pg_namespace nsp
+				LEFT OUTER JOIN pg_catalog.pg_default_acl dacl ON (dacl.defaclnamespace = nsp.oid)
+			WHERE
+				nsp.oid={{scid}}::int
+        ) d) a
+	LEFT JOIN pg_catalog.pg_roles g ON (a.grantor = g.oid)
+	LEFT JOIN pg_catalog.pg_roles gt ON (a.grantee = gt.oid)
+GROUP BY g.rolname, gt.rolname, a.deftype
+ORDER BY a.deftype
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/delete.sql
new file mode 100644
index 0000000..7686040
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/delete.sql
@@ -0,0 +1,8 @@
+{% if scid %}
+SELECT nsp.nspname as name, nsp.oid
+FROM pg_namespace nsp
+WHERE nsp.oid = {{scid}};
+{% endif %}
+{% if name %}
+DROP SCHEMA {{ conn|qtIdent(name) }} {% if cascade %}CASCADE{%endif%};
+{% endif %}
\ No newline at end of file
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/properties.sql
new file mode 100644
index 0000000..68848b7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/properties.sql
@@ -0,0 +1,31 @@
+SELECT
+	CASE
+	WHEN (nspname LIKE E'pg\\\\_temp\\\\_%') THEN 1
+	WHEN (nspname LIKE E'pg\\\\_%') THEN 0
+	ELSE 3 END
+	AS nsptyp,
+	nsp.nspname as name, nsp.oid,
+	pg_get_userbyid(nspowner) AS namespaceowner, description,
+	has_schema_privilege(nsp.oid, 'CREATE') as cancreate,
+	CASE WHEN nspname LIKE E'pg\\_%' THEN true ELSE false END as is_sys_object,
+FROM
+	pg_namespace nsp
+	LEFT OUTER JOIN pg_description des ON (des.objoid=nsp.oid AND des.classoid='pg_namespace'::regclass)
+WHERE
+	NOT ((nspname = 'pg_catalog' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'pg_class' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'pgagent' AND EXISTS
+	(SELECT 1 FROM pg_class WHERE relname = 'pga_job' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname = 'information_schema' AND EXISTS
+		(SELECT 1 FROM pg_class WHERE relname = 'tables' AND relnamespace = nsp.oid LIMIT 1)) OR
+	(nspname LIKE '_%' AND EXISTS
+                               (SELECT 1 FROM pg_proc WHERE proname='slonyversion' AND pronamespace = nsp.oid LIMIT 1))
+	)
+	{% if scid %}
+	AND nsp.oid={{scid}}::int
+	{% endif %}
+	{% if show_sysobj %}
+	AND nspname NOT LIKE E'pg\\temp\\%'
+	AND nspname NOT LIKE E'pg\\toast_temp\\%'
+	{% endif %}
+ORDER BY 1, nspname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/update.sql
new file mode 100644
index 0000000..31c04be
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/sql/pre_9.1/update.sql
@@ -0,0 +1,42 @@
+{% import 'macros/privilege.macros' as PRIVILEGE %}
+{% if data %}
+{### To update SCHEMA name ###}
+{% if data.name and data.name != o_data.name %}
+ALTER SCHEMA {{ conn|qtIdent(o_data.name) }}
+  RENAME TO {{ conn|qtIdent(data.name) }};
+
+{% endif %}
+{### To update SCHEMA owner ###}
+{% if data.namespaceowner and data.namespaceowner != o_data.namespaceowner %}
+ALTER SCHEMA {{ conn|qtIdent(data.name) }}
+  OWNER TO {{ conn|qtIdent(data.namespaceowner) }};
+
+{% endif %}
+{### To update SCHEMA comments ###}
+{% if data.description and data.description != o_data.description %}
+COMMENT ON SCHEMA {{ conn|qtIdent(data.name) }}
+  IS {{ data.description|qtLiteral }};
+
+{% endif %}
+{### Change the privileges ###}
+{% if data.nspacl %}
+{% if 'deleted' in data.nspacl %}
+{% for priv in data.nspacl.deleted %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{% endfor %}
+{% endif %}
+{% if 'changed' in data.nspacl %}
+{% for priv in data.nspacl.changed %}
+{{ PRIVILEGE.RESETALL(conn, 'SCHEMA', priv.grantee, data.name) }}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+{% if 'added' in data.nspacl %}
+{% for priv in data.nspacl.added %}
+{{ PRIVILEGE.APPLY(conn, 'SCHEMA', priv.grantee, data.name, priv.without_grant, priv.with_grant) }}
+{% endfor %}
+{% endif %}
+
+{% endif %}
+{###  End main if data ###}
+{% endif %}
