diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
index cdf272653..dd5fd7f1a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/create.sql
@@ -24,7 +24,7 @@ CREATE FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}(
 {% if data.owner %}
 
 ALTER FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif -%}
 {% if data.description %}
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
index 8f30a59e9..eedbd338e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql
@@ -12,7 +12,7 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, o_data.name) }}
 {% endif -%}
 {% if data.owner %}
 ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 
 {% endif -%}
 {% if data.columns %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
index 6a25dfe9d..b71dd286a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/create.sql
@@ -33,7 +33,7 @@ CREATE FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}(
 {% if data.owner %}
 
 ALTER FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif -%}
 {% if data.constraints %}
 {% for c in data.constraints %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/foreign_table_schema_diff.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/foreign_table_schema_diff.sql
index aa5b95a6d..ae221355e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/foreign_table_schema_diff.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/foreign_table_schema_diff.sql
@@ -42,7 +42,7 @@ CREATE FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, o_data.name) }}(
 {% if data.owner %}
 
 ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, o_data.name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif -%}
 {% if constraints %}
 {% for c in constraints %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql
index 2dc1f9b02..c84bd3781 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql
@@ -10,7 +10,7 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, o_data.name) }}
 {% endif %}{% endif %}
 {% if data.owner %}
 ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 
 {% endif %}
 {% if data.columns %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/create.sql
index 90a8a5978..e34638db1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/create.sql
@@ -18,7 +18,7 @@ CREATE FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}(
 {% if data.owner %}
 
 ALTER FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif -%}
 {% if data.description %}
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/update.sql
index 298419356..a21034e5c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/update.sql
@@ -12,7 +12,7 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, o_data.name) }}
 {% if data.owner %}
 
 ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
-    OWNER TO {{ data.owner }};
+    OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif -%}
 
 {% if data.columns %}
