Subject: [pgadmin4][patch] Unit test fail on GreenPlum (#3190)

From: Joao De Almeida Pereira <[email-masked]>
Date: Fri, 09 Mar 2018 20:46:43 +0000

Hello Hackers,

Attached you can find the patch that skip some tests and correct issues on
SQL that are failing when trying to connect to a GreenPlum database.

We did this by adding a attribute to to test_json called "db_type" that
will carry the type of database we are running tests against.

When we run tests against a GreenPlum instance the configuration would look
like this:

{
  "name": "GreenPlum",
  "comment": "GreenPlum DB",
  "db_username": "gp",
  "host": "localhost",
  "db_password": "",
  "db_port": 5433,
  "maintenance_db": "postgres",
  "sslmode": "prefer",
  "tablespace_path": "",
  "enabled": true,
  "db_type": "gpdb"
}

Thanks
Joao
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py
index 81f072f1..de8f9799 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_add.py
@@ -20,6 +20,7 @@ from . import utils as cast_utils

 class CastsAddTestCase(BaseTestGenerator):
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for cast node.
         ('Check Cast Node', dict(url='/browser/cast/obj/'))
@@ -27,6 +28,7 @@ class CastsAddTestCase(BaseTestGenerator):
 
     def runTest(self):
         """ This function will add cast under test database. """
+        super(CastsAddTestCase, self).runTest()
         self.server_data = parent_node_dict["database"][-1]
         self.server_id = self.server_data["server_id"]
         self.db_id = self.server_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py
index 46e2a013..b956fcbc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_delete.py
@@ -19,12 +19,14 @@ from . import utils as cast_utils
 
 class CastsDeleteTestCase(BaseTestGenerator):
     """ This class will delete the cast node added under database node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for cast node.
         ('Check Cast Node', dict(url='/browser/cast/obj/'))
     ]
 
     def setUp(self):
+        super(CastsDeleteTestCase, self).setUp()
         self.default_db = self.server["db"]
         self.database_info = parent_node_dict['database'][-1]
         self.db_name = self.database_info['db_name']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py
index 329162eb..d67f55ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_get.py
@@ -19,6 +19,7 @@ from . import utils as cast_utils
 
 class CastsGetTestCase(BaseTestGenerator):
     """ This class will fetch the cast node added under database node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for cast node.
         ('Check Cast Node', dict(url='/browser/cast/obj/'))
@@ -26,6 +27,7 @@ class CastsGetTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create cast."""
+        super(CastsGetTestCase, self).setUp()
         self.default_db = self.server["db"]
         self.database_info = parent_node_dict['database'][-1]
         self.db_name = self.database_info['db_name']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py
index f3e43ae9..99485095 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/tests/test_cast_put.py
@@ -21,6 +21,7 @@ from . import utils as cast_utils
 
 class CastsPutTestCase(BaseTestGenerator):
     """ This class will fetch the cast node added under database node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for cast node.
         ('Check Cast Node', dict(url='/browser/cast/obj/'))
@@ -28,6 +29,7 @@ class CastsPutTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create cast."""
+        super(CastsPutTestCase, self).setUp()
         self.default_db = self.server["db"]
         self.database_info = parent_node_dict['database'][-1]
         self.db_name = self.database_info['db_name']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
index 96bf6343..f4398d55 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
@@ -20,6 +20,7 @@ from . import utils as extension_utils

 class ExtensionsAddTestCase(BaseTestGenerator):
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for extension node.
         ('Check Extension Node', dict(url='/browser/extension/obj/'))
@@ -27,6 +28,7 @@ class ExtensionsAddTestCase(BaseTestGenerator):
 
     def runTest(self):
         """ This function will add extension under test schema. """
+        super(ExtensionsAddTestCase, self).runTest()
         self.schema_data = parent_node_dict["schema"][-1]
         self.server_id = self.schema_data["server_id"]
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py
index 5c06cc0a..a1644a59 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_delete.py
@@ -18,6 +18,7 @@ from . import utils as extension_utils

 class ExtensionsDeleteTestCase(BaseTestGenerator):
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for extension node.
         ('Check Extension Node', dict(url='/browser/extension/obj/'))
@@ -25,6 +26,7 @@ class ExtensionsDeleteTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension."""
+        super(ExtensionsDeleteTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py
index 1faba846..2401f1ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_get.py
@@ -18,6 +18,7 @@ from . import utils as extension_utils

 class ExtensionsGetTestCase(BaseTestGenerator):
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for extension node.
         ('Check Extension Node', dict(url='/browser/extension/obj/'))
@@ -25,6 +26,7 @@ class ExtensionsGetTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension."""
+        super(ExtensionsGetTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py
index fba73cf3..39598982 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_put.py
@@ -20,6 +20,7 @@ from . import utils as extension_utils

 class ExtensionsPutTestCase(BaseTestGenerator):
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for extension node.
         ('Check Extension Node', dict(url='/browser/extension/obj/'))
@@ -27,6 +28,7 @@ class ExtensionsPutTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension."""
+        super(ExtensionsPutTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
index 89d33495..abed9d0c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
@@ -27,6 +27,7 @@ class ForeignServerAddTestCase(BaseTestGenerator):
     """
     This class will add foreign server under database node.
     """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for foreign server node.
         ('Check FSRV Node', dict(url='/browser/foreign_server/obj/'))
@@ -34,6 +35,7 @@ class ForeignServerAddTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(ForeignServerAddTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
index 7d68150f..4e5c70ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
@@ -25,6 +25,7 @@ from . import utils as fsrv_utils
 
 class ForeignServerDeleteTestCase(BaseTestGenerator):
     """This class will add foreign server under FDW node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for foreign server node.
         ('Check FSRV Node', dict(url='/browser/foreign_server/obj/'))
@@ -32,6 +33,7 @@ class ForeignServerDeleteTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(ForeignServerDeleteTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
index baae85d9..c2fcffbb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
@@ -25,6 +25,7 @@ from . import utils as fsrv_utils
 
 class ForeignServerGetTestCase(BaseTestGenerator):
     """This class will add foreign server under FDW node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for foreign server node.
         ('Check FSRV Node', dict(url='/browser/foreign_server/obj/'))
@@ -32,6 +33,7 @@ class ForeignServerGetTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(ForeignServerGetTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
index 2ca73a42..77c5ce25 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
@@ -26,6 +26,7 @@ from . import utils as fsrv_utils
 
 class ForeignServerPutTestCase(BaseTestGenerator):
     """This class will add foreign server under FDW node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for foreign server node.
         ('Check FSRV Node', dict(url='/browser/foreign_server/obj/'))
@@ -33,6 +34,7 @@ class ForeignServerPutTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(ForeignServerPutTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py
index 1d86e2e4..fc5af27e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py
@@ -27,6 +27,7 @@ from regression.python_test_utils import test_utils as utils
 
 class UserMappingAddTestCase(BaseTestGenerator):
     """This class will add user mapping under foreign server node."""
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for user mapping node.
@@ -35,6 +36,7 @@ class UserMappingAddTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(UserMappingAddTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py
index 5e657905..a75d6e83 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py
@@ -27,6 +27,7 @@ from . import utils as um_utils
 
 class UserMappingDeleteTestCase(BaseTestGenerator):
     """This class will delete user mapping under foreign server node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for user mapping node.
         ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
@@ -34,6 +35,7 @@ class UserMappingDeleteTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(UserMappingDeleteTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py
index aa5e9c64..5e4e78c1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py
@@ -27,6 +27,7 @@ from . import utils as um_utils
 
 class UserMappingGetTestCase(BaseTestGenerator):
     """This class will add user mapping under foreign server node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for user mapping node.
         ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
@@ -34,6 +35,7 @@ class UserMappingGetTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(UserMappingGetTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py
index bbba7272..025b571a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py
@@ -28,6 +28,7 @@ from . import utils as um_utils
 
 class UserMappingPutTestCase(BaseTestGenerator):
     """This class will update user mapping under foreign server node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for user mapping node.
         ('Check user mapping Node', dict(url='/browser/user_mapping/obj/'))
@@ -35,6 +36,7 @@ class UserMappingPutTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(UserMappingPutTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_add.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_add.py
index 2900172b..3686da4b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_add.py
@@ -21,6 +21,8 @@ from . import utils as fdw_utils
 
 class FDWDAddTestCase(BaseTestGenerator):
     """ This class will add foreign data wrappers under database node. """
+    skip_on_database = ['gpdb']
+
     scenarios = [
         # Fetching default URL for foreign_data_wrapper node.
         ('Check FDW Node',
@@ -29,6 +31,8 @@ class FDWDAddTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension."""
+        super(FDWDAddTestCase, self).setUp()
+
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete.py
index 8fe7df05..73fa07ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete.py
@@ -21,12 +21,14 @@ from . import utils as fdw_utils
 
 class FDWDDeleteTestCase(BaseTestGenerator):
     """This class will delete foreign data wrappers under test database."""
+    skip_on_database = ['gpdb']
     scenarios = [  # Fetching default URL for foreign_data_wrapper node.
         ('Check FDW Node',
          dict(url='/browser/foreign_data_wrapper/obj/'))]
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(FDWDDeleteTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_get.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_get.py
index 225600e0..80a8ed14 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_get.py
@@ -21,6 +21,7 @@ from . import utils as fdw_utils
 
 class FDWDGetTestCase(BaseTestGenerator):
     """ This class will add foreign data wrappers under test database. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for foreign_data_wrapper node.
         ('Check FDW Node',
@@ -29,6 +30,7 @@ class FDWDGetTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(FDWDGetTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_put.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_put.py
index 518b3971..cec0264b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_put.py
@@ -22,6 +22,8 @@ from . import utils as fdw_utils
 
 class FDWDPutTestCase(BaseTestGenerator):
     """This class will update foreign data wrappers under test database."""
+    skip_on_database = ['gpdb']
+
     scenarios = [
         # Fetching default URL for foreign_data_wrapper node.
         ('Check FDW Node',
@@ -30,6 +32,7 @@ class FDWDPutTestCase(BaseTestGenerator):
 
     def setUp(self):
         """ This function will create extension and foreign data wrapper."""
+        super(FDWDPutTestCase, self).setUp()
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
         self.db_id = self.schema_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_add.py b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_add.py
index 4c6f9c00..8fd6779d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/tests/test_language_add.py
@@ -21,11 +21,13 @@ from . import utils as language_utils

 class LanguagesAddTestCase(BaseTestGenerator):
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Language add test case', dict(url='/browser/language/obj/'))
     ]
 
     def setUp(self):
+        super(LanguagesAddTestCase, self).setUp()
         self.server_data = parent_node_dict["database"][-1]
         self.server_id = self.server_data["server_id"]
         self.db_id = self.server_data['db_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py
index 220f4715..3c2a931f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_add.py
@@ -21,12 +21,14 @@ from regression.python_test_utils import test_utils as utils
 
 class CollationAddTestCase(BaseTestGenerator):
     """ This class will add new collation under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for collation node.
         ('Default Node URL', dict(url='/browser/collation/obj/'))
     ]
 
     def setUp(self):
+        super(CollationAddTestCase, self).setUp()
         self.database_info = parent_node_dict["database"][-1]
         self.db_name = self.database_info["db_name"]
         # Change the db name, so that schema will create in newly created db
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py
index e934338f..add8d56a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_delete.py
@@ -21,12 +21,14 @@ from . import utils as collation_utils
 
 class CollationDeleteTestCase(BaseTestGenerator):
     """ This class will delete added collation under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for collation node.
         ('Fetch collation Node URL', dict(url='/browser/collation/obj/'))
     ]
 
     def setUp(self):
+        super(CollationDeleteTestCase, self).setUp()
         self.schema_info = parent_node_dict["schema"][-1]
         self.schema_name = self.schema_info["schema_name"]
         self.db_name = parent_node_dict["database"][-1]["db_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py
index 5ae684ac..9a5eb207 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_get.py
@@ -21,12 +21,14 @@ from . import utils as collation_utils
 
 class CollationGetTestCase(BaseTestGenerator):
     """ This class will fetch new collation under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for collation node.
         ('Fetch collation Node URL', dict(url='/browser/collation/obj/'))
     ]
 
     def setUp(self):
+        super(CollationGetTestCase, self).setUp()
         self.schema_info = parent_node_dict["schema"][-1]
         self.schema_name = self.schema_info["schema_name"]
         self.db_name = parent_node_dict["database"][-1]["db_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py
index 0cf47988..4c7ae775 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/test_collation_put.py
@@ -22,12 +22,14 @@ from . import utils as collation_utils
 
 class CollationPutTestCase(BaseTestGenerator):
     """ This class will update added collation under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for collation node.
         ('Fetch collation Node URL', dict(url='/browser/collation/obj/'))
     ]
 
     def setUp(self):
+        super(CollationPutTestCase, self).setUp()
         self.schema_info = parent_node_dict["schema"][-1]
         self.schema_name = self.schema_info["schema_name"]
         self.db_name = parent_node_dict["database"][-1]["db_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/gpdb_5.0_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/gpdb_5.0_plus/properties.sql
new file mode 100644
index 00000000..3fc97b94
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/gpdb_5.0_plus/properties.sql
@@ -0,0 +1,25 @@
+SELECT
+    d.oid, d.typname as name, d.typbasetype, format_type(b.oid,NULL) as basetype,
+    pg_get_userbyid(d.typowner) as owner,
+    NULL AS colloid, format_type(b.oid, d.typtypmod) AS fulltype,
+    '' AS collname,
+    d.typtypmod, d.typnotnull, d.typdefault, d.typndims, d.typdelim, bn.nspname as basensp,
+    description, (SELECT COUNT(1) FROM pg_type t2 WHERE t2.typname=d.typname) > 1 AS domisdup,
+    (SELECT COUNT(1) FROM pg_type t3 WHERE t3.typname=b.typname) > 1 AS baseisdup,
+    ARRAY [] :: TEXT []         AS seclabels
+
+FROM
+    pg_type d
+JOIN
+    pg_type b ON b.oid = d.typbasetype
+JOIN
+    pg_namespace bn ON bn.oid=d.typnamespace
+LEFT OUTER JOIN
+    pg_description des ON (des.objoid=d.oid AND des.classoid='pg_type'::regclass)
+WHERE
+    d.typnamespace = {{scid}}::oid
+    {% if doid %}
+    AND d.oid={{doid}}::oid
+    {% endif %}
+ORDER BY
+    d.typname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py
index c803538b..fb7e66cb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/test_domain_add.py
@@ -51,7 +51,6 @@ class DomainAddTestCase(BaseTestGenerator):
         data = {
             "basensp": schema_name,
             "basetype": "character",
-            "collname": "pg_catalog.\"POSIX\"",
             "constraints": [{
                 "conname": "num",
                 "convalidated": True
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/utils.py
index a50bc0e3..acf7598b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/tests/utils.py
@@ -38,7 +38,7 @@ def create_domain(server, db_name, schema_name, schema_id, domain_name):
                                              server['port'])
         pg_cursor = connection.cursor()
         query = 'CREATE DOMAIN ' + schema_name + '.' + domain_name + \
-                ' AS character(10) COLLATE pg_catalog."POSIX" DEFAULT 1'
+                ' AS character(10) DEFAULT 1'
         pg_cursor.execute(query)
         connection.commit()
         # Get 'oid' from newly created domain
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py
index 511582cb..8a680c2e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_add.py
@@ -28,6 +28,7 @@ class ForeignTableAddTestCase(BaseTestGenerator):
     """
     This class will add foreign table under database node.
     """
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for foreign server node.
@@ -37,6 +38,7 @@ class ForeignTableAddTestCase(BaseTestGenerator):
     def setUp(self):
         """ This function will create foreign data wrapper and
         foreign server. """
+        super(ForeignTableAddTestCase, self).setUp()
 
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py
index f116f346..414f86f7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_delete.py
@@ -27,6 +27,7 @@ class ForeignTableDeleteTestCase(BaseTestGenerator):
     """
     This class will delete foreign table under database node.
     """
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for foreign table node.
@@ -36,6 +37,7 @@ class ForeignTableDeleteTestCase(BaseTestGenerator):
     def setUp(self):
         """ This function will create foreign data wrapper, foreign server
         and foreign table. """
+        super(ForeignTableDeleteTestCase, self).setUp()
 
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py
index 1c908b95..0a500733 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_get.py
@@ -27,6 +27,8 @@ class ForeignTableGetTestCase(BaseTestGenerator):
     """
     This class will fetch foreign table under database node.
     """
+    skip_on_database = ['gpdb']
+
     scenarios = [
         # Fetching default URL for foreign server node.
         ('Check foreign table Node', dict(url='/browser/foreign_table/obj/'))
@@ -35,6 +37,7 @@ class ForeignTableGetTestCase(BaseTestGenerator):
     def setUp(self):
         """ This function will create foreign data wrapper, foreign server
         and foreign table. """
+        super(ForeignTableGetTestCase, self).setUp()
 
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py
index aa62ea54..af9bc022 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/test_foreign_table_put.py
@@ -28,6 +28,8 @@ class ForeignTablePutTestCase(BaseTestGenerator):
     """
     This class will fetch foreign table under database node.
     """
+    skip_on_database = ['gpdb']
+
     scenarios = [
         # Fetching default URL for foreign server node.
         ('Check foreign table Node', dict(url='/browser/foreign_table/obj/'))
@@ -36,6 +38,7 @@ class ForeignTablePutTestCase(BaseTestGenerator):
     def setUp(self):
         """ This function will create foreign data wrapper, foreign server
         and foreign table. """
+        super(ForeignTablePutTestCase, self).setUp()
 
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
index 8d50ffee..53b3730f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
@@ -22,6 +22,7 @@ from regression.python_test_utils import test_utils as utils
 
 class TriggerFuncAddTestCase(BaseTestGenerator):
     """ This class will add new trigger function under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for trigger function node.
         ('Fetch Trigger Function Node URL', dict(
@@ -30,6 +31,7 @@ class TriggerFuncAddTestCase(BaseTestGenerator):
 
     def runTest(self):
         """ This function will add trigger function under schema node. """
+        super(TriggerFuncAddTestCase, self).runTest()
         db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
index 23cfce52..f0450a5d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
@@ -22,6 +22,7 @@ from . import utils as trigger_funcs_utils
 
 class TriggerFuncDeleteTestCase(BaseTestGenerator):
     """ This class will delete the trigger function under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for trigger function node.
         ('Fetch Trigger Function Node URL',
@@ -29,6 +30,7 @@ class TriggerFuncDeleteTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
+        super(TriggerFuncDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         self.schema_name = parent_node_dict["schema"][-1]["schema_name"]
         self.schema_id = parent_node_dict["schema"][-1]["schema_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
index 6e4c5b47..619ef7b9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
@@ -22,6 +22,7 @@ from . import utils as trigger_funcs_utils
 
 class TriggerFuncGetTestCase(BaseTestGenerator):
     """This class will fetch added trigger function under schema node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for trigger function node.
         ('Fetch Trigger Function Node URL',
@@ -29,6 +30,7 @@ class TriggerFuncGetTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
+        super(TriggerFuncGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         self.schema_name = parent_node_dict["schema"][-1]["schema_name"]
         self.schema_id = parent_node_dict["schema"][-1]["schema_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
index 02561d9d..26b790a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
@@ -23,6 +23,7 @@ from . import utils as trigger_funcs_utils
 
 class TriggerFuncPutTestCase(BaseTestGenerator):
     """ This class will update new trigger function under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for trigger function node.
         ('Fetch Trigger Function Node URL',
@@ -30,6 +31,7 @@ class TriggerFuncPutTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
+        super(TriggerFuncPutTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         self.schema_name = parent_node_dict["schema"][-1]["schema_name"]
         self.schema_id = parent_node_dict["schema"][-1]["schema_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py
index a602c877..3cfe0391 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py
@@ -22,6 +22,7 @@ from regression.python_test_utils import test_utils as utils
 
 class PackageAddTestCase(BaseTestGenerator):
     """ This class will add new package under test schema. """
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for package node.
@@ -30,7 +31,7 @@ class PackageAddTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
-
+        super(PackageAddTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py
index 28dbd1f5..a0a80576 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py
@@ -22,6 +22,7 @@ from . import utils as package_utils
 
 class PackageDeleteTestCase(BaseTestGenerator):
     """ This class will delete new package under test schema. """
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for package node.
@@ -30,7 +31,7 @@ class PackageDeleteTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
-
+        super(PackageDeleteTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py
index c02045c1..082fa334 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py
@@ -22,6 +22,7 @@ from . import utils as package_utils
 
 class PackageGetTestCase(BaseTestGenerator):
     """ This class will fetch new package under test schema. """
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for package node.
@@ -30,7 +31,7 @@ class PackageGetTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
-
+        super(PackageGetTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py
index fd0cbf50..1b39c045 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py
@@ -23,7 +23,7 @@ from . import utils as package_utils
 
 class PackagePutTestCase(BaseTestGenerator):
     """ This class will update new package under test schema. """
-
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for package node.
         ('Fetch Package Node URL', dict(
@@ -31,7 +31,7 @@ class PackagePutTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
-
+        super(PackagePutTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py
index 2c92c5cd..d580159d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_add.py
@@ -21,6 +21,7 @@ from regression.python_test_utils import test_utils as utils
 
 class SequenceAddTestCase(BaseTestGenerator):
     """ This class will add new sequence(s) under schema node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for sequence node.
         (
@@ -60,7 +61,7 @@ class SequenceAddTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
-        pass
+        super(SequenceAddTestCase, self).setUp()
 
     def runTest(self):
         """This function will add sequence(s) under schema node."""
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py
index b9587991..a11c5be5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_delete.py
@@ -21,12 +21,14 @@ from . import utils as sequence_utils
 
 class SequenceDeleteTestCase(BaseTestGenerator):
     """This class will delete added sequence under schema node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for sequence node.
         ('Fetch sequence Node URL', dict(url='/browser/sequence/obj/'))
     ]
 
     def setUp(self):
+        super(SequenceDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py
index 5c6baa63..199ca37f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_get.py
@@ -21,12 +21,14 @@ from . import utils as sequence_utils
 
 class SequenceGetTestCase(BaseTestGenerator):
     """This class will fetch added sequence under schema node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for sequence node.
         ('Fetch sequence Node URL', dict(url='/browser/sequence/obj/'))
     ]
 
     def setUp(self):
+        super(SequenceGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py
index 06043fd1..6f563ad6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/test_sequence_put.py
@@ -22,12 +22,14 @@ from . import utils as sequence_utils
 
 class SequencePutTestCase(BaseTestGenerator):
     """This class will update added sequence under schema node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for sequence node.
         ('Fetch sequence Node URL', dict(url='/browser/sequence/obj/'))
     ]
 
     def setUp(self):
+        super(SequencePutTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py
index 517b6453..ed4d68c2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py
@@ -24,6 +24,7 @@ from regression.python_test_utils import test_utils as utils
 
 class SynonymAddTestCase(BaseTestGenerator):
     """This class will add new synonym under test schema."""
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for synonym node.
@@ -31,6 +32,7 @@ class SynonymAddTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
+        super(SynonymAddTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py
index d1d2f55e..19d172bf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py
@@ -24,6 +24,7 @@ from . import utils as synonym_utils
 
 class SynonymDeleteTestCase(BaseTestGenerator):
     """This class will delete added synonym under schema node."""
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for synonym node.
@@ -31,6 +32,7 @@ class SynonymDeleteTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
+        super(SynonymDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py
index 2fdeaad0..d08888db 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py
@@ -24,6 +24,7 @@ from . import utils as synonym_utils
 
 class SynonymGetTestCase(BaseTestGenerator):
     """This class will fetch new synonym under schema node."""
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for synonym node.
@@ -31,6 +32,7 @@ class SynonymGetTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
+        super(SynonymGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py
index 353b3ab6..6a1d826d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py
@@ -27,6 +27,7 @@ from . import utils as synonym_utils
 
 class SynonymPutTestCase(BaseTestGenerator):
     """This class will update added synonym under test schema."""
+    skip_on_database = ['gpdb']
 
     scenarios = [
         # Fetching default URL for synonym node.
@@ -34,7 +35,7 @@ class SynonymPutTestCase(BaseTestGenerator):
     ]
 
     def setUp(self):
-
+        super(SynonymPutTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py
index f1ba6f6e..2b1ac92a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py
@@ -364,9 +364,20 @@ class ColumnsView(PGChildNodeView, DataTypeReader):
         data['attlen'] = None
         data['attprecision'] = None
 
-        self.set_length_precision(
-            length, precision, fulltype, data
-        )
+        import re
+
+        # If we have length & precision both
+        if length and precision:
+            matchObj = re.search(r'(\d+),(\d+)', fulltype)
+            if matchObj:
+                data['attlen'] = matchObj.group(1)
+                data['attprecision'] = matchObj.group(2)
+        elif length:
+            # If we have length only
+            matchObj = re.search(r'(\d+)', fulltype)
+            if matchObj:
+                data['attlen'] = matchObj.group(1)
+                data['attprecision'] = None
 
         # We need to fetch inherited tables for each table
         SQL = render_template("/".join([self.template_path,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_add.py
index a702ebe9..b202a18c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_add.py
@@ -23,12 +23,14 @@ from regression.python_test_utils import test_utils as utils
 
 class CheckConstraintAddTestCase(BaseTestGenerator):
     """This class will add check constraint to existing table"""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Add check constraint to table',
          dict(url='/browser/check_constraint/obj/'))
     ]
 
     def setUp(self):
+        super(CheckConstraintAddTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_delete.py
index 5b465ffa..acca9fd3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_delete.py
@@ -23,12 +23,14 @@ from . import utils as chk_constraint_utils
 
 class CheckConstraintDeleteTestCase(BaseTestGenerator):
     """This class will delete check constraint to existing table"""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Delete check constraint to table',
          dict(url='/browser/check_constraint/obj/'))
     ]
 
     def setUp(self):
+        super(CheckConstraintDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_get.py
index b5a61024..41247b5a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_get.py
@@ -23,12 +23,15 @@ from . import utils as chk_constraint_utils
 
 class CheckConstraintGetTestCase(BaseTestGenerator):
     """This class will fetch check constraint to existing table"""
+    skip_on_database = ['gpdb']
+
     scenarios = [
         ('Fetch check constraint to table',
          dict(url='/browser/check_constraint/obj/'))
     ]
 
     def setUp(self):
+        super(CheckConstraintGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_put.py
index 07a2240b..b2400602 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/test_check_constraint_put.py
@@ -24,12 +24,14 @@ from . import utils as chk_constraint_utils
 
 class CheckConstraintPutTestCase(BaseTestGenerator):
     """This class will update check constraint to existing table"""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Update check constraint to table',
          dict(url='/browser/check_constraint/obj/'))
     ]
 
     def setUp(self):
+        super(CheckConstraintPutTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_add.py
index 0df6dac0..ceeb6350 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_add.py
@@ -24,6 +24,7 @@ from regression.python_test_utils import test_utils as utils
 class IndexConstraintAddTestCase(BaseTestGenerator):
     """This class will add index constraint(primary key or unique key) to
     table column"""
+    skip_on_database = ['gpdb']
     primary_key_name = "test_primarykey_add_%s" % \
                        (str(uuid.uuid4())[1:8])
     primary_key_data = {"name": primary_key_name,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_delete.py
index b0fdf024..526b36cd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_delete.py
@@ -24,6 +24,7 @@ from . import utils as index_constraint_utils
 class IndexConstraintDeleteTestCase(BaseTestGenerator):
     """This class will delete index constraint(primary key or unique key) of
     table column"""
+    skip_on_database = ['gpdb']
     primary_key_name = "test_primarykey_delete_%s" % \
                        (str(uuid.uuid4())[1:8])
     unique_key_name = "test_uniquekey_delete_%s" % \
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_get.py
index 927e86de..31412176 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_get.py
@@ -24,6 +24,7 @@ from . import utils as index_constraint_utils
 class IndexConstraintGetTestCase(BaseTestGenerator):
     """This class will fetch the index constraint(primary key or unique key) of
     table column"""
+    skip_on_database = ['gpdb']
     primary_key_name = "test_primarykey_delete_%s" % \
                        (str(uuid.uuid4())[1:8])
     unique_key_name = "test_uniquekey_delete_%s" % \
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_put.py
index 2d13123d..ef0e3ade 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/test_index_constraint_put.py
@@ -25,6 +25,7 @@ from . import utils as index_constraint_utils
 class IndexConstraintUpdateTestCase(BaseTestGenerator):
     """This class will update index constraint(primary key or unique key) of
     table column"""
+    skip_on_database = ['gpdb']
     primary_key_name = "test_primarykey_put_%s" % \
                        (str(uuid.uuid4())[1:8])
     unique_key_name = "test_uniquekey_put_%s" % \
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/get_constraint_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/get_constraint_cols.sql
index cc1a902b..902789cc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/get_constraint_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/get_constraint_cols.sql
@@ -15,8 +15,9 @@ FROM pg_index i
 JOIN pg_attribute a ON (a.attrelid = i.indexrelid AND attnum = {{loop.index}})
 JOIN pg_type ty ON ty.oid=a.atttypid
 LEFT OUTER JOIN pg_opclass o ON (o.oid = i.indclass[{{loop.index -1}}])
-LEFT OUTER JOIN pg_constraint c ON (c.conindid = i.indexrelid) LEFT OUTER JOIN pg_operator op ON (op.oid = c.conexclop[{{loop.index}}])
+LEFT OUTER JOIN pg_constraint c ON (c.conindid = i.indexrelid)
+LEFT OUTER JOIN pg_operator op ON (op.oid = c.conexclop[{{loop.index}}])
 LEFT OUTER JOIN pg_collation coll ON a.attcollation=coll.oid
 LEFT OUTER JOIN pg_namespace nspc ON coll.collnamespace=nspc.oid
 WHERE i.indexrelid = {{cid}}::oid
-{% endfor %}
\ No newline at end of file
+{% endfor %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/gpdb_5.0_plus/get_constraint_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/gpdb_5.0_plus/get_constraint_cols.sql
new file mode 100644
index 00000000..397a2b68
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/gpdb_5.0_plus/get_constraint_cols.sql
@@ -0,0 +1,20 @@
+{% for n in range(colcnt|int) %}
+{% if loop.index != 1 %}
+UNION
+{% endif %}
+SELECT
+  i.indoption[{{loop.index -1}}] AS options,
+  pg_get_indexdef(i.indexrelid, {{loop.index}}, true) AS coldef,
+  NULL as op.oprname,
+  CASE WHEN (o.opcdefault = FALSE) THEN o.opcname ELSE null END AS opcname,
+  (SELECT setting AS value
+       FROM pg_settings
+       WHERE name='lc_collate') AS collname,
+  '' as collnspname,
+  format_type(ty.oid,NULL) AS col_type
+FROM pg_index i
+JOIN pg_attribute a ON (a.attrelid = i.indexrelid AND attnum = {{loop.index}})
+JOIN pg_type ty ON ty.oid=a.atttypid
+LEFT OUTER JOIN pg_opclass o ON (o.oid = i.indclass[{{loop.index -1}}])
+WHERE i.indexrelid = {{cid}}::oid
+{% endfor %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index/sql/gpdb_5.0_plus/column_details.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index/sql/gpdb_5.0_plus/column_details.sql
new file mode 100644
index 00000000..349d50c2
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index/sql/gpdb_5.0_plus/column_details.sql
@@ -0,0 +1,25 @@
+SELECT
+    i.indexrelid,
+    CASE i.indoption[i.attnum - 1]
+    WHEN 0 THEN ARRAY['ASC', 'NULLS LAST']
+    WHEN 1 THEN ARRAY['DESC', 'NULLS FIRST']
+    WHEN 2 THEN ARRAY['ASC', 'NULLS FIRST']
+    WHEN 3 THEN ARRAY['DESC', 'NULLS  ']
+    ELSE ARRAY['UNKNOWN OPTION' || i.indoption[i.attnum - 1], '']
+    END::text[] AS options,
+    i.attnum,
+    pg_get_indexdef(i.indexrelid, i.attnum, true) as attdef,
+    CASE WHEN (o.opcdefault = FALSE) THEN o.opcname ELSE null END AS opcname,
+    NULL AS oprname,
+	  '' AS collnspname
+FROM (
+      SELECT
+          indexrelid, i.indoption, i.indclass,
+          unnest(ARRAY(SELECT generate_series(1, i.indnatts) AS n)) AS attnum
+      FROM
+          pg_index i
+      WHERE i.indexrelid = {{idx}}::OID
+) i
+    LEFT JOIN pg_opclass o ON (o.oid = i.indclass[i.attnum - 1])
+    LEFT JOIN pg_attribute a ON (a.attrelid = i.indexrelid AND a.attnum = i.attnum)
+ORDER BY i.attnum;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py
index c0a6b8dc..49fd910b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_add.py
@@ -106,7 +106,7 @@ class TableAddTestCase(BaseTestGenerator):
             "hastoasttable": True,
             "like_constraints": True,
             "like_default_value": True,
-            "like_relation": "pg_catalog.pg_tables",
+            "like_relation": "pg_catalog.pg_namespace",
             "name": self.table_name,
             "primary_key": [],
             "relacl": [
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_column_update.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_column_update.py
deleted file mode 100644
index 1321d6f6..00000000
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_column_update.py
+++ /dev/null
@@ -1,96 +0,0 @@
-##########################################################################
-#
-# pgAdmin 4 - PostgreSQL Tools
-#
-# Copyright (C) 2013 - 2018, The pgAdmin Development Team
-# This software is released under the PostgreSQL Licence
-#
-##########################################################################
-
-import json
-import uuid
-
-from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
-    utils as schema_utils
-from pgadmin.browser.server_groups.servers.databases.tests import utils as \
-    database_utils
-from pgadmin.utils.route import BaseTestGenerator
-from regression import parent_node_dict
-from regression.python_test_utils import test_utils as utils
-from . import utils as tables_utils
-
-
-class TableNotNullUpdateTestCase(BaseTestGenerator):
-    """This class will add new collation under schema node."""
-    scenarios = [
-        ('Update Table with not null field', dict(url='/browser/table/obj/')),
-    ]
-
-    def setUp(self):
-        self.db_name = parent_node_dict["database"][-1]["db_name"]
-        schema_info = parent_node_dict["schema"][-1]
-        self.server_id = schema_info["server_id"]
-        self.db_id = schema_info["db_id"]
-        db_con = database_utils.connect_database(
-            self, utils.SERVER_GROUP, self.server_id, self.db_id
-        )
-        if not db_con['data']["connected"]:
-            raise Exception("Could not connect to database to add a table.")
-        self.schema_id = schema_info["schema_id"]
-        self.schema_name = schema_info["schema_name"]
-        schema_response = schema_utils.verify_schemas(self.server,
-                                                      self.db_name,
-                                                      self.schema_name)
-        if not schema_response:
-            raise Exception("Could not find the schema to add a table.")
-
-        self.table_name = "test_table_column_put_%s" % (str(uuid.uuid4())[1:8])
-
-        custom_sql = 'column_1 "char" NOT NULL, ' \
-                     'column_2 character varying(10) NOT NULL'
-
-        self.table_id = tables_utils.create_table(
-            self.server,
-            self.db_name,
-            self.schema_name,
-            self.table_name,
-            custom_sql
-        )
-
-    def runTest(self):
-        """This function will fetch added table under schema node."""
-        table_response = tables_utils.verify_table(
-            self.server, self.db_name, self.table_id
-        )
-        if not table_response:
-            raise Exception("Could not find the table to update.")
-
-        data = {
-            "id": self.table_id,
-            "columns": {
-                "changed": [
-                    {
-                        "attnum": 1,
-                        "attnotnull": False
-                    },
-                    {
-                        "attnum": 2,
-                        "attnotnull": False
-                    }
-
-                ]
-            }
-        }
-
-        response = self.tester.put(
-            self.url + str(utils.SERVER_GROUP) + '/' +
-            str(self.server_id) + '/' + str(self.db_id) + '/' +
-            str(self.schema_id) + '/' + str(self.table_id),
-            data=json.dumps(data), follow_redirects=True
-        )
-
-        self.assertEquals(response.status_code, 200)
-
-    def tearDown(self):
-        # Disconnect the database
-        database_utils.disconnect_database(self, self.server_id, self.db_id)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/utils.py
index b722147c..4cec323b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/utils.py
@@ -15,8 +15,7 @@ import traceback
 from regression.python_test_utils import test_utils as utils

-def create_table(server, db_name, schema_name, table_name,
-                 custom_column_sql=None):
+def create_table(server, db_name, schema_name, table_name):
     """
     This function creates a table under provided schema.
     :param server: server details
@@ -40,13 +39,9 @@ def create_table(server, db_name, schema_name, table_name,
         old_isolation_level = connection.isolation_level
         connection.set_isolation_level(0)
         pg_cursor = connection.cursor()
-        if custom_column_sql:
-            query = "CREATE TABLE %s.%s(%s)" % \
-                    (schema_name, table_name, custom_column_sql)
-        else:
-            query = "CREATE TABLE %s.%s(id serial UNIQUE NOT NULL, " \
-                    "name text, location text)" % \
-                    (schema_name, table_name)
+        query = "CREATE TABLE %s.%s(id serial UNIQUE NOT NULL, name text," \
+                " location text)" %\
+                (schema_name, table_name)
         pg_cursor.execute(query)
         connection.set_isolation_level(old_isolation_level)
         connection.commit()
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_add.py
index d706a982..74a92621 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_add.py
@@ -25,11 +25,13 @@ from regression.python_test_utils import test_utils as utils
 
 class TriggersAddTestCase(BaseTestGenerator):
     """This class will add new trigger under table node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Add trigger Node URL', dict(url='/browser/trigger/obj/'))
     ]
 
     def setUp(self):
+        super(TriggersAddTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_delete.py
index 852786f4..f7e71412 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_delete.py
@@ -25,11 +25,13 @@ from . import utils as triggers_utils
 
 class TriggersDeleteTestCase(BaseTestGenerator):
     """This class will delete trigger under table node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Delete trigger Node URL', dict(url='/browser/trigger/obj/'))
     ]
 
     def setUp(self):
+        super(TriggersDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_get.py
index a0ac3cc9..e23b6149 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_get.py
@@ -25,11 +25,13 @@ from . import utils as triggers_utils
 
 class TriggersGetTestCase(BaseTestGenerator):
     """This class will fetch trigger under table node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Fetch trigger Node URL', dict(url='/browser/trigger/obj/'))
     ]
 
     def setUp(self):
+        super(TriggersGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_put.py
index 73ccdbcb..927231f2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/test_triggers_put.py
@@ -26,11 +26,13 @@ from . import utils as triggers_utils
 
 class TriggersUpdateTestCase(BaseTestGenerator):
     """This class will update trigger under table node."""
+    skip_on_database = ['gpdb']
     scenarios = [
         ('Put trigger Node URL', dict(url='/browser/trigger/obj/'))
     ]
 
     def setUp(self):
+        super(TriggersUpdateTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
index f6d1b229..45403d11 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
@@ -1748,20 +1748,39 @@ class BaseTableView(PGChildNodeView):
                             old_data['atttypmod']
                         )
 
+                        def get_type_attr(key, data):
+                            """Utility function"""
+                            if key in data:
+                                return data[key]
+                            return None
+
                         # If the column data type has not changed then fetch
                         # old length and precision
                         if 'elemoid' in old_data and 'cltype' not in c:
                             length, precision, typeval = \
                                 self.get_length_precision(old_data['elemoid'])
-                            # Set proper values for old data
-                            self.set_length_precision(
-                                length, precision, fulltype, old_data
-                            )
 
-                            # Set proper values for in new data
-                            self.set_length_precision(
-                                length, precision, fulltype, c, old_data
-                            )
+                            # If we have length & precision both
+                            if length and precision:
+                                matchObj = re.search(r'(\d+),(\d+)', fulltype)
+                                if matchObj:
+                                    c['attlen'] = get_type_attr(
+                                        'attlen', c
+                                    ) or matchObj.group(1)
+                                    c['attprecision'] = get_type_attr(
+                                        'attprecision', c
+                                    ) or matchObj.group(2)
+                            elif length:
+                                # If we have length only
+                                matchObj = re.search(r'(\d+)', fulltype)
+                                if matchObj:
+                                    c['attlen'] = get_type_attr(
+                                        'attlen', c
+                                    ) or matchObj.group(1)
+                                    c['attprecision'] = None
+                            else:
+                                c['attlen'] = None
+                                c['attprecision'] = None
 
                         if 'cltype' in c:
                             typename = c['cltype']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
index c50f9b2a..d917b8ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
@@ -5,12 +5,12 @@ SELECT
     array_agg(b.is_grantable) AS grantable
 FROM
     (SELECT
-        (d).grantee AS grantee, (d).grantor AS grantor,
-        (d).is_grantable AS is_grantable,
-        CASE (d).privilege_type
+        (a).grantee AS grantee, (a).grantor AS grantor,
+        (a).is_grantable AS is_grantable,
+        CASE (a).privilege_type
         WHEN 'CREATE' THEN 'C'
         WHEN 'USAGE' THEN 'U'
-        ELSE 'UNKNOWN - ' || (d).privilege_type
+        ELSE 'UNKNOWN - ' || (a).privilege_type
         END AS privilege_type
     FROM
         (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
index 66c2b903..39d2bf91 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
@@ -20,12 +20,14 @@ from . import utils as schema_utils
 
 class SchemaPutTestCase(BaseTestGenerator):
     """ This class will update the schema under database node. """
+    skip_on_database = ['gpdb']
     scenarios = [
         # Fetching default URL for extension node.
         ('Check Schema Node URL', dict(url='/browser/schema/obj/'))
     ]
 
     def setUp(self):
+        super(SchemaPutTestCase, self).setUp()
         self.database_info = parent_node_dict["database"][-1]
         self.db_name = self.database_info["db_name"]
         # Change the db name, so that schema will create in newly created db
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
index b995c408..2395439c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
@@ -464,17 +464,22 @@ class TypeView(PGChildNodeView, DataTypeReader):
 
                 # Below logic will allow us to split length, precision from
                 # type name for grid
-                data = {
-                    'attlen': None,
-                    'attprecision': None
-                }
-
-                self.set_length_precision(
-                    is_tlength, is_precision, row['fulltype'], data
-                )
-
-                t_len = data['attlen']
-                t_prec = data['attprecision']
+                import re
+                t_len = None
+                t_prec = None
+
+                # If we have length & precision both
+                if is_tlength and is_precision:
+                    matchObj = re.search(r'(\d+),(\d+)', row['fulltype'])
+                    if matchObj:
+                        t_len = matchObj.group(1)
+                        t_prec = matchObj.group(2)
+                elif is_tlength:
+                    # If we have length only
+                    matchObj = re.search(r'(\d+)', row['fulltype'])
+                    if matchObj:
+                        t_len = matchObj.group(1)
+                        t_prec = None
 
                 type_name = DataTypeReader.parse_type_name(row['typname'])
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/acl.sql
new file mode 100644
index 00000000..67ce0de7
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/acl.sql
@@ -0,0 +1,7 @@
+SELECT
+  'typacl' AS deftype,
+  'PUBLIC' AS grantee,
+  NULL     AS grantor,
+  NULL     AS privileges,
+  NULL     AS grantable
+LIMIT 0;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/additional_properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/additional_properties.sql
new file mode 100644
index 00000000..570a7eb6
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/additional_properties.sql
@@ -0,0 +1,34 @@
+{# The SQL given below will fetch composite type#}
+{% if type == 'c' %}
+SELECT attnum, attname, format_type(t.oid,NULL) AS typname, attndims, atttypmod, nsp.nspname,
+    (SELECT COUNT(1) from pg_type t2 WHERE t2.typname=t.typname) > 1 AS isdup,
+    NULL AS collname, NULL as collnspname, att.attrelid,
+    format_type(t.oid, att.atttypmod) AS fulltype,
+    CASE WHEN t.typelem > 0 THEN t.typelem ELSE t.oid END as elemoid
+FROM pg_attribute att
+    JOIN pg_type t ON t.oid=atttypid
+    JOIN pg_namespace nsp ON t.typnamespace=nsp.oid
+    LEFT OUTER JOIN pg_type b ON t.typelem=b.oid
+    WHERE att.attrelid = {{typrelid}}::oid
+    ORDER by attnum;
+{% endif %}
+
+{# The SQL given below will fetch enum type#}
+{% if type == 'e' %}
+SELECT enumlabel
+FROM pg_enum
+    WHERE enumtypid={{tid}}::oid
+    ORDER by enumsortorder
+{% endif %}
+
+{# The SQL given below will fetch range type#}
+{% if type == 'r' %}
+SELECT rngsubtype, st.typname,
+    rngcollation, NULL AS collname,
+    rngsubopc, opc.opcname,
+    rngcanonical, rngsubdiff
+FROM pg_range
+    LEFT JOIN pg_type st ON st.oid=rngsubtype
+    LEFT JOIN pg_opclass opc ON opc.oid=rngsubopc
+    WHERE rngtypid={{tid}}::oid;
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/properties.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/properties.sql
new file mode 100644
index 00000000..a3027e70
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/sql/gpdb_5.0_plus/properties.sql
@@ -0,0 +1,31 @@
+SELECT
+  t.oid,
+  t.typname                   AS name,
+  FALSE            AS is_collatable,
+  array_to_string(ct.relacl::text[], ', ') AS acl,
+  t.*,
+  format_type(t.oid, NULL)    AS alias,
+  pg_get_userbyid(t.typowner) AS typeowner,
+  e.typname                   AS element,
+  description,
+  ct.oid                      AS taboid,
+  nsp.nspname                 AS schema,
+  ARRAY [] :: TEXT []         AS seclabels,
+  (CASE WHEN (t.oid <= {{datlastsysoid}}:: OID OR ct.oid != 0)
+    THEN TRUE
+   ELSE FALSE END)            AS is_sys_type
+FROM pg_type t
+  LEFT OUTER JOIN pg_type e ON e.oid = t.typelem
+  LEFT OUTER JOIN pg_class ct ON ct.oid = t.typrelid AND ct.relkind <> 'c'
+  LEFT OUTER JOIN pg_description des
+    ON (des.objoid = t.oid AND des.classoid = 'pg_type' :: REGCLASS)
+  LEFT OUTER JOIN pg_namespace nsp ON nsp.oid = t.typnamespace
+WHERE t.typtype != 'd' AND t.typname NOT LIKE E'\\_%' AND
+      t.typnamespace = {{scid}}:: OID
+{% if tid %}
+AND t.oid = {{tid}}:: OID
+{% endif %}
+{% if not show_system_objects %}
+AND ct.oid IS NULL
+{% endif %}
+ORDER BY t.typname;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py
index 8b73aa00..f330ed96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/utils.py
@@ -8,7 +8,7 @@
 ##########################################################################
 
 """Schema collection node helper class"""
-import re
+
 import json
 
 from flask import render_template
@@ -336,56 +336,6 @@ class DataTypeReader:
 
         return type_name
 
-    @classmethod
-    def set_length_precision(cls, length, precision, fulltype, data,
-                             old_data=None):
-        """
-        Parse length & precision from datatype and then assign it to datatype
-        according to client format
-
-        Args:
-            length: Boolean flag for length
-            precision: Boolean flag for precision
-            fulltype: Type name with length & precision
-            data: New values
-            old_data: Old values
-        """
-        # If we have length & precision both
-
-        if length and precision:
-            match_obj = re.search(r'(\d+),(\d+)', fulltype)
-            if match_obj:
-                attribute_length = DataTypeReader.get_valid_length_value(
-                    data.get('attlen', None))
-                data['attlen'] = attribute_length or match_obj.group(1)
-                attribute_precision = DataTypeReader.get_valid_length_value(
-                    data.get('attprecision', None))
-                data['attprecision'] = attribute_precision or match_obj.group(
-                    2)
-        elif length:
-            # If we have length only
-            match_obj = re.search(r'(\d+)', fulltype)
-            if match_obj:
-                attribute_length = DataTypeReader.get_valid_length_value(
-                    data.get('attlen', None))
-                data['attlen'] = attribute_length or match_obj.group(1)
-                data['attprecision'] = None
-        else:
-            # Use the old values to avoid unnecessary
-            if old_data:
-                if 'attlen' in old_data:
-                    if old_data['attlen'] != '-1':
-                        data['attlen'] = old_data.get('attlen', None)
-                    if 'attprecision' in old_data:
-                        if old_data['attprecision'] != '-1':
-                            data['attprecision'] = old_data.get(
-                                'attprecision', None
-                            )
-
-    @classmethod
-    def get_valid_length_value(cls, val):
-        return val if val and int(val) != -1 else None
-
 
 def trigger_definition(data):
     """
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql
index 680ab235..9296ee6c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql
@@ -135,3 +135,4 @@
 {% endfor %}
 {% endif %}
 {% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
index a0f67462..e5598468 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
@@ -50,6 +50,8 @@ class DatabasesUpdateTestCase(BaseTestGenerator):
                     follow_redirects=True)
                 self.assertEquals(response.status_code, 200)
             except Exception as exception:
+                from traceback import print_exc
+                print_exc()
                 raise Exception("Error while updating database details. %s" %
                                 exception)
             finally:
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql
index b975a546..1a0b0814 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql
@@ -20,11 +20,7 @@ CREATE {% if data.rolcanlogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(da
 
 	INHERIT{% else %}
 
-	NOINHERIT{% endif %}{% if data.rolreplication %}
-
-	REPLICATION{% else %}
-
-	NOREPLICATION{% endif %}{% if 'rolconnlimit' in data and data.rolconnlimit is number and data.rolconnlimit >= -1 %}
+	NOINHERIT{% endif %}{% if 'rolconnlimit' in data and data.rolconnlimit is number and data.rolconnlimit >= -1 %}
 
 	CONNECTION LIMIT {{ data.rolconnlimit }}{% endif %}{% if data.rolvaliduntil and data.rolvaliduntil is not none %}
 
@@ -42,7 +38,8 @@ GRANT {{ conn|qtIdent(data.admins)|join(', ') }} TO {{ conn|qtIdent(data.rolname
 
 {% for var in data.variables %}
 
-{{ VARIABLE.APPLY(conn, var.database, data.rolname, var.name, var.value) }}
+ALTER ROLE {{ self.conn|qtIdent(data.rolname) }}
+    SET {{ conn|qtIdent(var.name) }} TO {{ var.value }};
 {% endfor %}{% endif %}{% if data.description %}
 
 COMMENT ON ROLE {{ conn|qtIdent(data.rolname) }} IS {{ data.description|qtLiteral }};
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/properties.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/properties.sql
index 3ec411c5..8e560bcc 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/properties.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/properties.sql
@@ -11,6 +11,6 @@ SELECT
 FROM
 	pg_roles r
 {% if rid %}
-WHERE r.oid = {{ rid|qtIdent }}::OID
+WHERE r.oid = {{ rid }}::OID
 {% endif %}
 ORDER BY r.rolcanlogin, r.rolname
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql
index db3d65c4..642009e0 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/sql.sql
@@ -66,7 +66,6 @@ UNION ALL
 FROM
 	(SELECT
 		'ALTER ROLE ' || pg_catalog.quote_ident(pg_get_userbyid(%(rid)s::OID)) ||
-		' IN DATABASE ' || pg_catalog.quote_ident(datname) ||
 		' SET ' || param|| ' TO ' ||
 		CASE
 		WHEN param IN ('search_path', 'temp_tablespaces') THEN value
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/update.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/update.sql
index b1fd620a..51df8e90 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/update.sql
@@ -30,9 +30,7 @@ ALTER {% if rolCanLogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(rolname)
 	INHERIT{% else %}
 	NOINHERIT{% endif %}{% endif %}{% if 'rolreplication' in data %}
 
-{% if data.rolreplication %}
-	REPLICATION{% else %}
-	NOREPLICATION{% endif %}{% endif %}{% if 'rolconnlimit' in data and data.rolconnlimit is number and data.rolconnlimit >= -1 %}
+{% endif %}{% if 'rolconnlimit' in data and data.rolconnlimit is number and data.rolconnlimit >= -1 %}
 
 	CONNECTION LIMIT {{ data.rolconnlimit }}
 {% endif %}{% if 'rolvaliduntil' in data %}
@@ -87,7 +85,8 @@ GRANT {{ conn|qtIdent(data.members)|join(', ') }} TO {{ conn|qtIdent(rolname) }}
 {% if 'added' in variables and variables.added|length > 0 %}
 
 {% for var in variables.added %}
-{{ VARIABLE.APPLY(conn, var.database, rolname, var.name, var.value) }}
+ALTER ROLE {{ self.conn|qtIdent(data.rolname) }}
+    SET {{ conn|qtIdent(var.name) }} TO {{ var.value }};
 {% endfor %}{% endif %}
 {% if 'changed' in variables and variables.changed|length > 0 %}
 
diff --git a/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py b/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py
index b7745463..23a5c7fc 100644
--- a/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py
+++ b/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py
@@ -8,8 +8,8 @@
 ##########################################################################
 import sys
 
-import simplejson as json
 from flask import Response
+import simplejson as json
 
 from pgadmin.tools.sqleditor.utils.start_running_query import StartRunningQuery
 from pgadmin.utils.exception import ConnectionLost
@@ -385,14 +385,8 @@ class StartRunningQueryTest(BaseTestGenerator):
            '.internal_server_error')
     @patch('pgadmin.tools.sqleditor.utils.start_running_query'
            '.update_session_grid_transaction')
-    @patch('pgadmin.tools.sqleditor.utils.start_running_query'
-           '.StartRunningQuery.is_begin_required_for_sql_query')
-    @patch('pgadmin.tools.sqleditor.utils.start_running_query'
-           '.StartRunningQuery.is_rollback_statement_required')
-    def runTest(self, is_rollback_statement_required_stub,
-                is_begin_required_for_sql_query_stub,
-                update_session_grid_transaction_stub,
-                internal_server_error_mock, get_driver_stub, pickle_stub,
+    def runTest(self, update_session_grid_transaction_mock,
+                internal_server_error_mock, get_driver_mock, pickle_mock,
                 make_json_response_mock,
                 apply_explain_plan_wrapper_if_needed_mock):
         """Check correct function is called to handle to run query."""
@@ -404,27 +398,41 @@ class StartRunningQueryTest(BaseTestGenerator):
         make_json_response_mock.return_value = expected_response
         if self.expect_internal_server_error_called_with is not None:
             internal_server_error_mock.return_value = expected_response
-        pickle_stub.loads.return_value = self.pickle_load_return
+        pickle_mock.loads.return_value = self.pickle_load_return
         blueprint_mock = MagicMock(
             info_notifier_timeout=MagicMock(get=lambda: 5))
 
+        # Save value for the later use
+        self.is_begin_required_for_sql_query = \
+            StartRunningQuery.is_begin_required_for_sql_query
+        self.is_rollback_statement_required = \
+            StartRunningQuery.is_rollback_statement_required
+
         if self.is_begin_required:
-            is_begin_required_for_sql_query_stub.return_value = True
+            StartRunningQuery.is_begin_required_for_sql_query = MagicMock(
+                return_value=True
+            )
         else:
-            is_begin_required_for_sql_query_stub.return_value = False
+            StartRunningQuery.is_begin_required_for_sql_query = MagicMock(
+                return_value=False
+            )
         if self.is_rollback_required:
-            is_rollback_statement_required_stub.return_value = True
+            StartRunningQuery.is_rollback_statement_required = MagicMock(
+                return_value=True
+            )
         else:
-            is_rollback_statement_required_stub.return_value = False
+            StartRunningQuery.is_rollback_statement_required = MagicMock(
+                return_value=False
+            )
 
         apply_explain_plan_wrapper_if_needed_mock.return_value = \
             self.apply_explain_plan_wrapper_if_needed_return_value
 
         manager = self.__create_manager()
         if self.get_driver_exception:
-            get_driver_stub.side_effect = get_driver_exception
+            get_driver_mock.side_effect = get_driver_exception
         else:
-            get_driver_stub.return_value = MagicMock(
+            get_driver_mock.return_value = MagicMock(
                 connection_manager=lambda session_id: manager)
 
         try:
@@ -517,3 +525,10 @@ class StartRunningQueryTest(BaseTestGenerator):
             self.connection.execute_void.assert_called_with('ROLLBACK;')
         elif not self.is_begin_required:
             self.connection.execute_void.assert_not_called()
+
+    def tearDown(self):
+        #  Reset methods to the original state
+        StartRunningQuery.is_rollback_statement_required = \
+            staticmethod(self.is_rollback_statement_required)
+        StartRunningQuery.is_rollback_statement_required = \
+            staticmethod(self.is_rollback_statement_required)
diff --git a/web/pgadmin/utils/route.py b/web/pgadmin/utils/route.py
index 379ef755..dc8bd6db 100644
--- a/web/pgadmin/utils/route.py
+++ b/web/pgadmin/utils/route.py
@@ -80,6 +80,13 @@ class TestsGeneratorRegistry(ABCMeta):
 class BaseTestGenerator(unittest.TestCase):
     # Defining abstract method which will override by individual testcase.
 
+    def setUp(self):
+        super(BaseTestGenerator, self).setUp()
+        if hasattr(self, 'skip_on_database'):
+            if 'db_type' in self.server:
+                if self.server['db_type'] in self.skip_on_database:
+                    self.skipTest('cannot run in: %s' % self.server['db_type'])
+
     @classmethod
     def setTestServer(cls, server):
         cls.server = server
diff --git a/web/regression/python_test_utils/test_utils.py b/web/regression/python_test_utils/test_utils.py
index c11853fb..c3c0fe57 100644
--- a/web/regression/python_test_utils/test_utils.py
+++ b/web/regression/python_test_utils/test_utils.py
@@ -88,6 +88,8 @@ def get_config_data():
                 "sslmode": srv['sslmode'],
                 "tablespace_path": srv.get('tablespace_path', None)
             }
+            if 'db_type' in srv:
+                data['db_type'] = srv['db_type']
             server_data.append(data)
     return server_data
 
diff --git a/web/regression/test_config.json.in b/web/regression/test_config.json.in
index a373dee3..e69acdd5 100644
--- a/web/regression/test_config.json.in
+++ b/web/regression/test_config.json.in
@@ -21,7 +21,8 @@
       "maintenance_db": "postgres",
       "sslmode": "prefer",
       "tablespace_path": "",
-      "enabled": true
+      "enabled": true,
+      "db_type": "pg"
     }
   ],
   "server_update_data": [
@@ -29,4 +30,4 @@
       "comment": "This is test update comment"
     }
   ]
-}
\ No newline at end of file
+}

---

From: Dave Page <[email-masked]>
Date: Sat, 10 Mar 2018 20:53:13 +0000

Hi

> will carry the type of database we are running tests against.

Any reason we can't do that dynamically as we do with the EPAS-specific
tests?

>
> When we run tests against a GreenPlum instance the configuration would
> look like this:
>
> {
>   "name": "GreenPlum",

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Joao De Almeida Pereira <[email-masked]>
Date: Sun, 11 Mar 2018 23:22:05 +0000

Hello,
Can you point out an example?
Thanks

On Sat, Mar 10, 2018, 3:53 PM Dave Page <[email-masked]> wrote:

>> Attached you can find the patch that skip some tests and correct issues
>> on SQL that are failing when trying to connect to a GreenPlum database.
>>

---

From: Dave Page <[email-masked]>
Date: Sun, 11 Mar 2018 20:20:18 -0400

Hi

> Can you point out an example?

See the setUp function in test_resource_groups_add.py:

        if "type" in server_con["data"]:
            if server_con["data"]["type"] == "pg":
                message = "Resource groups are not supported by PG."
                self.skipTest(message)
            else:
                if server_con["data"]["version"] < 90400:
                    message = "Resource groups are not supported by PPAS
9.3" \
                              " and below."
                    self.skipTest(message)

---

From: Joao De Almeida Pereira <[email-masked]>
Date: Tue, 13 Mar 2018 18:19:02 +0000

Hi

Attached you can find the patch that instead of using the json
configuration, connects to the database to retrieve the type and then check
if the test should be skipped or not.

Thanks
Victoria & Joao

 
     def runTest(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):
         """ This function will create cast."""
+        super(CastsPutTestCase, self).setUp()
         self.default_db = self.server["db"]
         self.database_info = parent_node_dict['database'][-1]
         self.db_name = self.database_info['db_name']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py
index a98dcd06..a6639075 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_add.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import \
     utils as database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression import trigger_funcs_utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py
index cc5e6ce0..c0b92913 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_delete.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import \
     utils as database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression import trigger_funcs_utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py
index b07e7d57..c263a6b0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_get.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import \
     utils as database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression import trigger_funcs_utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py
index 61afb1cf..32fbfb8c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/tests/test_event_trigger_put.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import \
     utils as database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression import trigger_funcs_utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
index 96bf6343..f4398d55 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/test_extension_add.py
@@ -20,6 +20,7 @@ from . import utils as extension_utils

     def runTest(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):
 
     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     scenarios = [
 
     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):
 
     scenarios = [

     scenarios = [

 
         self.schema_data = parent_node_dict['schema'][-1]
         self.server_id = self.schema_data['server_id']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
index 8d50ffee..d238bf01 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_add.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -22,6 +22,7 @@ from regression.python_test_utils import test_utils as utils

     def runTest(self):
         """ This function will add trigger function under schema node. """
+        super(TriggerFuncAddTestCase, self).runTest()
         db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
index 23cfce52..3d1fe9fe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_delete.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -22,6 +22,7 @@ from . import utils as trigger_funcs_utils

     def setUp(self):
+        super(TriggerFuncDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         self.schema_name = parent_node_dict["schema"][-1]["schema_name"]
         self.schema_id = parent_node_dict["schema"][-1]["schema_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
index 6e4c5b47..7eb0d2a3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_get.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -22,6 +22,7 @@ from . import utils as trigger_funcs_utils

     def setUp(self):
+        super(TriggerFuncGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         self.schema_name = parent_node_dict["schema"][-1]["schema_name"]
         self.schema_id = parent_node_dict["schema"][-1]["schema_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
index 02561d9d..63d4c085 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/tests/test_trigger_func_put.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -23,6 +23,7 @@ from . import utils as trigger_funcs_utils

     def setUp(self):
+        super(TriggerFuncPutTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         self.schema_name = parent_node_dict["schema"][-1]["schema_name"]
         self.schema_id = parent_node_dict["schema"][-1]["schema_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py
index a602c877..fa7410c7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_add.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -22,6 +22,7 @@ from regression.python_test_utils import test_utils as utils

     scenarios = [
 
     def setUp(self):
-
+        super(PackageAddTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py
index 28dbd1f5..d62e016a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_delete.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -22,6 +22,7 @@ from . import utils as package_utils

     scenarios = [
 
     def setUp(self):
-
+        super(PackageDeleteTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py
index c02045c1..1c4e1bf0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_get.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -22,6 +22,7 @@ from . import utils as package_utils

     scenarios = [
 
     def setUp(self):
-
+        super(PackageGetTestCase, self).setUp()
         schema_info = parent_node_dict["schema"][-1]
         self.schema_id = schema_info["schema_id"]
         self.schema_name = schema_info["schema_name"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py
index fd0cbf50..5e59547c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/packages/tests/test_package_put.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -23,7 +23,7 @@ from . import utils as package_utils

     def setUp(self):
-

     def setUp(self):
-        pass
 
     def runTest(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):
+        super(SequencePutTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py
index 517b6453..d93db98a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_add.py
@@ -16,7 +16,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -24,6 +24,7 @@ from regression.python_test_utils import test_utils as utils

     scenarios = [
 
     def setUp(self):
+        super(SynonymAddTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py
index d1d2f55e..05238be6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_delete.py
@@ -15,7 +15,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -24,6 +24,7 @@ from . import utils as synonym_utils

     scenarios = [
 
     def setUp(self):
+        super(SynonymDeleteTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py
index 2fdeaad0..d8acee46 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_get.py
@@ -15,7 +15,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -24,6 +24,7 @@ from . import utils as synonym_utils

     scenarios = [
 
     def setUp(self):
+        super(SynonymGetTestCase, self).setUp()
         self.db_name = parent_node_dict["database"][-1]["db_name"]
         schema_info = parent_node_dict["schema"][-1]
         self.server_id = schema_info["server_id"]
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py
index 353b3ab6..9e80b4b0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/test_synonym_put.py
@@ -18,7 +18,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
@@ -27,6 +27,7 @@ from . import utils as synonym_utils

     scenarios = [
 
     def setUp(self):
-

 
 
     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):
index c0a6b8dc..4c3cde31 100644
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py
index f8ea9730..63f73eae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/test_table_put.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict

 
     def setUp(self):

     def setUp(self):

     def setUp(self):

     def setUp(self):

 
                         if 'cltype' in c:
                             typename = c['cltype']
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
index c50f9b2a..d917b8ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/gpdb_5.0_plus/sql/acl.sql
@@ -5,12 +5,12 @@ SELECT
     array_agg(b.is_grantable) AS grantable
 FROM
     (SELECT
-        (d).grantee AS grantee, (d).grantor AS grantor,
-        (d).is_grantable AS is_grantable,
-        CASE (d).privilege_type
+        (a).grantee AS grantee, (a).grantor AS grantor,
+        (a).is_grantable AS is_grantable,
+        CASE (a).privilege_type
         WHEN 'CREATE' THEN 'C'
         WHEN 'USAGE' THEN 'U'
-        ELSE 'UNKNOWN - ' || (d).privilege_type
+        ELSE 'UNKNOWN - ' || (a).privilege_type
         END AS privilege_type
     FROM
         (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py
index 4af395c3..d1036b33 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_get.py
@@ -9,7 +9,7 @@
 
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
index 66c2b903..39d2bf91 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tests/test_schema_put.py
@@ -20,12 +20,14 @@ from . import utils as schema_utils

     def setUp(self):

 

 
         return type_name
 
-    @classmethod
 
 def trigger_definition(data):
     """
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_add.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_add.py
index fb577638..eb1404e7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_add.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_delete.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_delete.py
index b968048d..f5967305 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_delete.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get.py
index 14c08bf9..2c6c14fc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get.py
@@ -13,7 +13,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_put.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_put.py
index c6351b6b..78cbe25b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_put.py
@@ -14,7 +14,7 @@ from pgadmin.browser.server_groups.servers.databases.schemas.tests import \
     utils as schema_utils
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
     database_utils
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql
index 680ab235..9296ee6c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/default/alter_online.sql
@@ -135,3 +135,4 @@
 {% endfor %}
 {% endif %}
 {% endif %}
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
index 20462fd9..88b982f8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_add.py
@@ -9,7 +9,7 @@
 
 import json
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
index 589ec430..8c925c33 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py
@@ -9,7 +9,7 @@
 
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
index a0f67462..e5598468 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py
@@ -50,6 +50,8 @@ class DatabasesUpdateTestCase(BaseTestGenerator):
                     follow_redirects=True)
                 self.assertEquals(response.status_code, 200)
             except Exception as exception:
+                from traceback import print_exc
+                print_exc()
                 raise Exception("Error while updating database details. %s" %
                                 exception)
             finally:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py b/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py
index 40243360..6510141f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py
@@ -10,7 +10,7 @@
 import json
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from regression.python_test_utils import test_utils as utils
 
 DATABASE_CONNECT_URL = '/browser/database/connect/'
diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_add.py b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_add.py
index 49cb0280..c1793bc6 100644
--- a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_add.py
+++ b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_add.py
@@ -10,7 +10,7 @@
 import json
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_delete.py b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_delete.py
index c398bcf3..be7eedcf 100644
--- a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_delete.py
+++ b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_delete.py
@@ -9,7 +9,7 @@
 
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_put.py b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_put.py
index da7ad7f5..bd66701d 100644
--- a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_put.py
+++ b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/test_resource_groups_put.py
@@ -10,7 +10,7 @@
 import json
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/tests_resource_groups_get.py b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/tests_resource_groups_get.py
index eb362afa..1c4f76a7 100644
--- a/web/pgadmin/browser/server_groups/servers/resource_groups/tests/tests_resource_groups_get.py
+++ b/web/pgadmin/browser/server_groups/servers/resource_groups/tests/tests_resource_groups_get.py
@@ -9,7 +9,7 @@
 
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql
index b975a546..1a0b0814 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/sql/post8_4/create.sql
@@ -20,11 +20,7 @@ CREATE {% if data.rolcanlogin %}USER{% else %}ROLE{% endif %} {{ conn|qtIdent(da
 
 	INHERIT{% else %}

 

 

 
 
diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py
index dd672ad8..e2eeb2d5 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py
+++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_add.py
@@ -9,7 +9,7 @@
 
 import json
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py
index 30ebeba2..c8b9b0ba 100644
--- a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_add.py
@@ -11,7 +11,7 @@ from __future__ import print_function
 
 import json
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py
index 51dbf77c..2154e7e6 100644
--- a/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/tests/test_tbspc_get.py
@@ -9,7 +9,7 @@
 
 import uuid
 
-from pgadmin.browser.server_groups.servers.tests import utils as server_utils
+from pgadmin.utils import server_utils as server_utils
 from pgadmin.utils.route import BaseTestGenerator
 from regression import parent_node_dict
 from regression.python_test_utils import test_utils as utils
diff --git a/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py b/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py
index b7745463..23a5c7fc 100644
--- a/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py
+++ b/web/pgadmin/tools/sqleditor/utils/tests/test_start_running_query.py
@@ -8,8 +8,8 @@
 ##########################################################################
 import sys

 

 
         try:
index 379ef755..37d32cee 100644
@@ -7,13 +7,14 @@
 #
 ##############################################################
 
-import traceback
 import sys
+import traceback
 from abc import ABCMeta, abstractmethod
 from importlib import import_module
-from werkzeug.utils import find_modules
-import config
+
 import six
+from werkzeug.utils import find_modules
+from pgadmin.utils import server_utils
 
 if sys.version_info < (2, 7):
     import unittest2 as unittest
@@ -67,9 +68,9 @@ class TestsGeneratorRegistry(ABCMeta):
         for module_name in all_modules:
             try:
                 if "tests." in str(module_name) and not any(
-                        str(module_name).startswith(
-                            'pgadmin.' + str(exclude_pkg)
-                        ) for exclude_pkg in exclude_pkgs
+                    str(module_name).startswith(
+                        'pgadmin.' + str(exclude_pkg)
+                    ) for exclude_pkg in exclude_pkgs
                 ):
                     import_module(module_name)
             except ImportError:
@@ -80,6 +81,15 @@ class TestsGeneratorRegistry(ABCMeta):
 class BaseTestGenerator(unittest.TestCase):
     # Defining abstract method which will override by individual testcase.
 
+    def setUp(self):
+        super(BaseTestGenerator, self).setUp()
+        self.server_id = self.server_information["server_id"]
+        server_con = server_utils.connect_server(self, self.server_id)
+        if hasattr(self, 'skip_on_database'):
+            if 'data' in server_con and 'type' in server_con['data']:
+                if server_con['data']['type'] in self.skip_on_database:
+                    self.skipTest('cannot run in: %s' % self.server['db_type'])
+
     @classmethod
     def setTestServer(cls, server):
         cls.server = server
@@ -100,3 +110,7 @@ class BaseTestGenerator(unittest.TestCase):
     @classmethod
     def setDriver(cls, driver):
         cls.driver = driver
+
+    @classmethod
+    def setServerInformation(cls, server_information):
+        cls.server_information = server_information
diff --git a/web/pgadmin/browser/server_groups/servers/tests/utils.py b/web/pgadmin/utils/server_utils.py
similarity index 88%
rename from web/pgadmin/browser/server_groups/servers/tests/utils.py
rename to web/pgadmin/utils/server_utils.py
index ba198526..fa657878 100644
--- a/web/pgadmin/browser/server_groups/servers/tests/utils.py
+++ b/web/pgadmin/utils/server_utils.py
@@ -11,10 +11,9 @@ from __future__ import print_function
 
 import json
 
-from regression.python_test_utils import test_utils as utils
-
 SERVER_URL = '/browser/server/obj/'
 SERVER_CONNECT_URL = '/browser/server/connect/'
+DUMMY_SERVER_GROUP = 10000

 def connect_server(self, server_id):
@@ -25,7 +24,7 @@ def connect_server(self, server_id):
     :param server_id: server id
     :type server_id: str
     """
-    response = self.tester.post(SERVER_CONNECT_URL + str(utils.SERVER_GROUP) +
+    response = self.tester.post(SERVER_CONNECT_URL + str(DUMMY_SERVER_GROUP) +
                                 '/' + str(server_id),
                                 data=dict(password=self.server['db_password']),
                                 follow_redirects=True)
diff --git a/web/regression/python_test_utils/test_utils.py b/web/regression/python_test_utils/test_utils.py
index c11853fb..3e517b61 100644
--- a/web/regression/python_test_utils/test_utils.py
+++ b/web/regression/python_test_utils/test_utils.py
@@ -46,7 +46,7 @@ def login_tester_account(tester):
     :return: None
     """
     if os.environ['PGADMIN_SETUP_EMAIL'] and \
-            os.environ['PGADMIN_SETUP_PASSWORD']:
+       os.environ['PGADMIN_SETUP_PASSWORD']:
         email = os.environ['PGADMIN_SETUP_EMAIL']
         password = os.environ['PGADMIN_SETUP_PASSWORD']
         tester.post('/login', data=dict(email=email, password=password),
@@ -88,6 +88,8 @@ def get_config_data():
                 "sslmode": srv['sslmode'],
                 "tablespace_path": srv.get('tablespace_path', None)
             }
+            if 'db_type' in srv:
+                data['db_type'] = srv['db_type']
             server_data.append(data)
     return server_data
 
@@ -220,9 +222,11 @@ def create_table_with_query(server, db_name, query):
         traceback.print_exc(file=sys.stderr)

-def create_constraint(
-        server, db_name, table_name,
-        constraint_type="unique", constraint_name="test_unique"):
+def create_constraint(server,
+                      db_name,
+                      table_name,
+                      constraint_type="unique",
+                      constraint_name="test_unique"):
     try:
         connection = get_db_connection(
             db_name,
@@ -275,8 +279,7 @@ def create_debug_function(server, db_name, function_name="test_func"):
                 RETURN 'Hello, pgAdmin4';
               END;
             $function$;
-            ''' % (function_name)
-        )
+            ''' % function_name)
         connection.set_isolation_level(old_isolation_level)
         connection.commit()
 
@@ -299,8 +302,7 @@ def drop_debug_function(server, db_name, function_name="test_func"):
         pg_cursor = connection.cursor()
         pg_cursor.execute('''
             DROP FUNCTION public."%s"();
-            ''' % (function_name)
-        )
+            ''' % function_name)
         connection.set_isolation_level(old_isolation_level)
         connection.commit()
 
@@ -357,8 +359,7 @@ def drop_role(server, db_name, role_name="test_role"):
         pg_cursor = connection.cursor()
         pg_cursor.execute('''
             DROP USER "%s"
-            ''' % (role_name)
-        )
+            ''' % role_name)
         connection.set_isolation_level(old_isolation_level)
         connection.commit()
 
@@ -459,12 +460,11 @@ def add_db_to_parent_node_dict(srv_id, db_id, test_db_name):
 
 def add_schema_to_parent_node_dict(srv_id, db_id, schema_id, schema_name):
     """ This function stores the schema details into parent dict """
-    regression.parent_node_dict["schema"].append({
-        "server_id": srv_id,
-        "db_id": db_id,
-        "schema_id": schema_id,
-        "schema_name": schema_name
-    })
+    server_information = {"server_id": srv_id, "db_id": db_id,
+                          "schema_id": schema_id,
+                          "schema_name": schema_name}
+    regression.parent_node_dict["schema"].append(server_information)
+    return server_information

 def create_parent_server_node(server_info):
@@ -492,7 +492,7 @@ def create_parent_server_node(server_info):
     )
 
     schema = regression.schema_utils.create_schema(connection, schema_name)
-    add_schema_to_parent_node_dict(
+    return add_schema_to_parent_node_dict(
         srv_id, db_id, schema[0], schema[1]
     )
 
@@ -770,7 +770,7 @@ def get_timezone_without_dst(connection):
     """
 
     timezone_no_dst_sql = """SELECT EXTRACT(
-        TIMEZONE FROM '2017-01-01 00:00:00'::timestamp with time zone);"""
+        TIMEZONE FROM '2017-01-01 00:00:00'::TIMESTAMP WITH TIME ZONE);"""

diff --git a/web/regression/runtests.py b/web/regression/runtests.py
index 9ff18118..6ffcbd08 100644
--- a/web/regression/runtests.py
+++ b/web/regression/runtests.py
@@ -120,10 +120,11 @@ unit_test.runner.TextTestResult.addSuccess = test_utils.add_success
 scenarios.apply_scenario = test_utils.apply_scenario

-def get_suite(module_list, test_server, test_app_client):
+def get_suite(module_list, test_server, test_app_client, server_information):
     """
      This function add the tests to test suite and return modified test suite
       variable.
+    :param server_information:
     :param module_list: test module list
     :type module_list: list
     :param test_server: server details
@@ -148,6 +149,7 @@ def get_suite(module_list, test_server, test_app_client):
         obj.setTestClient(test_app_client)
         obj.setTestServer(test_server)
         obj.setDriver(driver)
+        obj.setServerInformation(server_information)
         scenario = scenarios.generate_scenarios(obj)
         pgadmin_suite.addTests(scenario)
 
@@ -344,9 +346,12 @@ if __name__ == '__main__':
             print("\n=============Running the test cases for '%s'============="
                   % server['name'], file=sys.stderr)
             # Create test server
-            test_utils.create_parent_server_node(server)
+            server_information = test_utils.create_parent_server_node(server)
 
-            suite = get_suite(test_module_list, server, test_client)
+            suite = get_suite(test_module_list,
+                              server,
+                              test_client,
+                              server_information)
             tests = unit_test.TextTestRunner(stream=sys.stderr,
                                              descriptions=True,
                                              verbosity=2).run(suite)
diff --git a/web/regression/test_config.json.in b/web/regression/test_config.json.in
index a373dee3..e69acdd5 100644
--- a/web/regression/test_config.json.in
+++ b/web/regression/test_config.json.in
@@ -21,7 +21,8 @@
       "maintenance_db": "postgres",
       "sslmode": "prefer",
       "tablespace_path": "",
-      "enabled": true
+      "enabled": true,
+      "db_type": "pg"
     }
   ],
   "server_update_data": [
@@ -29,4 +30,4 @@
       "comment": "This is test update comment"
     }
   ]
-}
\ No newline at end of file
+}

---

From: Dave Page <[email-masked]>
Date: Tue, 13 Mar 2018 15:32:48 -0400

Thanks, applied.

On Tue, Mar 13, 2018 at 2:19 PM, Joao De Almeida Pereira <
[email-masked]> wrote:

>>>>> Attached you can find the patch that skip some tests and correct
>>>>> issues on SQL that are failing when trying to connect to a GreenPlum
>>>>> database.
>>>>>
>>>>> We did this by adding a attribute to to test_json called "db_type"
>>>>> that will carry the type of database we are running tests against.
>>>>>
>>>>