diff --git a/docs/en_US/images/subscription_with.png b/docs/en_US/images/subscription_with.png
index 8933ff150aa79a0fe217743558abb7cd96d86377..2e007dce0792b52b0798daade6fc808b0c472ddc 100644
GIT binary patch
diff --git a/web/pgadmin/browser/server_groups/servers/__init__.py b/web/pgadmin/browser/server_groups/servers/__init__.py
index 2f22caf57..13a7e06b9 100644
--- a/web/pgadmin/browser/server_groups/servers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/__init__.py
@@ -245,6 +245,7 @@ class ServerModule(sg.ServerGroupPluginModule):
                 in_recovery=in_recovery,
                 wal_pause=wal_paused,
                 host=server.host,
+                port=server.port,
                 is_password_saved=bool(server.save_password),
                 is_tunnel_password_saved=True
                 if server.tunnel_password is not None else False,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py
index 48cc1a1ad..94a2461bc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py
@@ -195,7 +195,7 @@ class SubscriptionView(PGChildNodeView, SchemaDiffObjectCompare):
         'nodes': [{'get': 'node'}, {'get': 'nodes'}],
         'sql': [{'get': 'sql'}],
         'msql': [{'get': 'msql'}, {'get': 'msql'}],
-        'stats': [{'get': 'statistics'}],
+        'stats': [{'get': 'statistics'}, {'get': 'statistics'}],
         'dependency': [{'get': 'dependencies'}],
         'dependent': [{'get': 'dependents'}],
         'get_publications': [{}, {'get': 'get_publications'}],
@@ -261,11 +261,6 @@ class SubscriptionView(PGChildNodeView, SchemaDiffObjectCompare):
                                         self._PROPERTIES_SQL]), did=did)
         status, res = self.conn.execute_dict(sql)
 
-        # Check for permission denied message
-        if 'permission denied' in res:
-            return internal_server_error(
-                errormsg="Access is revoked for normal users")
-
         if not status:
             return internal_server_error(errormsg=res)
 
@@ -386,7 +381,7 @@ class SubscriptionView(PGChildNodeView, SchemaDiffObjectCompare):
         return True, res['rows'][0]
 
     @check_precondition
-    def statistics(self, gid, sid, did, subid):
+    def statistics(self, gid, sid, did, subid=None):
         """
         This function gets the statistics and returns an ajax response
         for the view node.
@@ -399,7 +394,7 @@ class SubscriptionView(PGChildNodeView, SchemaDiffObjectCompare):
         """
         sql = render_template("/".join([self.template_path,
                                         'stats.sql']),
-                              subid=subid, conn=self.conn)
+                              subid=subid, did=did, conn=self.conn)
         status, res = self.conn.execute_dict(sql)
         return make_json_response(
             data=res,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.js b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.js
index 78b530771..7227991db 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.js
@@ -396,8 +396,8 @@ define('pgadmin.node.subscription', [
           type: 'switch', mode: ['create'],
           group: gettext('With'),
           disabled: 'isSameDB',
-          readonly: 'isConnect', deps :['connect', 'host'],
-          helpMessage: gettext('Specifies whether the command should create the replication slot on the publisher.'),
+          readonly: 'isConnect', deps :['connect', 'host', 'port'],
+          helpMessage: gettext('Specifies whether the command should create the replication slot on the publisher.This field will be disabled and set to false if subscription connects to same database.Otherwise, the CREATE SUBSCRIPTION call will hang.'),
 
         },
         {
@@ -456,7 +456,14 @@ define('pgadmin.node.subscription', [
           return true;
         },
         isSameDB:function(m){
-          if (m.attributes['host'] == m.node_info.server.host){
+          let host = m.attributes['host'],
+            port = m.attributes['port'];
+
+          if ((m.attributes['host'] == 'localhost' || m.attributes['host'] == '127.0.0.1') &&
+              (m.node_info.server.host == 'localhost' || m.node_info.server.host == '127.0.0.1')){
+            host = m.node_info.server.host;
+          }
+          if (host == m.node_info.server.host && port == m.node_info.server.port){
             setTimeout( function() {
               m.set('create_slot', false);
             }, 10);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/stats.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/stats.sql
index 4c9071969..4da991441 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/stats.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/stats.sql
@@ -4,5 +4,8 @@ SELECT
     latest_end_lsn AS {{ conn|qtIdent(_('Latest end lsn')) }},
     last_msg_receipt_time AS {{ conn|qtIdent(_('Last message receipt')) }},
     last_msg_send_time AS {{ conn|qtIdent(_('Last message send time'))}}
-FROM pg_stat_subscription WHERE subid = {{ subid }};
+FROM pg_stat_subscription
+{% if subid %}
+    WHERE subid = {{ subid }};
+{% endif %}
 
diff --git a/web/pgadmin/browser/static/js/collection.js b/web/pgadmin/browser/static/js/collection.js
index 14020af78..3db517438 100644
--- a/web/pgadmin/browser/static/js/collection.js
+++ b/web/pgadmin/browser/static/js/collection.js
@@ -287,7 +287,8 @@ define([
               timer = setTimeout(function() {
                 // notify user if request is taking longer than 1 second
 
-                $msgContainer.text(gettext('Retrieving data from the server...'));
+                if (!$msgContainer.text()== 'Failed to retrieve data from the server.')
+                  $msgContainer.text(gettext('Retrieving data from the server...'));
                 $msgContainer.removeClass('d-none');
                 if (self.grid) {
                   self.grid.remove();
