diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/casts/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/casts/sql/default/delete.sql
index 96d62510..8d5af16c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/templates/casts/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/templates/casts/sql/default/delete.sql
@@ -10,5 +10,5 @@ WHERE
 {% endif %}
 {# DROP CAST Statement #}
 {% if castsource and casttarget %}
-DROP CAST ({{castsource}} AS {{casttarget}}) {% if cascade %}CASCADE{%endif%};
+DROP CAST IF EXISTS ({{castsource}} AS {{casttarget}}) {% if cascade %}CASCADE{%endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/create.sql
index 139dc9db..037235a2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/create.sql
@@ -7,7 +7,7 @@
 
 {% endif %}
 {% if data.name %}
-CREATE EXTENSION {{ conn|qtIdent(data.name) }}{% if data.schema == '' and data.version == '' %};{% endif %}
+CREATE EXTENSION IF NOT EXISTS {{ conn|qtIdent(data.name) }}{% if data.schema == '' and data.version == '' %};{% endif %}
 {% if data.schema %}
 
     SCHEMA {{ conn|qtIdent(data.schema) }}{% if data.version == '' %};{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/delete.sql
index 8bd90152..b6767497 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/templates/extensions/sql/delete.sql
@@ -4,5 +4,5 @@ SELECT x.extname from pg_catalog.pg_extension x
     WHERE x.oid = {{ eid }}::oid
 {% endif %}
 {% if name %}
-DROP EXTENSION {{ conn|qtIdent(name) }}{% if cascade %} CASCADE{% endif %};
+DROP EXTENSION IF EXISTS {{ conn|qtIdent(name) }}{% if cascade %} CASCADE{% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_schema.sql
index 151ead41..a10200db 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_schema.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION sslinfo;
 
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA public
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_version.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_version.sql
index 96c5bf40..eb160b99 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_version.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/alter_extension_version.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION citext;
 
-CREATE EXTENSION citext
+CREATE EXTENSION IF NOT EXISTS citext
     SCHEMA public
     VERSION "1.1";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_all_options.sql
index b7492944..93acdedf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_all_options.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION sslinfo;
 
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA test_extension_schema
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_default_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_default_schema.sql
index aab2fa80..30f3adea 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_default_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/create_extension_with_default_schema.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION citext;
 
-CREATE EXTENSION citext
+CREATE EXTENSION IF NOT EXISTS citext
     SCHEMA public
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_all_options.sql
index 108c1e11..0a341809 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_all_options.sql
@@ -1,3 +1,3 @@
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA test_extension_schema
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_default_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_default_schema.sql
index 97082266..a936f441 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_default_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.4_plus/msql_create_extension_with_default_schema.sql
@@ -1,2 +1,2 @@
-CREATE EXTENSION citext
+CREATE EXTENSION IF NOT EXISTS citext
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/alter_extension_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/alter_extension_schema.sql
index 151ead41..a10200db 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/alter_extension_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/alter_extension_schema.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION sslinfo;
 
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA public
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/create_extension_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/create_extension_with_all_options.sql
index b7492944..93acdedf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/create_extension_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/create_extension_with_all_options.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION sslinfo;
 
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA test_extension_schema
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/msql_create_extension_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/msql_create_extension_with_all_options.sql
index 108c1e11..0a341809 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/msql_create_extension_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.5_plus/msql_create_extension_with_all_options.sql
@@ -1,3 +1,3 @@
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA test_extension_schema
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_schema.sql
index 37c620c4..9b9baf3a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_schema.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION sslinfo;
 
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA public
     VERSION "1.2";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_version.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_version.sql
index 6d193fb8..21b3f601 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_version.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/alter_extension_version.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION adminpack;
 
-CREATE EXTENSION adminpack
+CREATE EXTENSION IF NOT EXISTS adminpack
     SCHEMA pg_catalog
     VERSION "1.1";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_all_options.sql
index fc8fc10a..2e34e9f0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_all_options.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION sslinfo;
 
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA test_extension_schema
     VERSION "1.2";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_default_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_default_schema.sql
index a9a61d41..a1fdfe82 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_default_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/create_extension_with_default_schema.sql
@@ -2,6 +2,6 @@
 
 -- DROP EXTENSION adminpack;
 
-CREATE EXTENSION adminpack
+CREATE EXTENSION IF NOT EXISTS adminpack
     SCHEMA pg_catalog
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_all_options.sql
index 68217d76..d584542e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_all_options.sql
@@ -1,3 +1,3 @@
-CREATE EXTENSION sslinfo
+CREATE EXTENSION IF NOT EXISTS sslinfo
     SCHEMA test_extension_schema
     VERSION "1.2";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_default_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_default_schema.sql
index 02c109f1..ed8cadf3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_default_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/extensions/tests/9.6_plus/msql_create_extension_with_default_schema.sql
@@ -1,2 +1,2 @@
-CREATE EXTENSION adminpack
+CREATE EXTENSION IF NOT EXISTS adminpack
     VERSION "1.0";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/templates/foreign_data_wrappers/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/templates/foreign_data_wrappers/sql/default/delete.sql
index 923da156..a87b4d0a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/templates/foreign_data_wrappers/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/templates/foreign_data_wrappers/sql/default/delete.sql
@@ -4,5 +4,5 @@ SELECT fdwname as name from pg_catalog.pg_foreign_data_wrapper WHERE oid={{fid}}
 {% endif %}
 {# ============= Delete/Drop cascade foreign data wrapper ============= #}
 {% if name %}
-DROP FOREIGN DATA WRAPPER {{ conn|qtIdent(name) }} {% if cascade %} CASCADE {% endif %};
+DROP FOREIGN DATA WRAPPER IF EXISTS {{ conn|qtIdent(name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/default/delete.sql
index 4b46de0e..7578383b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/languages/templates/languages/sql/default/delete.sql
@@ -4,5 +4,5 @@
 {% endif %}
 {# ============= Drop the language ============= #}
 {% if lname %}
-DROP LANGUAGE {{ conn|qtIdent(lname) }}{% if cascade %} CASCADE{% endif%};
+DROP LANGUAGE IF EXISTS {{ conn|qtIdent(lname) }}{% if cascade %} CASCADE{% endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/templates/publications/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/templates/publications/sql/default/delete.sql
index ef8b9a89..3b7af076 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/templates/publications/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/templates/publications/sql/default/delete.sql
@@ -4,5 +4,5 @@ SELECT pubname FROM pg_catalog.pg_publication WHERE oid = {{pbid}}::oid;
 {% endif %}
 {# ============= Drop the publication ============= #}
 {% if pname %}
-DROP PUBLICATION {{ conn|qtIdent(pname) }}{% if cascade %} CASCADE{% endif%};
+DROP PUBLICATION IF EXISTS {{ conn|qtIdent(pname) }}{% if cascade %} CASCADE{% endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication.sql
index f7e10033..e22d11dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication.sql
@@ -1,6 +1,6 @@
 -- Publication: alterd_publication
 
--- DROP PUBLICATION alterd_publication;
+-- DROP PUBLICATION IF EXISTS alterd_publication;
 
 CREATE PUBLICATION alterd_publication
     FOR ALL TABLES
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication_event.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication_event.sql
index dc9016c0..e914afca 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication_event.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/alter_publication_event.sql
@@ -1,6 +1,6 @@
 -- Publication: alterd_publication
 
--- DROP PUBLICATION alterd_publication;
+-- DROP PUBLICATION IF EXISTS alterd_publication;
 
 CREATE PUBLICATION alterd_publication
     FOR ALL TABLES
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/create_publication.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/create_publication.sql
index ea47c867..b5d88dec 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/create_publication.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/10_plus/create_publication.sql
@@ -1,6 +1,6 @@
 -- Publication: test_publication_create
 
--- DROP PUBLICATION test_publication_create;
+-- DROP PUBLICATION IF EXISTS test_publication_create;
 
 CREATE PUBLICATION test_publication_create
     FOR ALL TABLES
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication.sql
index 4f1defa5..90cd91e0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication.sql
@@ -1,6 +1,6 @@
 -- Publication: alterd_publication
 
--- DROP PUBLICATION alterd_publication;
+-- DROP PUBLICATION IF EXISTS alterd_publication;
 
 CREATE PUBLICATION alterd_publication
     FOR ALL TABLES
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication_event.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication_event.sql
index a870d5c2..10b089fe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication_event.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/alter_publication_event.sql
@@ -1,6 +1,6 @@
 -- Publication: alterd_publication
 
--- DROP PUBLICATION alterd_publication;
+-- DROP PUBLICATION IF EXISTS alterd_publication;
 
 CREATE PUBLICATION alterd_publication
     FOR ALL TABLES
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/create_publication.sql b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/create_publication.sql
index 26f29fc4..8c087442 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/create_publication.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/tests/13_plus/create_publication.sql
@@ -1,6 +1,6 @@
 -- Publication: test_publication_create
 
--- DROP PUBLICATION test_publication_create;
+-- DROP PUBLICATION IF EXISTS test_publication_create;
 
 CREATE PUBLICATION test_publication_create
     FOR ALL TABLES
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collations/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collations/sql/default/delete.sql
index bbca449f..958885c7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collations/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/templates/collations/sql/default/delete.sql
@@ -1 +1 @@
-DROP COLLATION {{ conn|qtIdent(nspname, name) }}{% if cascade%} CASCADE{% endif %};
+DROP COLLATION IF EXISTS {{ conn|qtIdent(nspname, name) }}{% if cascade%} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/alter_collation.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/alter_collation.sql
index c1f9dace..1b6b0c8f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/alter_collation.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/alter_collation.sql
@@ -1,6 +1,6 @@
 -- Collation: Cl1_$%{}[]()&*^!@"'`\/#a;
 
--- DROP COLLATION testschema."Cl1_$%{}[]()&*^!@""'`\/#a";
+-- DROP COLLATION IF EXISTS testschema."Cl1_$%{}[]()&*^!@""'`\/#a";
 
 CREATE COLLATION testschema."Cl1_$%{}[]()&*^!@""'`\/#a"
     (LC_COLLATE = 'C', LC_CTYPE = 'C');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/create_collation.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/create_collation.sql
index 9d44cddc..8cd07121 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/create_collation.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/tests/default/create_collation.sql
@@ -1,6 +1,6 @@
 -- Collation: Cl1_$%{}[]()&*^!@"'`\/#;
 
--- DROP COLLATION testschema."Cl1_$%{}[]()&*^!@""'`\/#";
+-- DROP COLLATION IF EXISTS testschema."Cl1_$%{}[]()&*^!@""'`\/#";
 
 CREATE COLLATION testschema."Cl1_$%{}[]()&*^!@""'`\/#"
     (LC_COLLATE = 'C', LC_CTYPE = 'C');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/default/delete.sql
index 65d4a468..55edb00d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/sql/default/delete.sql
@@ -12,5 +12,5 @@ AND
 {% endif %}
 
 {% if name %}
-DROP DOMAIN {{ conn|qtIdent(basensp, name) }}{% if cascade %} CASCADE{% endif %};
+DROP DOMAIN IF EXISTS {{ conn|qtIdent(basensp, name) }}{% if cascade %} CASCADE{% endif %};
 {% endif %}
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 b71dd286..f0a5a501 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
@@ -2,7 +2,7 @@
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% set is_columns = [] %}
 {% if data %}
-CREATE FOREIGN TABLE {{ conn|qtIdent(data.basensp, data.name) }}(
+CREATE FOREIGN TABLE IF NOT EXISTS {{ conn|qtIdent(data.basensp, data.name) }}(
 {% if data.columns %}
 {% for c in data.columns %}
 {% if (not c.inheritedfrom or c.inheritedfrom =='' or  c.inheritedfrom == None or  c.inheritedfrom == 'None' ) %}
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 c84bd378..24ea674b 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
@@ -3,27 +3,27 @@
 {% if data %}
 {% set name = o_data.name %}
 {% if data.name %}{% if data.name != o_data.name %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, o_data.name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, o_data.name) }}
     RENAME TO {{ conn|qtIdent(data.name) }};
 
 {% set name = data.name %}
 {% endif %}{% endif %}
 {% if data.owner %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 
 {% endif %}
 {% if data.columns %}
 {% for c in data.columns.deleted %}
 {% if (not c.inheritedfrom or c.inheritedfrom =='' or  c.inheritedfrom == None or  c.inheritedfrom == 'None' ) %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     DROP COLUMN {{conn|qtIdent(c.attname)}};
 
 {% endif %}
 {% endfor -%}
 {% for c in data.columns.added %}
 {% if (not c.inheritedfrom or c.inheritedfrom =='' or  c.inheritedfrom == None or  c.inheritedfrom == 'None' ) %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ADD COLUMN {{conn|qtIdent(c.attname)}} {{ c.datatype }}{% if c.typlen %}({{c.typlen}}{% if c.precision %}, {{c.precision}}{% endif %}){% endif %}{% if c.isArrayType %}[]{% endif %}
 {% if c.coloptions %}
 {% for o in c.coloptions %}{% if o.option and o.value %}
@@ -39,18 +39,18 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 {% set col_name = o_data['columns'][c.attnum]['attname'] %}
 {% if c.attname != o_data['columns'][c.attnum]['attname'] %}
 {% set col_name = c.attname %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     RENAME COLUMN {{conn|qtIdent(o_data['columns'][c.attnum]['attname'])}} TO {{conn|qtIdent(c.attname)}};
 
 {% endif %}
 {% if c.attnotnull != o_data['columns'][c.attnum]['attnotnull'] %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ALTER COLUMN {{conn|qtIdent(col_name)}}{% if c.attnotnull %} SET{% else %} DROP{% endif %} NOT NULL;
 
 {% endif %}
 {% if c.datatype != o_data['columns'][c.attnum]['datatype'] or c.typlen != o_data['columns'][c.attnum]['typlen'] or
 c.precision != o_data['columns'][c.attnum]['precision'] %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ALTER COLUMN {{conn|qtIdent(col_name)}} TYPE {{ c.datatype }}{% if c.typlen %}({{c.typlen}}{% if c.precision %}, {{c.precision}}{% endif %}){% endif %}{% if c.isArrayType %}[]{% endif %};
 
 {% endif %}
@@ -60,26 +60,26 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 
 {% endif %}
 {% if c.attstattarget != o_data['columns'][c.attnum]['attstattarget'] %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ALTER COLUMN {{conn|qtIdent(col_name)}} SET STATISTICS {% if c.attstattarget %}{{c.attstattarget}}{% else %}-1{% endif %};
 
 {% endif %}
 {% if c.coloptions_updated %}
 {% for o in c.coloptions_updated.deleted %}
 {% if o.option %}
-{% if loop.first %}ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+{% if loop.first %}ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ALTER COLUMN {{conn|qtIdent(col_name)}} OPTIONS (DROP {% endif %}{% if not loop.first %}, {% endif %}{{o.option}}{% if loop.last %}){% endif %};
 {% endif %}
 {% endfor %}
 {% for o in c.coloptions_updated.added %}
 {% if o.option and o.value %}
-{% if loop.first %}ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+{% if loop.first %}ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ALTER COLUMN {{conn|qtIdent(col_name)}} OPTIONS (ADD {% endif %}{% if not loop.first %}, {% endif %}{{o.option}} {{o.value|qtLiteral}}{% if loop.last %});{% endif %}
 {% endif %}
 {% endfor %}
 {% for o in c.coloptions_updated.changed %}
 {% if o.option and o.value %}
-{% if loop.first %}ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+{% if loop.first %}ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ALTER COLUMN {{conn|qtIdent(col_name)}} OPTIONS (SET {% endif %}{% if not loop.first %}, {% endif %}{{o.option}} {{o.value|qtLiteral}}{% if loop.last %});{% endif %}
 {% endif %}
 {% endfor %}
@@ -94,7 +94,7 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 {% endif %}
 {% for i in data.inherits %}
 {% if i not in inherits %}{% if i %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }} INHERIT {{i}};
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }} INHERIT {{i}};
 {% endif %}
 {% endif %}
 {% endfor %}
@@ -106,34 +106,34 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }} INHERIT {{i}};
 {% set inherits = data.inherits %}
 {% endif %}
 {% for i in o_data.inherits %}{% if i not in inherits %}{% if i %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }} NO INHERIT {{i}};{% endif %}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }} NO INHERIT {{i}};{% endif %}
 {% endif %}
 {% endfor %}
 {% endif %}
 {% if data.constraints %}
 {% for c in data.constraints.deleted %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     DROP CONSTRAINT {{conn|qtIdent(c.conname)}};
 
 {% endfor -%}
 {% for c in data.constraints.added %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ADD CONSTRAINT {{ conn|qtIdent(c.conname) }} CHECK ({{ c.consrc }}){% if not c.convalidated %} NOT VALID{% endif %}{% if c.connoinherit %} NO INHERIT{% endif %};
 
 {% endfor %}
 {% if data.is_schema_diff is defined and data.is_schema_diff %}
 {% for c in data.constraints.changed %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     DROP CONSTRAINT {{conn|qtIdent(c.conname)}};
 
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     ADD CONSTRAINT {{ conn|qtIdent(c.conname) }} CHECK ({{ c.consrc }}){% if not c.convalidated %} NOT VALID{% endif %}{% if c.connoinherit %} NO INHERIT{% endif %};
 
 {% endfor %}
 {% else %}
 {% for c in data.constraints.changed %}
 {% if c.convalidated %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     VALIDATE CONSTRAINT {{ conn|qtIdent(c.conname) }};
 
 {% endif %}
@@ -143,21 +143,21 @@ ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 {% if data.ftoptions %}
 {% for o in data.ftoptions.deleted %}
 {% if o.option and o.value %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     OPTIONS ( DROP {{o.option}});
 
 {% endif %}
 {% endfor %}
 {% for o in data.ftoptions.added %}
 {% if o.option and o.value %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     OPTIONS (ADD {{o.option}} {{o.value|qtLiteral}});
 
 {% endif %}
 {% endfor %}
 {% for o in data.ftoptions.changed %}
 {% if o.option and o.value %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     OPTIONS (SET {{o.option}} {{o.value|qtLiteral}});
 
 {% endif %}
@@ -210,7 +210,7 @@ COMMENT ON FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
 {% endif %}
 {% endif -%}
 {% if data.basensp %}
-ALTER FOREIGN TABLE {{ conn|qtIdent(o_data.basensp, name) }}
+ALTER FOREIGN TABLE IF EXISTS {{ conn|qtIdent(o_data.basensp, name) }}
     SET SCHEMA {{ conn|qtIdent(data.basensp) }};
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts.sql
index 3b0ee44d..9342f5f2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts_msql.sql
index 1160cd6b..44f29ca9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_cons_opts_msql.sql
@@ -1,8 +1,8 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT cons1 CHECK (true) NO INHERIT;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS (ADD schema_name 'public');
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS (ADD table_name 'test_table');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_priv.sql
index 8526755e..4a049699 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_add_priv.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts.sql
index 28b17ffa..68b09303 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 integer NULL
 )
     SERVER test_fs_for_foreign_table
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts_msql.sql
index cdb8a27d..095712f7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_col_opts_msql.sql
@@ -1,14 +1,14 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     DROP COLUMN col2;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 DROP NOT NULL;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 TYPE integer;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 SET STATISTICS -1;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS (SET schema_name 'test_public');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns.sql
index 0725bb2d..5478d7cd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns_msql.sql
index 9041626b..50879691 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_comment_add_columns_msql.sql
@@ -1,7 +1,7 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN col1 bigint NULL;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN col2 text NULL;
 
 COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons.sql
index aeb1c8a4..309c4eff 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 integer NULL
 )
     SERVER test_fs_for_foreign_table
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons_msql.sql
index 007e93bc..e2443562 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/alter_remove_opts_priv_cons_msql.sql
@@ -1,7 +1,7 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     DROP CONSTRAINT cons1;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS ( DROP schema_name);
 
 REVOKE ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" FROM PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options.sql
index dd9e71ca..a05eec23 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options_msql.sql
index 13494a79..de737918 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/pg/9.6_plus/create_foreign_table_with_all_options_msql.sql
@@ -1,4 +1,4 @@
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_add_priv.sql
index 03b77cd2..68c1605b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_add_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_add_priv.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default",
     col3 bigint NULL,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns.sql
index 4c0ce3e7..d4c5af24 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default",
     col3 bigint NULL,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns_msql.sql
index b1715635..9c068060 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/alter_comment_add_columns_msql.sql
@@ -1,7 +1,7 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN col3 bigint NULL;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN col4 text NULL;
 
 COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options.sql
index 7ace11fb..215640b8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options_msql.sql
index 20409f9b..a532ed22 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.2_plus/create_foreign_table_with_all_options_msql.sql
@@ -1,4 +1,4 @@
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts.sql
index c101ee89..6730d3b4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts_msql.sql
index 1160cd6b..44f29ca9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_cons_opts_msql.sql
@@ -1,8 +1,8 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT cons1 CHECK (true) NO INHERIT;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS (ADD schema_name 'public');
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS (ADD table_name 'test_table');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_priv.sql
index 3dc50a1f..5da2cd09 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_add_priv.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts.sql
index 110f6d9a..4f7127d6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 integer NULL
 )
     SERVER test_fs_for_foreign_table
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts_msql.sql
index cdb8a27d..095712f7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_col_opts_msql.sql
@@ -1,14 +1,14 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     DROP COLUMN col2;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 DROP NOT NULL;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 TYPE integer;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 SET STATISTICS -1;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS (SET schema_name 'test_public');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns.sql
index 690e5cfe..323cbabc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns_msql.sql
index 9041626b..50879691 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_comment_add_columns_msql.sql
@@ -1,7 +1,7 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN col1 bigint NULL;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN col2 text NULL;
 
 COMMENT ON FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons.sql
index 2145493a..e39a1e6b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 integer NULL
 )
     SERVER test_fs_for_foreign_table
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons_msql.sql
index 007e93bc..e2443562 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/alter_remove_opts_priv_cons_msql.sql
@@ -1,7 +1,7 @@
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     DROP CONSTRAINT cons1;
 
-ALTER FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"
+ALTER FOREIGN TABLE IF EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"
     OPTIONS ( DROP schema_name);
 
 REVOKE ALL ON TABLE public."FT1_$%{}[]()&*^!@""'`\/#" FROM PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options.sql
index 8ef7c085..161eaa89 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options.sql
@@ -2,7 +2,7 @@
 
 -- DROP FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#";
 
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL COLLATE pg_catalog."default"
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options_msql.sql
index dd1f2543..f7c80113 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/tests/ppas/9.6_plus/create_foreign_table_with_all_options_msql.sql
@@ -1,4 +1,4 @@
-CREATE FOREIGN TABLE public."FT1_$%{}[]()&*^!@""'`\/#"(
+CREATE FOREIGN TABLE IF NOT EXISTS public."FT1_$%{}[]()&*^!@""'`\/#"(
     col1 bigint NULL,
     col2 text NULL
 )
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configurations/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configurations/sql/default/delete.sql
index 0052f617..2108ce9c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configurations/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/templates/fts_configurations/sql/default/delete.sql
@@ -1,4 +1,4 @@
 {# DROP FTS CONFIGURATION Statement #}
 {% if schema and name %}
-DROP TEXT SEARCH CONFIGURATION {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
-{% endif %}
\ No newline at end of file
+DROP TEXT SEARCH CONFIGURATION IF EXISTS {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionaries/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionaries/sql/default/delete.sql
index e144fb18..e90273ce 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionaries/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/templates/fts_dictionaries/sql/default/delete.sql
@@ -19,5 +19,5 @@ WHERE
 
 {# DROP FTS DICTIOANRY Statement #}
 {% if schema and name %}
-DROP TEXT SEARCH DICTIONARY {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
+DROP TEXT SEARCH DICTIONARY IF EXISTS {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/templates/fts_parsers/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/templates/fts_parsers/sql/default/delete.sql
index 2a65f29c..9918bdd9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/templates/fts_parsers/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/templates/fts_parsers/sql/default/delete.sql
@@ -19,5 +19,5 @@ WHERE
 
 {# DROP FTS PARSER Statement #}
 {% if schema and name %}
-DROP TEXT SEARCH PARSER {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
+DROP TEXT SEARCH PARSER IF EXISTS {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_templates/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_templates/sql/default/delete.sql
index fb311931..6c4bdb11 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_templates/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/templates/fts_templates/sql/default/delete.sql
@@ -19,5 +19,5 @@ WHERE
 
 {# DROP TEXT SEARCH TEMPLATE Statement #}
 {% if schema and name %}
-DROP TEXT SEARCH TEMPLATE {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
+DROP TEXT SEARCH TEMPLATE IF EXISTS {{conn|qtIdent(schema)}}.{{conn|qtIdent(name)}} {% if cascade %}CASCADE{%endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/11_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/11_plus/delete.sql
index b86e8329..2709bc56 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/11_plus/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/11_plus/delete.sql
@@ -17,5 +17,5 @@ WHERE
 {% endif %}
 
 {% if name %}
-DROP FUNCTION {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
+DROP FUNCTION IF EXISTS {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/9.6_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/9.6_plus/delete.sql
new file mode 100644
index 00000000..6d0ce90f
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/pg/sql/9.6_plus/delete.sql
@@ -0,0 +1,21 @@
+{% if scid and fnid %}
+SELECT
+    pr.proname as name, '(' || COALESCE(pg_catalog
+    .pg_get_function_identity_arguments(pr.oid), '') || ')' as func_args,
+    nspname
+FROM
+    pg_catalog.pg_proc pr
+JOIN
+    pg_catalog.pg_type typ ON typ.oid=prorettype
+JOIN
+    pg_catalog.pg_namespace nsp ON nsp.oid=pr.pronamespace
+WHERE
+    proisagg = FALSE
+    AND pronamespace = {{scid}}::oid
+    AND typname NOT IN ('trigger', 'event_trigger')
+    AND pr.oid = {{fnid}};
+{% endif %}
+
+{% if name %}
+DROP FUNCTION IF EXISTS {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/11_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/11_plus/delete.sql
index 8e943b40..1c721d1a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/11_plus/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/11_plus/delete.sql
@@ -17,6 +17,6 @@ WHERE
 {% endif %}
 
 {% if name %}
-DROP FUNCTION {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
+DROP FUNCTION IF EXISTS {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
 {% endif %}
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/delete.sql
new file mode 100644
index 00000000..6d0ce90f
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/functions/ppas/sql/9.6_plus/delete.sql
@@ -0,0 +1,21 @@
+{% if scid and fnid %}
+SELECT
+    pr.proname as name, '(' || COALESCE(pg_catalog
+    .pg_get_function_identity_arguments(pr.oid), '') || ')' as func_args,
+    nspname
+FROM
+    pg_catalog.pg_proc pr
+JOIN
+    pg_catalog.pg_type typ ON typ.oid=prorettype
+JOIN
+    pg_catalog.pg_namespace nsp ON nsp.oid=pr.pronamespace
+WHERE
+    proisagg = FALSE
+    AND pronamespace = {{scid}}::oid
+    AND typname NOT IN ('trigger', 'event_trigger')
+    AND pr.oid = {{fnid}};
+{% endif %}
+
+{% if name %}
+DROP FUNCTION IF EXISTS {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/pg/sql/11_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/pg/sql/11_plus/delete.sql
index 851d7f18..daacd44e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/pg/sql/11_plus/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/pg/sql/11_plus/delete.sql
@@ -17,5 +17,5 @@ WHERE
 {% endif %}
 
 {% if name %}
-DROP PROCEDURE {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
+DROP PROCEDURE IF EXISTS {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/delete.sql
index 851d7f18..daacd44e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/procedures/ppas/sql/11_plus/delete.sql
@@ -17,5 +17,5 @@ WHERE
 {% endif %}
 
 {% if name %}
-DROP PROCEDURE {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
+DROP PROCEDURE IF EXISTS {{ conn|qtIdent(nspname, name) }}{{func_args}}{% if cascade %} CASCADE{% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/create.sql
index 4a28806a..b5f43ceb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/create.sql
@@ -1,4 +1,4 @@
-CREATE SEQUENCE {{ conn|qtIdent(data.schema, data.name) }}{% if data.increment is defined and data.cycled %}
+CREATE SEQUENCE IF NOT EXISTS {{ conn|qtIdent(data.schema, data.name) }}{% if data.increment is defined and data.cycled %}
 
     CYCLE{% endif %}{% if data.increment is defined %}
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/delete.sql
index efd218ed..4f8cfbad 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/delete.sql
@@ -1 +1 @@
-DROP SEQUENCE {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
+DROP SEQUENCE IF EXISTS {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/update.sql
index 85dce035..7aa585f8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequences/sql/default/update.sql
@@ -2,12 +2,12 @@
 {% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
 {% if data %}
 {% if data.name != o_data.name %}
-ALTER SEQUENCE {{ conn|qtIdent(o_data.schema, o_data.name) }}
+ALTER SEQUENCE IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
     RENAME TO {{ conn|qtIdent(data.name) }};
 
 {% endif %}
 {% if data.seqowner and data.seqowner != o_data.seqowner %}
-ALTER SEQUENCE {{ conn|qtIdent(o_data.schema, data.name) }}
+ALTER SEQUENCE IF EXISTS {{ conn|qtIdent(o_data.schema, data.name) }}
     OWNER TO {{ conn|qtIdent(data.seqowner) }};
 
 {% endif %}
@@ -38,11 +38,11 @@ SELECT setval({{ seqname|qtLiteral }}, {{ data.current_value }}, true);
 {% set defquery = defquery+'\n    NO CYCLE' %}
 {% endif %}
 {% if defquery and defquery != '' %}
-ALTER SEQUENCE {{ conn|qtIdent(o_data.schema, data.name) }}{{ defquery }};
+ALTER SEQUENCE IF EXISTS {{ conn|qtIdent(o_data.schema, data.name) }}{{ defquery }};
 
 {% endif %}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER SEQUENCE {{ conn|qtIdent(o_data.schema, data.name) }}
+ALTER SEQUENCE IF EXISTS {{ conn|qtIdent(o_data.schema, data.name) }}
     SET SCHEMA {{ conn|qtIdent(data.schema) }};
 
 {% set seqname = conn|qtIdent(data.schema, data.name) %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql
index ce1a63de..fca9e6d1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -7
     START -30
     MINVALUE -35
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props_msql.sql
index f56eab15..4d3dd0a9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_neg_seq_props_msql.sql
@@ -1,4 +1,4 @@
-ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+ALTER SEQUENCE IF EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -7
     MINVALUE -35
     MAXVALUE -15;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql
index 480ba796..ca8d01b1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_change_grantee_privs.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql
index b98eb487..a85bb5f3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_comment.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 5
     START 5
     MINVALUE 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql
index 16abe749..80e954d5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_add.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql
index 78122be3..2641d8ea 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_remove.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql
index 9b379e9a..cca8f8f6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_privs_update.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql
index 78122be3..2641d8ea 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props_msql.sql
index 3ed0c8c1..62c9b8b8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/alter_seq_props_msql.sql
@@ -1,6 +1,6 @@
 SELECT setval('public."Seq1_$%{}[]()&*^!@""''`\/#"', 7, true);
 
-ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+ALTER SEQUENCE IF EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 12
     MINVALUE 2
     MAXVALUE 9992
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql
index 7cd0881d..085d1003 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -5
     START -30
     MINVALUE -40
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql
index f62613c8..0c343559 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_negative_sequence_msql.sql
@@ -1,4 +1,4 @@
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -5
     START -30
     MINVALUE -40
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql
index b159ab9d..f8e3cfb7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 5
     START 5
     MINVALUE 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql
index 67e09cd6..429813b6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/pg/default/create_sequence_msql.sql
@@ -1,4 +1,4 @@
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 5
     START 5
     MINVALUE 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props.sql
index 01424cf9..73b89127 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -7
     START -30
     MINVALUE -35
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props_msql.sql
index f56eab15..4d3dd0a9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_neg_seq_props_msql.sql
@@ -1,4 +1,4 @@
-ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+ALTER SEQUENCE IF EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -7
     MINVALUE -35
     MAXVALUE -15;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_change_grantee_privs.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_change_grantee_privs.sql
index b244d560..d6ee2e00 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_change_grantee_privs.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_change_grantee_privs.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_comment.sql
index cc47ed07..0c3ef12a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_comment.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_comment.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 5
     START 5
     MINVALUE 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_add.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_add.sql
index 457f4810..7b2e9239 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_add.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_add.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_remove.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_remove.sql
index bc59956a..6c38e8b6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_remove.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_remove.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_update.sql
index fea96154..b7a04a82 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_privs_update.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props.sql
index bc59956a..6c38e8b6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     CYCLE
     INCREMENT 12
     START 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props_msql.sql
index 3ed0c8c1..62c9b8b8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/alter_seq_props_msql.sql
@@ -1,6 +1,6 @@
 SELECT setval('public."Seq1_$%{}[]()&*^!@""''`\/#"', 7, true);
 
-ALTER SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+ALTER SEQUENCE IF EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 12
     MINVALUE 2
     MAXVALUE 9992
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence.sql
index 6ad4989c..b7523a6e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -5
     START -30
     MINVALUE -40
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence_msql.sql
index 64e75266..8b693096 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_negative_sequence_msql.sql
@@ -1,4 +1,4 @@
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT -5
     START -30
     MINVALUE -40
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence.sql
index 611226a1..980d6d78 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence.sql
@@ -2,7 +2,7 @@
 
 -- DROP SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#";
 
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 5
     START 5
     MINVALUE 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence_msql.sql
index f926dbec..9a209833 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/tests/ppas/default/create_sequence_msql.sql
@@ -1,4 +1,4 @@
-CREATE SEQUENCE public."Seq1_$%{}[]()&*^!@""'`\/#"
+CREATE SEQUENCE IF NOT EXISTS public."Seq1_$%{}[]()&*^!@""'`\/#"
     INCREMENT 5
     START 5
     MINVALUE 5
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_alt_privilege.sql
index d44b1970..2efcafa6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_alt_privilege.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_alt_privilege.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.msql
index 0d70893d..5a232ed7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.msql
@@ -1,15 +1,15 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.sql
index 335d4b88..e4b79358 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_char.sql
@@ -1,17 +1,17 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.msql
index 78b103c0..245a8e68 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.sql
index 6749d14e..581071b7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.msql
index 4184c816..b4a68709 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.sql
index e4828088..ae0b6601 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_drop_identity_by_default.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.msql
index 8a8e36b2..3ccc61d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.sql
index 7d78c948..10eb60fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.msql
index 7a46497d..14008b50 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_5_$%{}[]()&*^!@""'`\/#" TO "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 2 SET MINVALUE 1 SET MAXVALUE 200 SET CACHE 2;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.sql
index 560d2b97..8ba00535 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_by_default.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 2 START 1 MINVALUE 1 MAXVALUE 200 CACHE 2 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 2 START 1 MINVALUE 1 MAXVALUE 200 CACHE 2 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.msql
index 6eede13b..f70ad836 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 3 RESTART SET START 3 SET MINVALUE 3 SET MAXVALUE 30 SET CACHE 3;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.sql
index 5aecdbec..43f66e22 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_comb_start_seq.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 3 START 3 MINVALUE 3 MAXVALUE 30 CACHE 3 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 3 START 3 MINVALUE 3 MAXVALUE 30 CACHE 3 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.msql
index 402c270c..2878a1d1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET GENERATED ALWAYS SET NO CYCLE RESTART SET START 2;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.sql
index 79cba6ad..d0d693ab 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_identity_for_restart_seq.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 2 MINVALUE 1 MAXVALUE 10 CACHE 1 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 2 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.msql
index adc24fd7..31a65028 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.sql
index 515f2cdc..207bc646 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.msql
index c9362ce4..8f400900 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_4_$%{}[]()&*^!@""'`\/#" TO "new_col_4_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.sql
index 95817ad6..45f6e03c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_numeric.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_remove_length.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_remove_length.sql
index 5506f297..96a9438d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_remove_length.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_remove_length.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.msql
index 8dfe39e2..d2e6a589 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__1_$%{}[]()&*^!@""'`\/#" SET DEFAULT 'changed default value';
 
 GRANT SELECT("col__1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.sql
index eb85e567..977ce3b0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_text_with_default_value.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'changed default value'::text;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'changed default value'::text;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
     IS 'test comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.msql
index 22681ca7..4f08f96b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.msql
@@ -1,6 +1,6 @@
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" TYPE time(6) with time zone ;
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" SET NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.sql
index 00660a4f..f5e8e3dc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_timestamp_with_default_value_using_function.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(6) with time zone NOT NULL DEFAULT now();
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__2_$%{}[]()&*^!@""'`\/#" time(6) with time zone NOT NULL DEFAULT now();
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
     IS 'test comment modification';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.msql
index 4e1bdae8..db179dad 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.msql
@@ -1,3 +1,3 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=2);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.sql
index bffcfe50..4ffccc56 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/alter_column_with_interger_array_and_options.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
     IS 'comment';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=2);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.msql
index 0fb8d76d..b07eb190 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.sql
index 0f7e099f..51559b69 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_char.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.msql
index 57a8172b..2d778d1c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.sql
index 987bd610..8f7c7a3a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_identity_for_restart_seq.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.msql
index a977584c..ec7d70ac 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.sql
index 61e7b445..e62203d8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.msql
index 553d8748..37cc1d69 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.sql
index 063b3c67..d0374bdd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.msql
index 49a9a8ab..369cf079 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.sql
index 1aa62031..dcb9e564 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_int_identity_by_default.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.msql
index b80516f2..08d2390d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_4_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_4_$%{}[]()&*^!@""'`\/#"
-    SET (n_distinct=1);
\ No newline at end of file
+    SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.sql
index 487567ad..f14a9135 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_numeric.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_4_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_4_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.msql
index eb99d46c..d4cb064b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text DEFAULT 'xyz';
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__1_$%{}[]()&*^!@""'`\/#" text DEFAULT 'xyz';
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
     IS 'test comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.sql
index 4302a27a..9058d639 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_text_with_default_value.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'xyz'::text;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'xyz'::text;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
     IS 'test comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.msql
index 72144fa6..f989fba8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
     IS 'test comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.sql
index a4d3b69c..184e6b28 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_timestamp_with_default_value_using_function.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
     IS 'test comment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.msql
index c8e255fc..ebe475d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
     IS 'comment';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.sql
index 47e47421..3481f46f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/10_plus/create_column_with_interger_array_and_options.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
     IS 'comment';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql
index a1c149f0..9db4aa9f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_alt_privilege.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.msql
index 187fb291..b34f0e9f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.msql
@@ -1,12 +1,12 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character COLLATE pg_catalog."C";
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.sql
index e55b117d..6ac8f813 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_char.sql
@@ -1,17 +1,17 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.msql
index c345ba0a..64cef6b0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.sql
index ccd89d80..52dab98e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.msql
index ade6c7e9..66e8d383 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.sql
index c2344200..0b4c8460 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_drop_identity_by_default.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.msql
index 41086ab1..196ba300 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_4_$%{}[]()&*^!@""'`\/#" TO "new_col_4_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_4_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_4_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_4_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_4_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.sql
index e49bebfa..c97b210d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (((1 + 2) + 3)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.msql
index 6b76b70d..cce9a5a0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_8_$%{}[]()&*^!@""'`\/#" TO "new_col_8_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_8_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_8_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_8_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_8_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_8_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_8_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.sql
index 4f96cd52..ab2a7a5d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_generated_with_existing_columns.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_8_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_8_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS ((dummy1 + dummy2)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.msql
index 119556dc..776c9c2b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.sql
index e0fbb91c..4c7c3dbc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.msql
index 6c00ace6..8e93d209 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_9_$%{}[]()&*^!@""'`\/#" TO "new_col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 2 SET MINVALUE 1 SET MAXVALUE 200 SET CACHE 2;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.sql
index a16cc872..77eec335 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_by_default.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 2 START 1 MINVALUE 1 MAXVALUE 200 CACHE 2 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.msql
index ad78f916..11798454 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 3 RESTART SET START 3 SET MINVALUE 3 SET MAXVALUE 30 SET CACHE 3;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.sql
index 55c46ed2..16c198ec 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_comb_start_seq.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 3 START 3 MINVALUE 3 MAXVALUE 30 CACHE 3 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.msql
index 603dcec8..443b74ca 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET GENERATED ALWAYS SET NO CYCLE RESTART SET START 2;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.sql
index 75589761..1ca71a90 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_identity_for_restart_seq.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 2 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.msql
index 0f2c754b..b10ce502 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.sql
index e7e818ef..c25fa410 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_int.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.msql
index 49aa6e67..fda949ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_5_$%{}[]()&*^!@""'`\/#" TO "new_col_5_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_5_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_5_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.sql
index c34bfc7f..124be05e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_numeric.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.msql
index 41cb2a64..625e9fbc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.msql
@@ -1,2 +1,2 @@
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" TYPE numeric;
\ No newline at end of file
+    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" TYPE numeric;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.sql
index 686ebf3c..55ec33a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_remove_length.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.msql
index 7f89254f..79227057 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__1_$%{}[]()&*^!@""'`\/#" SET DEFAULT 'changed default value';
 
 GRANT SELECT("col__1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.sql
index 885911c2..0ce8ec23 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_text_with_default_value.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'changed default value'::text;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.msql
index 90050bf6..dac16cde 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.msql
@@ -1,6 +1,6 @@
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" TYPE time(6) with time zone ;
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__2_$%{}[]()&*^!@""'`\/#" SET NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.sql
index c384201a..382abf27 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_timestamp_with_default_value_using_function.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(6) with time zone NOT NULL DEFAULT now();
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.msql
index 88af94a7..7205d049 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.msql
@@ -1,3 +1,3 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=2);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.sql
index 6bc4af1e..bd34ae16 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/alter_column_with_interger_array_and_options.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
     IS 'comment';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=2);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.msql
index 232f1948..c256ac0b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.sql
index 5b4cd4a4..603ceb6c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_char.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.msql
index 89763689..4f2e5ccc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint(None, None) NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.sql
index 6c827598..1319485d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_identity_for_restart_seq.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.msql
index 04dca554..41c4885a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.sql
index 39e8868d..af1c78ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.msql
index b4816e0f..356da6f4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (1 + 2 + 3) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.sql
index e06070ef..d5892e8a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (((1 + 2) + 3)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.msql
index 7e79b10f..5bc4951f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.sql
index ae40c07c..72a1644b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_generated_with_existing_columns.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_8_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_8_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS ((dummy1 + dummy2)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.msql
index b9f3f553..3fa01ce4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.sql
index da386766..e8a43774 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.msql
index f4803dc0..339e0183 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.sql
index bdc3795d..f46ca745 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_int_identity_by_default.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_9_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.msql
index 0f7944bc..5e365c07 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_5_$%{}[]()&*^!@""'`\/#"
-    SET (n_distinct=1);
\ No newline at end of file
+    SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.sql
index 73f49eeb..f8a0076e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_numeric.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_5_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.msql
index f18eecbb..bb8d1d90 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text DEFAULT 'xyz';
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.sql
index 076e8ebe..b53dfe9d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_text_with_default_value.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__1_$%{}[]()&*^!@""'`\/#" text COLLATE pg_catalog."default" DEFAULT 'xyz'::text;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.msql
index 51a3fd17..dbb64a26 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.sql
index ee1a6630..1df229a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_timestamp_with_default_value_using_function.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__2_$%{}[]()&*^!@""'`\/#" time(4) with time zone DEFAULT now();
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.msql
index cf022ee6..8d302791 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
     IS 'comment';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.sql
index e7dd96e6..1f219905 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/12_plus/create_column_with_interger_array_and_options.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col__3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col__3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col__3_$%{}[]()&*^!@""'`\/#" integer[] NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col__3_$%{}[]()&*^!@""'`\/#"
     IS 'comment';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col__3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql
index 231d5ae9..11797243 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_alt_privilege.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.msql
index 7496276f..569d1474 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.msql
@@ -1,15 +1,15 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.sql
index 30a97ca4..e15bbff4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_char.sql
@@ -1,17 +1,17 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.msql
index bfd079ae..c54b18a3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.sql
index d96d1a1d..1928d912 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.msql
index d1313822..663cc495 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.sql
index f115459d..259de464 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_numeric.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_remove_length.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_remove_length.sql
index 7a7445b6..b3b73233 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_remove_length.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/alter_column_remove_length.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.msql
index 4c3981b4..6c6a7203 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.sql
index c5c3e10b..41ab08a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_char.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.msql
index c314b0bc..e0c67ea3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.sql
index b7c69353..38da2b3d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.msql
index b5eb2cfc..cfda50c9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_3_$%{}[]()&*^!@""'`\/#"
-    SET (n_distinct=1);
\ No newline at end of file
+    SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.sql
index 68c7fb52..b85cd356 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/pg/default/create_column_numeric.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_alt_privilege.sql
index ecae7324..fefc11b7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_alt_privilege.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_alt_privilege.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.msql
index 0d70893d..5a232ed7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.msql
@@ -1,15 +1,15 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.sql
index 335d4b88..e4b79358 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_char.sql
@@ -1,17 +1,17 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.msql
index 78b103c0..245a8e68 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.sql
index 6749d14e..581071b7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.msql
index 4184c816..b4a68709 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.sql
index e4828088..ae0b6601 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_drop_identity_by_default.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.msql
index 8a8e36b2..3ccc61d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.sql
index 7d78c948..10eb60fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.msql
index 7a46497d..14008b50 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_5_$%{}[]()&*^!@""'`\/#" TO "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 2 SET MINVALUE 1 SET MAXVALUE 200 SET CACHE 2;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.sql
index 560d2b97..8ba00535 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_by_default.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 2 START 1 MINVALUE 1 MAXVALUE 200 CACHE 2 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 2 START 1 MINVALUE 1 MAXVALUE 200 CACHE 2 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.msql
index 6eede13b..f70ad836 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 3 RESTART SET START 3 SET MINVALUE 3 SET MAXVALUE 30 SET CACHE 3;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.sql
index 5aecdbec..43f66e22 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_comb_start_seq.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 3 START 3 MINVALUE 3 MAXVALUE 30 CACHE 3 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 3 START 3 MINVALUE 3 MAXVALUE 30 CACHE 3 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.msql
index 402c270c..2878a1d1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET GENERATED ALWAYS SET NO CYCLE RESTART SET START 2;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.sql
index 79cba6ad..d0d693ab 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_identity_for_restart_seq.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 2 MINVALUE 1 MAXVALUE 10 CACHE 1 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 2 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.msql
index adc24fd7..31a65028 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.sql
index 515f2cdc..207bc646 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.msql
index c9362ce4..8f400900 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     RENAME "col_4_$%{}[]()&*^!@""'`\/#" TO "new_col_4_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_2_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.sql
index 95817ad6..45f6e03c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_numeric.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.msql
index d4caec80..e2ffd2c8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.msql
@@ -1,2 +1,2 @@
 ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" TYPE numeric;
\ No newline at end of file
+    ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" TYPE numeric;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.sql
index 5506f297..96a9438d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/alter_column_remove_length.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.msql
index 0fb8d76d..b07eb190 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.sql
index 0f7e099f..51559b69 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_char.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.msql
index 57a8172b..2d778d1c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.sql
index 987bd610..8f7c7a3a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_identity_for_restart_seq.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
     IS 'demo comments';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.msql
index a977584c..ec7d70ac 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.sql
index 61e7b445..e62203d8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.msql
index 553d8748..37cc1d69 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.sql
index 063b3c67..d0374bdd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.msql
index 49a9a8ab..369cf079 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.sql
index 1aa62031..dcb9e564 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_int_identity_by_default.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_5_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.msql
index b80516f2..08d2390d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_4_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_4_$%{}[]()&*^!@""'`\/#"
-    SET (n_distinct=1);
\ No newline at end of file
+    SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.sql
index 487567ad..f14a9135 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/10_plus/create_column_numeric.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_4_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_2_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_2_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_2_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_4_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_alt_privilege.sql
index e6007db1..75bc1ddf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_alt_privilege.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_alt_privilege.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.msql
index 1ac15746..78412bcb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.msql
@@ -1,15 +1,15 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.sql
index e55b117d..6ac8f813 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_char.sql
@@ -1,17 +1,17 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.msql
index c345ba0a..64cef6b0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.sql
index ccd89d80..52dab98e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.msql
index ade6c7e9..66e8d383 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
\ No newline at end of file
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
+    ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" DROP IDENTITY;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.sql
index c2344200..0b4c8460 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_drop_identity_by_default.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.msql
index 41086ab1..196ba300 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_4_$%{}[]()&*^!@""'`\/#" TO "new_col_4_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_4_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_4_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_4_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_4_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_4_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.sql
index e49bebfa..c97b210d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (((1 + 2) + 3)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_4_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.msql
index 6b76b70d..cce9a5a0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_8_$%{}[]()&*^!@""'`\/#" TO "new_col_8_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_8_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_8_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_8_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_8_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_8_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_8_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.sql
index 4f96cd52..ab2a7a5d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_generated_with_existing_columns.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_8_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_8_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS ((dummy1 + dummy2)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_8_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.msql
index 119556dc..776c9c2b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_3_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_3_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.sql
index e0fbb91c..4c7c3dbc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.msql
index 6c00ace6..8e93d209 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.msql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_9_$%{}[]()&*^!@""'`\/#" TO "new_col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 2 SET MINVALUE 1 SET MAXVALUE 200 SET CACHE 2;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.sql
index a16cc872..77eec335 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_by_default.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 2 START 1 MINVALUE 1 MAXVALUE 200 CACHE 2 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.msql
index ad78f916..11798454 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET CYCLE SET INCREMENT 3 RESTART SET START 3 SET MINVALUE 3 SET MAXVALUE 30 SET CACHE 3;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.sql
index 55c46ed2..16c198ec 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_comb_start_seq.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 3 START 3 MINVALUE 3 MAXVALUE 30 CACHE 3 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.msql
index 603dcec8..443b74ca 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.msql
@@ -1,2 +1,2 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_6_$%{}[]()&*^!@""'`\/#" SET GENERATED ALWAYS SET NO CYCLE RESTART SET START 2;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.sql
index 75589761..1ca71a90 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_identity_for_restart_seq.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 2 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.msql
index 0f2c754b..b10ce502 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.sql
index e7e818ef..c25fa410 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_int.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.msql
index 49aa6e67..fda949ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     RENAME "col_5_$%{}[]()&*^!@""'`\/#" TO "new_col_5_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_5_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_5_$%{}[]()&*^!@""'`\/#") ON testschema."table_3_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.sql
index c34bfc7f..124be05e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_numeric.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.msql
index 41cb2a64..625e9fbc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.msql
@@ -1,2 +1,2 @@
 ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" TYPE numeric;
\ No newline at end of file
+    ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" TYPE numeric;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.sql
index 686ebf3c..55ec33a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/alter_column_remove_length.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."new_col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_5_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.msql
index 232f1948..c256ac0b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.sql
index 5b4cd4a4..603ceb6c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_char.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.msql
index 4ba048b5..a9cc7a30 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.sql
index 6c827598..1319485d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_identity_for_restart_seq.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_6_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_6_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_6_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 10 CACHE 1 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_6_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.msql
index 04dca554..41c4885a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.sql
index 39e8868d..af1c78ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.msql
index b4816e0f..356da6f4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (1 + 2 + 3) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.sql
index e06070ef..d5892e8a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_4_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_4_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_4_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (((1 + 2) + 3)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_4_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.msql
index 7e79b10f..5bc4951f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS (dummy1 + dummy2) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.sql
index ae40c07c..72a1644b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_generated_with_existing_columns.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_8_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_8_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_8_$%{}[]()&*^!@""'`\/#" bigint GENERATED ALWAYS AS ((dummy1 + dummy2)) STORED;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_8_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.msql
index b9f3f553..3fa01ce4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.sql
index da386766..e8a43774 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.msql
index f4803dc0..339e0183 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.sql
index bdc3795d..f46ca745 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_int_identity_by_default.sql
@@ -1,8 +1,8 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_9_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_9_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_9_$%{}[]()&*^!@""'`\/#" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( CYCLE INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 99999 CACHE 10 );
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_9_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.msql
index 0f7944bc..5e365c07 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_5_$%{}[]()&*^!@""'`\/#"
-    SET (n_distinct=1);
\ No newline at end of file
+    SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.sql
index 73f49eeb..f8a0076e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/12_plus/create_column_numeric.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_5_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_5_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col_5_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_3_$%{}[]()&*^!@""'`\/#"."col_5_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_3_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_3_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_5_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_alt_privilege.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_alt_privilege.sql
index c3bf26b8..c99db583 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_alt_privilege.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_alt_privilege.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.msql
index 7496276f..569d1474 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.msql
@@ -1,15 +1,15 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     RENAME "col_2_$%{}[]()&*^!@""'`\/#" TO "new_col_2_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" TYPE character(None) COLLATE pg_catalog."C";
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.sql
index 30a97ca4..e15bbff4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_char.sql
@@ -1,17 +1,17 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_2_$%{}[]()&*^!@""'`\/#" character(1) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STATISTICS 5;
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_2_$%{}[]()&*^!@""'`\/#" SET STORAGE PLAIN;
 
 GRANT INSERT("new_col_2_$%{}[]()&*^!@""'`\/#"), SELECT("new_col_2_$%{}[]()&*^!@""'`\/#"), REFERENCES("new_col_2_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.msql
index bfd079ae..c54b18a3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     RENAME "col_1_$%{}[]()&*^!@""'`\/#" TO "new_col_1_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_1_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.sql
index d96d1a1d..1928d912 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_1_$%{}[]()&*^!@""'`\/#" real NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.msql
index d1313822..663cc495 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.msql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     RENAME "col_3_$%{}[]()&*^!@""'`\/#" TO "new_col_3_$%{}[]()&*^!@""'`\/#";
 
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
@@ -6,4 +6,4 @@ ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-GRANT ALL("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
\ No newline at end of file
+GRANT ALL("new_col_3_$%{}[]()&*^!@""'`\/#") ON testschema."table_1_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.sql
index f115459d..259de464 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_numeric.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" numeric(15,6) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.msql
index 07891245..aef4d94e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.msql
@@ -1,2 +1,2 @@
 ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" TYPE numeric;
\ No newline at end of file
+    ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" TYPE numeric;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.sql
index 7a7445b6..b3b73233 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/alter_column_remove_length.sql
@@ -1,14 +1,14 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "new_col_3_$%{}[]()&*^!@""'`\/#" numeric NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."new_col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for alter';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "new_col_3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.msql
index 4c3981b4..6c6a7203 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.sql
index c5c3e10b..41ab08a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_char.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_2_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_2_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_2_$%{}[]()&*^!@""'`\/#" character varying(50) COLLATE pg_catalog."C";
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_2_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.msql
index c314b0bc..e0c67ea3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.msql
@@ -1,5 +1,5 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.sql
index b7c69353..38da2b3d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_int.sql
@@ -1,9 +1,9 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_1_$%{}[]()&*^!@""'`\/#" bigint NOT NULL DEFAULT 1;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_1_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.msql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.msql
index b5eb2cfc..cfda50c9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.msql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.msql
@@ -1,9 +1,9 @@
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" numeric(10, 5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_3_$%{}[]()&*^!@""'`\/#"
-    SET (n_distinct=1);
\ No newline at end of file
+    SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.sql
index 68c7fb52..b85cd356 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/ppas/default/create_column_numeric.sql
@@ -1,13 +1,13 @@
 -- Column: testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
 
--- ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN "col_3_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col_3_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col_3_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col_3_$%{}[]()&*^!@""'`\/#" numeric(10,5) NOT NULL;
 
 COMMENT ON COLUMN testschema."table_1_$%{}[]()&*^!@""'`\/#"."col_3_$%{}[]()&*^!@""'`\/#"
     IS 'Comment for create';
 
-ALTER TABLE testschema."table_1_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS testschema."table_1_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN "col_3_$%{}[]()&*^!@""'`\/#"
     SET (n_distinct=1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/alter_event_comment_code.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/alter_event_comment_code.sql
index e5ebb6bf..02b8ae7b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/alter_event_comment_code.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/alter_event_comment_code.sql
@@ -1,6 +1,6 @@
 -- Compound Trigger: test_compound_trigger_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
+-- DROP TRIGGER IF EXISTS "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
 
 CREATE OR REPLACE TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#"
     FOR INSERT OR UPDATE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_all_event.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_all_event.sql
index 257da20a..e1a6892c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_all_event.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_all_event.sql
@@ -1,6 +1,6 @@
 -- Compound Trigger: test_compound_trigger_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
+-- DROP TRIGGER IF EXISTS "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
 
 CREATE OR REPLACE TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#"
     FOR INSERT OR DELETE OR TRUNCATE OR UPDATE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_delete.sql
index 4b60e7c2..453581bd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_delete.sql
@@ -1,6 +1,6 @@
 -- Compound Trigger: test_compound_trigger_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
+-- DROP TRIGGER IF EXISTS "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
 
 CREATE OR REPLACE TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#"
     FOR INSERT OR DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_update_on_columns.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_update_on_columns.sql
index 874bbf15..de594393 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_update_on_columns.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_update_on_columns.sql
@@ -1,6 +1,6 @@
 -- Compound Trigger: test_compound_trigger_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
+-- DROP TRIGGER IF EXISTS "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
 
 CREATE OR REPLACE TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#"
     FOR INSERT OR UPDATE OF id, name
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_with_when.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_with_when.sql
index 4329279c..ea499a32 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_with_when.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/tests/ppas/12_plus/create_for_insert_with_when.sql
@@ -1,6 +1,6 @@
 -- Compound Trigger: test_compound_trigger_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
+-- DROP TRIGGER IF EXISTS "test_compound_trigger_$%{}[]()&*^!@""'`\/#" ON testschema.table_for_compound_trigger;
 
 CREATE OR REPLACE TRIGGER "test_compound_trigger_$%{}[]()&*^!@""'`\/#"
     FOR INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint.sql
index e9985430..71db0367 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Chk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tableforcon DROP CONSTRAINT IF EXISTS "Chk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tableforcon
+ALTER TABLE IF EXISTS testschema.tableforcon
     ADD CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a" CHECK (col1 > 1);
 
 COMMENT ON CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint_msql.sql
index 6f1fd8d3..1c570cd3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/alter_check_constraint_msql.sql
@@ -1,6 +1,6 @@
-ALTER TABLE testschema.tableforcon
+ALTER TABLE IF EXISTS testschema.tableforcon
     RENAME CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" TO "Chk_$%{}[]()&*^!@""'`\/#a";
-ALTER TABLE testschema.tableforcon
+ALTER TABLE IF EXISTS testschema.tableforcon
     VALIDATE CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a";
 COMMENT ON CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforcon
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint.sql
index 9afc729b..0c15d06e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Chk_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tableforcon DROP CONSTRAINT IF EXISTS "Chk_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tableforcon
+ALTER TABLE IF EXISTS testschema.tableforcon
     ADD CONSTRAINT "Chk_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 1)
     NOT VALID;
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid.sql
index 40151866..ee5313d4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid.sql
@@ -1,8 +1,8 @@
 -- Constraint: Chk_valid_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tableforcon DROP CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tableforcon DROP CONSTRAINT IF EXISTS "Chk_valid_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tableforcon
+ALTER TABLE IF EXISTS testschema.tableforcon
     ADD CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 200) NO INHERIT;
 
 COMMENT ON CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid_msql.sql
index 1d341e03..3b766a46 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/tests/Default/create_check_constraint_with_valid_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tableforcon
+ALTER TABLE IF EXISTS testschema.tableforcon
     ADD CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" CHECK (col1 > 200) NO INHERIT;
 
 COMMENT ON CONSTRAINT "Chk_valid_$%{}[]()&*^!@""'`\/#" ON testschema.tableforcon
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint.sql
index 5fe0272f..5299ca36 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#a" EXCLUDE USING btree (
     col2 text_pattern_ops WITH =)
     INCLUDE (col1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint_msql.sql
index 38adeec0..82156781 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/alter_exclusion_constraint_msql.sql
@@ -1,6 +1,6 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     RENAME CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" TO "Exclusion_$%{}[]()&*^!@""'`\/#a";
-ALTER INDEX testschema."Exclusion_$%{}[]()&*^!@""'`\/#a"
+ALTER INDEX IF EXISTS testschema."Exclusion_$%{}[]()&*^!@""'`\/#a"
     SET (FILLFACTOR=98);
 COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforexclusion
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint.sql
index 88cb3d58..5c58c601 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING btree (
     col2 text_pattern_ops WITH =)
     INCLUDE (col1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp.sql
index bfbdeb4f..0d83f32e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
     (col1 + col3) WITH <>,
     col2 WITH <>)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp_msql.sql
index 08b19b14..da630254 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_exp_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
     (col1 + col3) WITH <>,
     col2 WITH <>)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_msql.sql
index 373174b4..c1512a17 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/11_plus/create_exclusion_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING btree (
     col2 text_pattern_ops WITH =)
     INCLUDE (col1)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint.sql
index ecc1f9f6..22a257b1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#a" EXCLUDE USING gist (
     col2 WITH <>)
     WITH (FILLFACTOR=98)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint_msql.sql
index 38adeec0..82156781 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_exclusion_constraint_msql.sql
@@ -1,6 +1,6 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     RENAME CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" TO "Exclusion_$%{}[]()&*^!@""'`\/#a";
-ALTER INDEX testschema."Exclusion_$%{}[]()&*^!@""'`\/#a"
+ALTER INDEX IF EXISTS testschema."Exclusion_$%{}[]()&*^!@""'`\/#a"
     SET (FILLFACTOR=98);
 COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#a" ON testschema.tableforexclusion
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor.sql
index 529715b0..035769cb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#_1a
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1a";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#_1a";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1a" EXCLUDE USING gist (
     col2 WITH <>);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor_msql.sql
index a0190e47..0090d557 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/alter_without_fillfactor_msql.sql
@@ -1,6 +1,6 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     RENAME CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1" TO "Exclusion_$%{}[]()&*^!@""'`\/#_1a";
-ALTER INDEX testschema."Exclusion_$%{}[]()&*^!@""'`\/#_1a"
+ALTER INDEX IF EXISTS testschema."Exclusion_$%{}[]()&*^!@""'`\/#_1a"
     RESET (FILLFACTOR);
 COMMENT ON CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1a" ON testschema.tableforexclusion
     IS 'Comment for alter';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint.sql
index 765ab93f..eb8df927 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
     col2 WITH <>)
     WITH (FILLFACTOR=12)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_exp.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_exp.sql
index bfbdeb4f..0d83f32e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_exp.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_exp.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
     (col1 + col3) WITH <>,
     col2 WITH <>)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_msql.sql
index 74d8165d..9cab40ea 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_exclusion_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
     col2 WITH <>)
     WITH (FILLFACTOR=12)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor.sql
index d7c463c3..a0e6e8f5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor.sql
@@ -1,8 +1,8 @@
 -- Constraint: Exclusion_$%{}[]()&*^!@"'`\/#_1
 
--- ALTER TABLE testschema.tableforexclusion DROP CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1";
+-- ALTER TABLE IF EXISTS testschema.tableforexclusion DROP CONSTRAINT IF EXISTS "Exclusion_$%{}[]()&*^!@""'`\/#_1";
 
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1" EXCLUDE USING gist (
     col2 WITH <>)
     WITH (FILLFACTOR=12);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor_msql.sql
index 75d85f23..e65609c3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/create_without_fillfactor_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#_1" EXCLUDE USING gist (
     col2 WITH <>)
     WITH (FILLFACTOR=12);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/exclusion_constraint_exp_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/exclusion_constraint_exp_msql.sql
index b3e03df1..d7850ba1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/exclusion_constraint_exp_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/tests/default/exclusion_constraint_exp_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tableforexclusion
+ALTER TABLE IF EXISTS testschema.tableforexclusion
     ADD CONSTRAINT "Exclusion_$%{}[]()&*^!@""'`\/#" EXCLUDE USING gist (
     col2 WITH <>,
     (col1+col3) WITH <>)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation.sql
index f98b930b..bacf80c0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey1_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey1_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey1_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH FULL
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation_msql.sql
index a1bbd7b4..95350454 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/alter_name_comment_validation_msql.sql
@@ -1,7 +1,7 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     RENAME CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" TO "FKey1_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     VALIDATE CONSTRAINT "FKey1_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON CONSTRAINT "FKey1_$%{}[]()&*^!@""'`\/#" ON testschema.test_second_table
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade.sql
index 6f197b04..fbf87eef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE CASCADE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade_msql.sql
index 9bd85625..0ff0eddf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_cascade_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE CASCADE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict.sql
index eac1ebe7..e996b53d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE RESTRICT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict_msql.sql
index f7cde37c..46c837f7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_restrict_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE RESTRICT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault.sql
index a7bbf3c9..ac2b29da 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE SET DEFAULT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault_msql.sql
index 99488ea0..ff14da65 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setdefault_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE SET DEFAULT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull.sql
index abef54b4..3f0795e5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE SET NULL
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull_msql.sql
index c5a9c02b..3bc08004 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_setnull_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE SET NULL
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple.sql
index 213d3eeb..9b383b07 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple_msql.sql
index 8ce69fbd..c021a714 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_simple_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH SIMPLE
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options.sql
index c699292e..b8546fc0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options.sql
@@ -1,8 +1,8 @@
 -- Constraint: FKey_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.test_second_table DROP CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.test_second_table DROP CONSTRAINT IF EXISTS "FKey_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH FULL
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options_msql.sql
index d701ec77..40861d97 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/tests/9.3_plus/create_foreign_key_with_all_options_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.test_second_table
+ALTER TABLE IF EXISTS testschema.test_second_table
     ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
     REFERENCES testschema.test_first_table (id) MATCH FULL
     ON UPDATE NO ACTION
@@ -9,5 +9,5 @@ ALTER TABLE testschema.test_second_table
 COMMENT ON CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" ON testschema.test_second_table
     IS 'Test Comment';
 
-CREATE INDEX "fki_FKey_$%{}[]()&*^!@""'`\/#"
+CREATE INDEX IF NOT EXISTS "fki_FKey_$%{}[]()&*^!@""'`\/#"
     ON testschema.test_second_table(so_id);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint.sql
index 6a867ba9..ee3ad608 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
     INCLUDE (col2)
     WITH (FILLFACTOR=90)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint_with_index.sql
index 1a720e36..cc84e9d4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
     WITH (FILLFACTOR=90);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_reset_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_reset_fillfactor.sql
index c97b44cd..a7cf8983 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_reset_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_pkey_reset_fillfactor.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
     INCLUDE (col2)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint.sql
index 32a23c87..bdf4b75d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a" UNIQUE (col1)
     INCLUDE (col2)
     WITH (FILLFACTOR=90)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint_with_index.sql
index 523703f7..b5e51d0e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a" UNIQUE (col1)
     WITH (FILLFACTOR=90);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_reset_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_reset_fillfactor.sql
index ad757f2f..446b3727 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_reset_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/alter_unique_reset_fillfactor.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a" UNIQUE (col1)
     INCLUDE (col2)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint.sql
index 84aeb409..15a7a62b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
     INCLUDE (col2)
     WITH (FILLFACTOR=20)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_msql.sql
index cc794c94..8fede9bc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
     INCLUDE (col2)
     WITH (FILLFACTOR=20)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index.sql
index c6da21c4..02a1113a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
     WITH (FILLFACTOR=20);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index_msql.sql
index bdbb820c..ff467215 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_pkey_constraint_with_index_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY USING INDEX uindex;
 
 COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tablefor_primary_key_cons
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint.sql
index 180037f7..ace12822 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE (col1)
     INCLUDE (col2)
     WITH (FILLFACTOR=20)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_msql.sql
index afcce154..83c4e180 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE (col1)
     INCLUDE (col2)
     WITH (FILLFACTOR=20)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index.sql
index 83c3e289..76fd9e54 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE (col1)
     WITH (FILLFACTOR=20);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index_msql.sql
index bb1f7c65..7025378c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/11_plus/create_unique_constraint_with_index_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE USING INDEX uindex;
 
 COMMENT ON CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" ON testschema.tablefor_unique_cons
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint.sql
index 8715af09..5b580c18 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
     WITH (FILLFACTOR=90)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint_with_index.sql
index 1a720e36..cc84e9d4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
     WITH (FILLFACTOR=90);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_reset_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_reset_fillfactor.sql
index d7d3a8b1..6006c403 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_reset_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_pkey_reset_fillfactor.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#a" PRIMARY KEY (col1)
     DEFERRABLE INITIALLY DEFERRED;
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint.sql
index 6ea59779..59b1eede 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a" UNIQUE (col1)
     WITH (FILLFACTOR=90)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint_with_index.sql
index 523703f7..b5e51d0e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a" UNIQUE (col1)
     WITH (FILLFACTOR=90);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_reset_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_reset_fillfactor.sql
index 47cd0bc3..d565b7ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_reset_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/alter_unique_reset_fillfactor.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#a
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#a";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#a" UNIQUE (col1)
     DEFERRABLE INITIALLY DEFERRED;
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint.sql
index 2f2c493e..9ea9f9c8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
     WITH (FILLFACTOR=20)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_msql.sql
index 6f65d212..1f66bf74 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
     WITH (FILLFACTOR=20)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index.sql
index c6da21c4..02a1113a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: Pk_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_primary_key_cons DROP CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons DROP CONSTRAINT IF EXISTS "Pk_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY (col1)
     WITH (FILLFACTOR=20);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index_msql.sql
index bdbb820c..ff467215 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_pkey_constraint_with_index_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_primary_key_cons
+ALTER TABLE IF EXISTS testschema.tablefor_primary_key_cons
     ADD CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" PRIMARY KEY USING INDEX uindex;
 
 COMMENT ON CONSTRAINT "Pk_$%{}[]()&*^!@""'`\/#" ON testschema.tablefor_primary_key_cons
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint.sql
index c720c210..4d939234 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE (col1)
     WITH (FILLFACTOR=20)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_msql.sql
index fb47fd94..41fd55af 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE (col1)
     WITH (FILLFACTOR=20)
     DEFERRABLE INITIALLY DEFERRED;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index.sql
index 83c3e289..76fd9e54 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index.sql
@@ -1,8 +1,8 @@
 -- Constraint: UC_$%{}[]()&*^!@"'`\/#
 
--- ALTER TABLE testschema.tablefor_unique_cons DROP CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#";
+-- ALTER TABLE IF EXISTS testschema.tablefor_unique_cons DROP CONSTRAINT IF EXISTS "UC_$%{}[]()&*^!@""'`\/#";
 
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE (col1)
     WITH (FILLFACTOR=20);
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index_msql.sql
index bb1f7c65..7025378c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/tests/default/create_unique_constraint_with_index_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE testschema.tablefor_unique_cons
+ALTER TABLE IF EXISTS testschema.tablefor_unique_cons
     ADD CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" UNIQUE USING INDEX uindex;
 
 COMMENT ON CONSTRAINT "UC_$%{}[]()&*^!@""'`\/#" ON testschema.tablefor_unique_cons
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment.sql
index e6b08e84..3171aaff 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment.sql
@@ -1,14 +1,14 @@
 -- Index: Idx1_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx1_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx1_$%{}[]()&*^!@""'`\/#";
 
-CREATE UNIQUE INDEX "Idx1_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx1_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST)
     WITH (FILLFACTOR=10)
     TABLESPACE pg_default;
 
-ALTER TABLE public.test_table_for_indexes
+ALTER TABLE IF EXISTS public.test_table_for_indexes
     CLUSTER ON "Idx1_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON INDEX public."Idx1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment_msql.sql
index 04740888..36c4698c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_name_fillfactor_comment_msql.sql
@@ -1,10 +1,10 @@
-ALTER INDEX public."Idx_$%{}[]()&*^!@""'`\/#"
+ALTER INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#"
     RENAME TO "Idx1_$%{}[]()&*^!@""'`\/#";
 
-ALTER INDEX public."Idx1_$%{}[]()&*^!@""'`\/#"
+ALTER INDEX IF EXISTS public."Idx1_$%{}[]()&*^!@""'`\/#"
     SET (FILLFACTOR=10);
 
-ALTER TABLE public.test_table_for_indexes
+ALTER TABLE IF EXISTS public.test_table_for_indexes
     CLUSTER ON "Idx1_$%{}[]()&*^!@""'`\/#";
 
 COMMENT ON INDEX public."Idx1_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster.sql
index 58fdcade..1c559ed5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster.sql
@@ -1,8 +1,8 @@
 -- Index: Idx1_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx1_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx1_$%{}[]()&*^!@""'`\/#";
 
-CREATE UNIQUE INDEX "Idx1_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx1_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST)
     TABLESPACE pg_default;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster_msql.sql
index fe5da6af..8dc34b2e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/alter_reset_fillfactor_cluster_msql.sql
@@ -1,5 +1,5 @@
-ALTER INDEX public."Idx1_$%{}[]()&*^!@""'`\/#"
+ALTER INDEX IF EXISTS public."Idx1_$%{}[]()&*^!@""'`\/#"
     RESET (FILLFACTOR);
 
-ALTER TABLE public.test_table_for_indexes
+ALTER TABLE IF EXISTS public.test_table_for_indexes
     SET WITHOUT CLUSTER;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first.sql
index 6e0f9bc0..3d749282 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first.sql
@@ -1,8 +1,8 @@
 -- Index: Idx_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#";
 
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id ASC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS FIRST)
     WITH (FILLFACTOR=10)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first_msql.sql
index d232de21..389593af 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_first_msql.sql
@@ -1,4 +1,4 @@
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id ASC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS FIRST)
     WITH (FILLFACTOR=10)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last.sql
index 12526073..951152c6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last.sql
@@ -1,8 +1,8 @@
 -- Index: Idx_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#";
 
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST)
     WITH (FILLFACTOR=10)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last_msql.sql
index df340aae..8b294349 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_asc_null_last_msql.sql
@@ -1,4 +1,4 @@
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id ASC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops ASC NULLS LAST)
     WITH (FILLFACTOR=10)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first.sql
index 8d8bc290..78fb0a1f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first.sql
@@ -1,8 +1,8 @@
 -- Index: Idx_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#";
 
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST)
     TABLESPACE pg_default;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first_msql.sql
index f7db5ea7..652fa0a3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_first_msql.sql
@@ -1,4 +1,4 @@
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id DESC NULLS FIRST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS FIRST)
     TABLESPACE pg_default;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last.sql
index 1f8515eb..5970fa9f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last.sql
@@ -1,8 +1,8 @@
 -- Index: Idx_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#";
 
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id DESC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS LAST)
     WITH (FILLFACTOR=10)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last_msql.sql
index 9e23286a..2e4096dd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_btree_desc_null_last_msql.sql
@@ -1,4 +1,4 @@
-CREATE UNIQUE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE UNIQUE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING btree
     (id DESC NULLS LAST, name COLLATE pg_catalog."POSIX" text_pattern_ops DESC NULLS LAST)
     WITH (FILLFACTOR=10)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql
index e02c4f0d..1f64067e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index.sql
@@ -1,8 +1,8 @@
 -- Index: Idx_$%{}[]()&*^!@"'`\/#
 
--- DROP INDEX public."Idx_$%{}[]()&*^!@""'`\/#";
+-- DROP INDEX IF EXISTS public."Idx_$%{}[]()&*^!@""'`\/#";
 
-CREATE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING hash
     (id)
     TABLESPACE pg_default;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index_msql.sql
index 14f012b4..c2d2b8e4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/default/create_hash_index_msql.sql
@@ -1,4 +1,4 @@
-CREATE INDEX "Idx_$%{}[]()&*^!@""'`\/#"
+CREATE INDEX IF NOT EXISTS "Idx_$%{}[]()&*^!@""'`\/#"
     ON public.test_table_for_indexes USING hash
     (id)
     TABLESPACE pg_default;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql
index 033f1d94..35bf35bb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/alter_table_add_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
@@ -11,7 +11,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
@@ -22,5 +22,5 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
 CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#"
     FOR VALUES FROM ('0') TO ('1000');
 
-ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#"
+ALTER TABLE IF EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#"
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql
index d13d4295..bff95812 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
@@ -11,7 +11,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql
index 4a1685f4..47801b79 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/10_plus/create_table_with_partition_msql.sql
@@ -6,7 +6,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql
index dde80481..2a8fd6d3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/alter_table_add_partition.sql
@@ -1,13 +1,13 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
     m_col bigint
 ) PARTITION BY RANGE (m_col);
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
@@ -18,5 +18,5 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
 CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#"
     FOR VALUES FROM ('0') TO ('1000');
 
-ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#"
+ALTER TABLE IF EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#"
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql
index 265d4090..8cab6c94 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition.sql
@@ -1,13 +1,13 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
     m_col bigint
 ) PARTITION BY RANGE (m_col);
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql
index c0d8eeef..48383df4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/pg/12_plus/create_table_with_partition_msql.sql
@@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     m_col bigint
 ) PARTITION BY RANGE (m_col);
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql
index 77416c67..18ab66b8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/alter_table_add_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
@@ -11,7 +11,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
@@ -22,5 +22,5 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
 CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#"
     FOR VALUES FROM ('0') TO ('1000');
 
-ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#"
+ALTER TABLE IF EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#"
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql
index db930c96..a89d6b7d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
@@ -11,7 +11,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql
index 460c2442..e5629763 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/10_plus/create_table_with_partition_msql.sql
@@ -6,7 +6,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql
index 2a7a6123..96e55c39 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/alter_table_add_partition.sql
@@ -1,13 +1,13 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
     m_col bigint
 ) PARTITION BY RANGE (m_col);
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
@@ -18,5 +18,5 @@ COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
 CREATE TABLE IF NOT EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#" PARTITION OF public."test_table_$%{}[]()&*^!@""""'`\/#"
     FOR VALUES FROM ('0') TO ('1000');
 
-ALTER TABLE public."test_part_$%{}[]()&*^!@""""""""'`\/#"
+ALTER TABLE IF EXISTS public."test_part_$%{}[]()&*^!@""""""""'`\/#"
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql
index c4c47178..c59e8fb5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition.sql
@@ -1,13 +1,13 @@
 -- Table: public.test_table_$%{}[]()&*^!@""'`\/#
 
--- DROP TABLE public."test_table_$%{}[]()&*^!@""""'`\/#";
+-- DROP TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
 (
     m_col bigint
 ) PARTITION BY RANGE (m_col);
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql
index 7aea9c84..bb61b515 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/tests/ppas/12_plus/create_table_with_partition_msql.sql
@@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     m_col bigint
 ) PARTITION BY RANGE (m_col);
 
-ALTER TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
+ALTER TABLE IF EXISTS public."test_table_$%{}[]()&*^!@""""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."test_table_$%{}[]()&*^!@""""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_delete_policy_with_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_delete_policy_with_using.sql
index 71bd2b58..befa16ad 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_delete_policy_with_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_delete_policy_with_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_policy.sql
index d625080e..6abe6065 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: policy_1
 
--- DROP POLICY policy_1 ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS policy_1 ON public.test_rls_policy;
 
 CREATE POLICY policy_1
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_select_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_select_policy.sql
index 6e8d8f22..93b0a3fe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_select_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_select_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_all_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_all_policy.sql
index a8c3bce6..bdeb6b0f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_all_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_all_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_all_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_insert_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_insert_policy.sql
index 6176d08d..6c3dba68 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_insert_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_simple_insert_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_update_policy_with_check_and_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_update_policy_with_check_and_using.sql
index 4f10bae5..d9e1b39a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_update_policy_with_check_and_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/alter_update_policy_with_check_and_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_all_event_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_all_event_policy.sql
index e0f8fc67..2cd29e0e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_all_event_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_all_event_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: all_event_policy
 
--- DROP POLICY all_event_policy ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS all_event_policy ON public.test_rls_policy;
 
 CREATE POLICY all_event_policy
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_delete_policy_with_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_delete_policy_with_using.sql
index da2d81e0..82e3f6c6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_delete_policy_with_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_delete_policy_with_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_public_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_public_policy.sql
index 4e43da3e..7b804033 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_public_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_public_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test
 
--- DROP POLICY test ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS test ON public.test_rls_policy;
 
 CREATE POLICY test
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_select_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_select_policy.sql
index 2d2f7e27..0dcf0ee8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_select_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_select_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_all_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_all_policy.sql
index be647dfc..06e9ed7a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_all_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_all_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_all_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_insert_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_insert_policy.sql
index 99d85686..746062fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_insert_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_simple_insert_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_update_policy_with_check_and_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_update_policy_with_check_and_using.sql
index c850b0ba..d39be28b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_update_policy_with_check_and_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/10_plus/create_update_policy_with_check_and_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_select_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_select_policy.sql
index 8d316312..63b6329d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_select_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_select_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_simple_insert_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_simple_insert_policy.sql
index 07ddc1bb..5f0c2705 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_simple_insert_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_simple_insert_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_update_policy_with_check_and_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_update_policy_with_check_and_using.sql
index 3ee49810..d7d27f80 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_update_policy_with_check_and_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/alter_update_policy_with_check_and_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/create_delete_policy_with_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/create_delete_policy_with_using.sql
index cdbe5872..3eb581c5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/create_delete_policy_with_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/12_plus/create_delete_policy_with_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_delete_policy_with_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_delete_policy_with_using.sql
index 7ec042fa..6adb34fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_delete_policy_with_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_delete_policy_with_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_select_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_select_policy.sql
index 72eb9417..dff804c8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_select_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_select_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_all_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_all_policy.sql
index 76748970..7cc807f7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_all_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_all_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_all_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_insert_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_insert_policy.sql
index 49ebd5d5..dd95496d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_insert_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_simple_insert_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_update_policy_with_check_and_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_update_policy_with_check_and_using.sql
index b7db9e25..fc26c4fe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_update_policy_with_check_and_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/alter_update_policy_with_check_and_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_delete_policy_with_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_delete_policy_with_using.sql
index 088e460d..874bf4bb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_delete_policy_with_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_delete_policy_with_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_delete_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_delete_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_select_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_select_policy.sql
index abc9328d..59a715e5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_select_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_select_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_select_policy_rls_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_select_policy_rls_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_select_policy_rls_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_all_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_all_policy.sql
index 2d468e4b..de2e3799 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_all_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_all_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_all_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_all_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_all_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_insert_policy.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_insert_policy.sql
index 8187596c..07c2390f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_insert_policy.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_simple_insert_policy.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_simple_insert_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_simple_insert_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_update_policy_with_check_and_using.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_update_policy_with_check_and_using.sql
index 4e1281cc..65afeeeb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_update_policy_with_check_and_using.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/default/create_update_policy_with_check_and_using.sql
@@ -1,6 +1,6 @@
 -- POLICY: test_update_rls_policy_$%{}[]()&*^!@"'`\/#
 
--- DROP POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
+-- DROP POLICY IF EXISTS "test_update_rls_policy_$%{}[]()&*^!@""'`\/#" ON public.test_rls_policy;
 
 CREATE POLICY "test_update_rls_policy_$%{}[]()&*^!@""'`\/#"
     ON public.test_rls_policy
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/create.sql
index 7b0bf087..1e095dbd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/create.sql
@@ -1,5 +1,5 @@
 {% if data %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} CHECK ({{ data.consrc }}){% if data.convalidated %}
 
     NOT VALID{% endif %}{% if data.connoinherit %} NO INHERIT{% endif %};
@@ -8,4 +8,4 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
 
 COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(data.schema, data.table) }}
     IS {{ data.comment|qtLiteral }};
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql
index da1c8efb..5a323c4d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/update.sql
@@ -1,13 +1,13 @@
 {% if data %}
 {% if data.name != o_data.name %}
-ALTER TABLE {{ conn|qtIdent(o_data.nspname, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(o_data.nspname, data.table) }}
     RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};{% endif -%}
 {% if 'convalidated' in data and o_data.convalidated != data.convalidated and not data.convalidated %}
 
-ALTER TABLE {{ conn|qtIdent(o_data.nspname, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(o_data.nspname, data.table) }}
     VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};{% endif -%}
 {% if data.comment is defined and data.comment != o_data.comment %}
 
 COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(o_data.nspname, data.table) }}
     IS {{ data.comment|qtLiteral }};{% endif %}
-{% endif -%}
\ No newline at end of file
+{% endif -%}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/validate.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/validate.sql
index 5a62c801..d447cf9a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/validate.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/9.2_plus/validate.sql
@@ -1,2 +1,2 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
-    VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};
\ No newline at end of file
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
+    VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/default/delete.sql
index 5a85b4f7..74511b5c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/check_constraint/sql/default/delete.sql
@@ -1,3 +1,3 @@
 {% if data %}
-ALTER TABLE {{ conn|qtIdent(data.nspname, data.relname) }} DROP CONSTRAINT {{ conn|qtIdent(data.name) }};
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.nspname, data.relname) }} DROP CONSTRAINT IF EXISTS {{ conn|qtIdent(data.name) }};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/create.sql
index c189a748..03db79b4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/create.sql
@@ -4,8 +4,8 @@
 {% import 'types/macros/get_full_type_sql_format.macros' as GET_TYPE %}
 {###  Add column ###}
 {% if data.name and  data.cltype %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
-    ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
+    ADD COLUMN IF NOT EXISTS {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
  COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
  NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' %}
  DEFAULT {{data.defval}}{% endif %}{% if data.colconstype == 'i' %}{% if data.attidentity and data.attidentity == 'a' %} GENERATED ALWAYS AS IDENTITY{% elif data.attidentity and data.attidentity == 'd' %} GENERATED BY DEFAULT AS IDENTITY{% endif %}
@@ -28,19 +28,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.table, data.name)}}
 {% endif %}
 {###  Add variables to column ###}
 {% if data.attoptions %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, data.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if data.attstattarget is defined and data.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if data.attstorage is defined and data.attstorage != data.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STORAGE {%if data.attstorage == 'p' %}
 PLAIN{% elif data.attstorage == 'm'%}MAIN{% elif data.attstorage == 'e'%}
 EXTERNAL{% elif data.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/update.sql
index aa09f4ec..dc9c6d9c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/10_plus/update.sql
@@ -4,7 +4,7 @@
 {% import 'types/macros/get_full_type_sql_format.macros' as GET_TYPE %}
 {###  Rename column name ###}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     RENAME {{conn|qtIdent(o_data.name)}} TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -26,19 +26,19 @@ ALTER VIEW {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET DEFAULT {{data.defval}};
 
 {% elif data.defval is defined and data.defval is not none and data.defval != '' and data.defval != o_data.defval %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET DEFAULT {{data.defval}};
 
 {% endif %}
 {###  Drop column default value ###}
 {% if data.defval is defined and (data.defval == '' or data.defval is none) and data.defval != o_data.defval %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} DROP DEFAULT;
 
 {% endif %}
 {###  Alter column not null value ###}
 {% if 'attnotnull' in data and data.attnotnull != o_data.attnotnull %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} {% if data.attnotnull %}SET{% else %}DROP{% endif %} NOT NULL;
 
 {% endif %}
@@ -47,7 +47,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% set attidentity_params = false %}{% endif %}
 {###  Alter column - add identity ###}
 {% if data.colconstype == 'i' and 'attidentity' in data and o_data.attidentity == '' and data.attidentity != o_data.attidentity %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} {% if data.attidentity == 'a' %}ADD GENERATED ALWAYS AS IDENTITY{% else%}ADD GENERATED BY DEFAULT AS IDENTITY{% endif %}
 {% if data.seqincrement or data.seqcycle or data.seqincrement or data.seqstart or data.seqmin or data.seqmax or data.seqcache %} ( {% endif %}
 {% if data.seqcycle is defined and data.seqcycle %}
@@ -62,10 +62,10 @@ CACHE {{data.seqcache|int}} {% endif %}
 {###  Alter column - change identity - sequence options ###}
 {% elif 'attidentity' in data or attidentity_params %}
 {% if 'attidentity' in data and data.attidentity != '' and o_data.attidentity != '' and data.attidentity != o_data.attidentity %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET GENERATED {% if data.attidentity == 'a' %}ALWAYS{% else%}BY DEFAULT{% endif %}{% if attidentity_params == false %};{% endif %}
 {% elif attidentity_params %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %}{% endif %}
 {% if data.seqcycle %} SET CYCLE{% elif (data.seqcycle == False and o_data.seqcycle and data.seqcycle != o_data.seqcycle) %} SET NO CYCLE{% endif %}
 {% if data.seqincrement is defined and data.seqincrement|int(-1) > -1 %} SET INCREMENT {{data.seqincrement|int}}{% endif %}
@@ -78,19 +78,19 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {###  Alter column - drop identity when column constraint is changed###}
 {% if 'colconstype' in data and data.colconstype == 'n' and 'colconstype' in o_data and o_data.colconstype == 'i' %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} DROP IDENTITY;
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if data.attstattarget is defined and data.attstattarget != o_data.attstattarget %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET STATISTICS {{data.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if data.attstorage is defined and data.attstorage != o_data.attstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET STORAGE {%if data.attstorage == 'p' %}
 PLAIN{% elif data.attstorage == 'm'%}MAIN{% elif data.attstorage == 'e'%}
 EXTERNAL{% elif data.attstorage == 'x'%}EXTENDED{% endif %};
@@ -109,7 +109,7 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.table, o_data.name)}}
 {% if 'attoptions' in data and data.attoptions != None and data.attoptions|length > 0 %}
 {% set variables = data.attoptions %}
 {% if 'deleted' in variables and variables.deleted|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.UNSET(conn, 'COLUMN', data.name, variables.deleted) }}
 {% else %}
@@ -117,7 +117,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {% endif %}
 {% if 'added' in variables and variables.added|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, variables.added) }}
 {% else %}
@@ -125,7 +125,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {% endif %}
 {% if 'changed' in variables and variables.changed|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, variables.changed) }}
 {% else %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/12_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/12_plus/create.sql
index 19e26f2c..1929705a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/12_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/12_plus/create.sql
@@ -4,7 +4,7 @@
 {% import 'types/macros/get_full_type_sql_format.macros' as GET_TYPE %}
 {###  Add column ###}
 {% if data.name and  data.cltype %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
  COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
  NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' and data.colconstype != 'g' %}
@@ -28,19 +28,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.table, data.name)}}
 {% endif %}
 {###  Add variables to column ###}
 {% if data.attoptions %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, data.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if data.attstattarget is defined and data.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if data.attstorage is defined and data.attstorage != data.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STORAGE {%if data.attstorage == 'p' %}
 PLAIN{% elif data.attstorage == 'm'%}MAIN{% elif data.attstorage == 'e'%}
 EXTERNAL{% elif data.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/9.2_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/9.2_plus/update.sql
index 708a266d..7443eeff 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/9.2_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/9.2_plus/update.sql
@@ -4,7 +4,7 @@
 {% import 'types/macros/get_full_type_sql_format.macros' as GET_TYPE %}
 {###  Rename column name ###}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     RENAME {{conn|qtIdent(o_data.name)}} TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -22,35 +22,35 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {###  Alter column default value ###}
 {% if is_view_only and data.defval is defined and data.defval is not none and data.defval != '' and data.defval != o_data.defval %}
-ALTER VIEW {{conn|qtIdent(data.schema, data.table)}}
+ALTER VIEW IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET DEFAULT {{data.defval}};
 
 {% elif data.defval is defined and data.defval is not none and data.defval != '' and data.defval != o_data.defval %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET DEFAULT {{data.defval}};
 
 {% endif %}
 {###  Drop column default value ###}
 {% if data.defval is defined and (data.defval == '' or data.defval is none) and data.defval != o_data.defval %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} DROP DEFAULT;
 
 {% endif %}
 {###  Alter column not null value ###}
 {% if 'attnotnull' in data and data.attnotnull != o_data.attnotnull %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} {% if data.attnotnull %}SET{% else %}DROP{% endif %} NOT NULL;
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if data.attstattarget is defined and data.attstattarget != o_data.attstattarget %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET STATISTICS {{data.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if data.attstorage is defined and data.attstorage != o_data.attstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET STORAGE {%if data.attstorage == 'p' %}
 PLAIN{% elif data.attstorage == 'm'%}MAIN{% elif data.attstorage == 'e'%}
 EXTERNAL{% elif data.attstorage == 'x'%}EXTENDED{% endif %};
@@ -69,7 +69,7 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.table, o_data.name)}}
 {% if 'attoptions' in data and data.attoptions != None and data.attoptions|length > 0 %}
 {% set variables = data.attoptions %}
 {% if 'deleted' in variables and variables.deleted|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.UNSET(conn, 'COLUMN', data.name, variables.deleted) }}
 {% else %}
@@ -77,7 +77,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {% endif %}
 {% if 'added' in variables and variables.added|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, variables.added) }}
 {% else %}
@@ -85,7 +85,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {% endif %}
 {% if 'changed' in variables and variables.changed|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, variables.changed) }}
 {% else %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/create.sql
index ed7f5f1c..a0aa19db 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/create.sql
@@ -4,8 +4,8 @@
 {% import 'types/macros/get_full_type_sql_format.macros' as GET_TYPE %}
 {###  Add column ###}
 {% if data.name and  data.cltype %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
-    ADD COLUMN {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
+    ADD COLUMN IF NOT EXISTS {{conn|qtIdent(data.name)}} {% if is_sql %}{{data.displaytypname}}{% else %}{{ GET_TYPE.CREATE_TYPE_SQL(conn, data.cltype, data.attlen, data.attprecision, data.hasSqrBracket) }}{% endif %}{% if data.collspcname %}
  COLLATE {{data.collspcname}}{% endif %}{% if data.attnotnull %}
  NOT NULL{% endif %}{% if data.defval is defined and data.defval is not none and data.defval != '' %}
  DEFAULT {{data.defval}}{% endif %};
@@ -19,19 +19,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.table, data.name)}}
 {% endif %}
 {###  Add variables to column ###}
 {% if data.attoptions %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, data.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if data.attstattarget is defined and data.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STATISTICS {{data.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if data.attstorage is defined and data.attstorage != data.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {{conn|qtTypeIdent(data.name)}} SET STORAGE {%if data.attstorage == 'p' %}
 PLAIN{% elif data.attstorage == 'm'%}MAIN{% elif data.attstorage == 'e'%}
 EXTERNAL{% elif data.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/delete.sql
index 0e16251b..6102c682 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/delete.sql
@@ -1 +1 @@
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}} DROP COLUMN {{conn|qtIdent(data.name)}};
\ No newline at end of file
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}} DROP COLUMN IF EXISTS {{conn|qtIdent(data.name)}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/update.sql
index 05702cc5..6a0741ec 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/update.sql
@@ -4,7 +4,7 @@
 {% import 'types/macros/get_full_type_sql_format.macros' as GET_TYPE %}
 {###  Rename column name ###}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     RENAME {{conn|qtIdent(o_data.name)}} TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -22,31 +22,31 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {###  Alter column default value ###}
 {% if data.defval is defined and data.defval is not none and data.defval != '' and data.defval != o_data.defval %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET DEFAULT {{data.defval}};
 
 {% endif %}
 {###  Drop column default value ###}
 {% if data.defval is defined and data.defval == '' and data.defval != o_data.defval %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} DROP DEFAULT;
 
 {% endif %}
 {###  Alter column not null value ###}
 {% if 'attnotnull' in data and data.attnotnull != o_data.attnotnull %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} {% if data.attnotnull %}SET{% else %}DROP{% endif %} NOT NULL;
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if data.attstattarget is defined and data.attstattarget != o_data.attstattarget %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET STATISTICS {{data.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if data.attstorage is defined and data.attstorage != o_data.attstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} SET STORAGE {%if data.attstorage == 'p' %}
 PLAIN{% elif data.attstorage == 'm'%}MAIN{% elif data.attstorage == 'e'%}
 EXTERNAL{% elif data.attstorage == 'x'%}EXTENDED{% endif %};
@@ -65,7 +65,7 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.table, o_data.name)}}
 {% if 'attoptions' in data and data.attoptions|length > 0 %}
 {% set variables = data.attoptions %}
 {% if 'deleted' in variables and variables.deleted|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.UNSET(conn, 'COLUMN', data.name, variables.deleted) }}
 {% else %}
@@ -73,7 +73,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {% endif %}
 {% if 'added' in variables and variables.added|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, variables.added) }}
 {% else %}
@@ -81,7 +81,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
 {% endif %}
 {% endif %}
 {% if 'changed' in variables and variables.changed|length > 0 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
 {% if data.name %}
     {{ VARIABLE.SET(conn, 'COLUMN', data.name, variables.changed) }}
 {% else %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/delete.sql
index 4c6e82b2..0a916a19 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/delete.sql
@@ -1 +1 @@
-DROP TRIGGER {{conn|qtIdent(data.name)}} ON {{conn|qtIdent(data.nspname, data.relname )}}{% if cascade %} CASCADE{% endif %};
\ No newline at end of file
+DROP TRIGGER IF EXISTS {{conn|qtIdent(data.name)}} ON {{conn|qtIdent(data.nspname, data.relname )}}{% if cascade %} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/update.sql
index 6a229852..30f2a657 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/compound_triggers/sql/ppas/12_plus/update.sql
@@ -39,6 +39,6 @@ COMMENT ON TRIGGER {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(o_data.nspna
 {% endif %}
 {% if data.is_enable_trigger is defined  and o_data.is_enable_trigger != data.is_enable_trigger %}
 {% set enable_map = {'R':'ENABLE REPLICA', 'A':'ENABLE ALWAYS', 'O':'ENABLE', 'D':'DISABLE'} %}
-ALTER TABLE {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
     {{ enable_map[data.is_enable_trigger] }} TRIGGER {{ conn|qtIdent(data.name) }};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/11_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/11_plus/create.sql
index ec1f9665..26f94490 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/11_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/11_plus/create.sql
@@ -1,4 +1,4 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} EXCLUDE {% if data.amname and data.amname != '' %}USING {{data.amname}}{% endif %} (
     {% for col in data.columns %}{% if loop.index != 1 %},
     {% endif %}{% if col.is_exp %}{{col.column}}{% else %}{{ conn|qtIdent(col.column)}}{% endif %}{% if col.oper_class and col.oper_class != '' %} {{col.oper_class}}{% endif%}{% if col.order is defined and col.is_sort_nulls_applicable %}{% if col.order %} ASC{% else %} DESC{% endif %} NULLS{% endif %} {% if col.nulls_order is defined and col.is_sort_nulls_applicable %}{% if col.nulls_order %}FIRST {% else %}LAST {% endif %}{% endif %}WITH {{col.operator}}{% endfor %}){% if data.include|length > 0 %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/create.sql
index 22b580f9..b943ecb0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/create.sql
@@ -1,4 +1,4 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} EXCLUDE {% if data.amname and data.amname != '' %}USING {{data.amname}}{% endif %} (
     {% for col in data.columns %}{% if loop.index != 1 %},
     {% endif %}{% if col.is_exp %}{{col.column}}{% else %}{{ conn|qtIdent(col.column)}}{% endif %}{% if col.oper_class and col.oper_class != '' %} {{col.oper_class}}{% endif%}{% if col.order is defined and col.is_sort_nulls_applicable %}{% if col.order %} ASC{% else %} DESC{% endif %} NULLS{% endif %} {% if col.nulls_order is defined and col.is_sort_nulls_applicable %}{% if col.nulls_order %}FIRST {% else %}LAST {% endif %}{% endif %}WITH {{col.operator}}{% endfor %}){% if data.fillfactor %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/delete.sql
index 20967957..5f456756 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/delete.sql
@@ -1,3 +1,3 @@
 {% if data %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }} DROP CONSTRAINT {{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
-{% endif %}
\ No newline at end of file
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }} DROP CONSTRAINT IF EXISTS {{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/update.sql
index 0a8fa9c9..cd57cbb3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/exclusion_constraint/sql/default/update.sql
@@ -2,20 +2,20 @@
 {% if data %}
 {# ==== To update exclusion constraint name ==== #}
 {% if data.name != o_data.name %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};
 {% endif %}
 {# ==== To update exclusion constraint tablespace ==== #}
 {% if data.spcname and data.spcname != o_data.spcname %}
-ALTER INDEX {{ conn|qtIdent(data.schema, data.name) }}
+ALTER INDEX IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     SET TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {% endif %}
 {% if data.fillfactor and data.fillfactor != o_data.fillfactor %}
-ALTER INDEX {{ conn|qtIdent(data.schema, data.name) }}
+ALTER INDEX IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     SET (FILLFACTOR={{ data.fillfactor }});
 {% endif %}
 {% if data.fillfactor == "" and data.fillfactor != o_data.fillfactor %}
-ALTER INDEX {{ conn|qtIdent(data.schema, data.name) }}
+ALTER INDEX IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     RESET (FILLFACTOR);
 {% endif %}
 {# ==== To update exclusion constraint comments ==== #}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create.sql
index c8dd96f8..6601e7ed 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create.sql
@@ -1,4 +1,4 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} FOREIGN KEY ({% for columnobj in data.columns %}{% if loop.index != 1 %}
 , {% endif %}{{ conn|qtIdent(columnobj.local_column)}}{% endfor %})
     REFERENCES {{ conn|qtIdent(data.remote_schema, data.remote_table) }} ({% for columnobj in data.columns %}{% if loop.index != 1 %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create_index.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create_index.sql
index dcc5a28a..ec789ee3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create_index.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/create_index.sql
@@ -1,5 +1,5 @@
 {% if data.autoindex and data.coveringindex%}
-CREATE INDEX {{ conn|qtIdent(data.coveringindex) }}
+CREATE INDEX IF NOT EXISTS {{ conn|qtIdent(data.coveringindex) }}
     ON {{ conn|qtIdent(data.schema, data.table) }}({% for columnobj in data.columns %}{% if loop.index != 1 %}
 , {% endif %}{{ conn|qtIdent(columnobj.local_column)}}{% endfor %});
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/delete.sql
index 20967957..5f456756 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/delete.sql
@@ -1,3 +1,3 @@
 {% if data %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }} DROP CONSTRAINT {{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
-{% endif %}
\ No newline at end of file
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }} DROP CONSTRAINT IF EXISTS {{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/update.sql
index 149c1e74..321ad513 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/update.sql
@@ -2,13 +2,13 @@
 {% if data %}
 {# ==== To update foreign key name ==== #}
 {% if data.name != o_data.name %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};
 
 {% endif %}
 {# ==== To update foreign key validate ==== #}
 {% if 'convalidated' in data and o_data.convalidated != data.convalidated and data.convalidated %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};
 
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/validate.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/validate.sql
index 5a62c801..d447cf9a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/validate.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/foreign_key/sql/default/validate.sql
@@ -1,2 +1,2 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
-    VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};
\ No newline at end of file
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
+    VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql
index 8956cdc9..799a39cd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/11_plus/create.sql
@@ -1,4 +1,4 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} {{constraint_name}} {% if data.index %}USING INDEX {{ conn|qtIdent(data.index) }}{% else %}
 ({% for columnobj in data.columns %}{% if loop.index != 1 %}
 , {% endif %}{{ conn|qtIdent(columnobj.column)}}{% endfor %}){% if data.include|length > 0 %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql
index c83dd99f..0a46c4e9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/create.sql
@@ -1,4 +1,4 @@
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }}
     ADD{% if data.name %} CONSTRAINT {{ conn|qtIdent(data.name) }}{% endif%} {{constraint_name}} {% if data.index %}USING INDEX {{ conn|qtIdent(data.index) }}{% else %}
 ({% for columnobj in data.columns %}{% if loop.index != 1 %}
 , {% endif %}{{ conn|qtIdent(columnobj.column)}}{% endfor %}){% if data.fillfactor %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/delete.sql
index 20967957..5f456756 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/default/delete.sql
@@ -1,3 +1,3 @@
 {% if data %}
-ALTER TABLE {{ conn|qtIdent(data.schema, data.table) }} DROP CONSTRAINT {{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
-{% endif %}
\ No newline at end of file
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.table) }} DROP CONSTRAINT IF EXISTS {{ conn|qtIdent(data.name) }}{% if cascade%} CASCADE{% endif %};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/create.sql
index 119e5895..98ac72be 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/11_plus/create.sql
@@ -1,4 +1,4 @@
-CREATE {% if data.indisunique %}UNIQUE {% endif %}INDEX {% if data.isconcurrent %}CONCURRENTLY {% endif %}{{conn|qtIdent(data.name)}}
+CREATE {% if data.indisunique %}UNIQUE {% endif %}INDEX IF NOT EXISTS {% if data.isconcurrent %}CONCURRENTLY {% endif %}{{conn|qtIdent(data.name)}}
     ON {{conn|qtIdent(data.schema, data.table)}} {% if data.amname %}USING {{conn|qtIdent(data.amname)}}{% endif %}
 
 {% if mode == 'create' %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/alter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/alter.sql
index 708583cc..50371e9e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/alter.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/alter.sql
@@ -1,11 +1,11 @@
 {## Alter index to use cluster type ##}
 {% if data.indisclustered %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     CLUSTER ON {{conn|qtIdent(data.name)}};
 {% endif %}
 {## Changes description ##}
 {% if data.description is defined and data.description %}
 
 COMMENT ON INDEX {{conn|qtIdent(data.schema, data.name)}}
-    IS {{data.description|qtLiteral}};{% endif %}
\ No newline at end of file
+    IS {{data.description|qtLiteral}};{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/create.sql
index 2ed40105..9952aa5f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/create.sql
@@ -1,4 +1,4 @@
-CREATE {% if data.indisunique %}UNIQUE {% endif %}INDEX {% if data.isconcurrent %}CONCURRENTLY {% endif %}{{conn|qtIdent(data.name)}}
+CREATE {% if data.indisunique %}UNIQUE {% endif %}INDEX IF NOT EXISTS {% if data.isconcurrent %}CONCURRENTLY {% endif %}{{conn|qtIdent(data.name)}}
     ON {{conn|qtIdent(data.schema, data.table)}} {% if data.amname %}USING {{conn|qtIdent(data.amname)}}{% endif %}
 
 {% if mode == 'create' %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/delete.sql
index f3808faa..bb059c78 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/delete.sql
@@ -1 +1 @@
-DROP INDEX {{conn|qtIdent(data.nspname, data.name)}}{% if cascade %} cascade{% endif %};
\ No newline at end of file
+DROP INDEX IF EXISTS {{conn|qtIdent(data.nspname, data.name)}}{% if cascade %} cascade{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/update.sql
index 2e401d9d..2748cd9f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/update.sql
@@ -1,33 +1,33 @@
 {## Changes name ##}
 {% if data.name and o_data.name != data.name %}
-ALTER INDEX {{conn|qtIdent(data.schema, o_data.name)}}
+ALTER INDEX IF EXISTS {{conn|qtIdent(data.schema, o_data.name)}}
     RENAME TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
 {## Changes fillfactor ##}
 {% if data.fillfactor and o_data.fillfactor != data.fillfactor %}
-ALTER INDEX {{conn|qtIdent(data.schema, data.name)}}
+ALTER INDEX IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (FILLFACTOR={{data.fillfactor}});
 
 {% elif (data.fillfactor == '' or data.fillfactor == None) and o_data.fillfactor|default('', 'true') != data.fillfactor %}
-ALTER INDEX {{conn|qtIdent(data.schema, data.name)}}
+ALTER INDEX IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (FILLFACTOR);
 
 {% endif %}
 {## Changes tablespace ##}
 {% if data.spcname and o_data.spcname != data.spcname %}
-ALTER INDEX {{conn|qtIdent(data.schema, data.name)}}
+ALTER INDEX IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET TABLESPACE {{conn|qtIdent(data.spcname)}};
 
 {% endif %}
 {## Alter index to use cluster type ##}
 {% if data.indisclustered is defined and o_data.indisclustered != data.indisclustered %}
 {% if data.indisclustered %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     CLUSTER ON {{conn|qtIdent(data.name)}};
 
 {% else %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.table)}}
     SET WITHOUT CLUSTER;
 
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/attach.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/attach.sql
index 0661d9cf..710eb056 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/attach.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/attach.sql
@@ -1,2 +1,2 @@
-ALTER TABLE {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} ATTACH PARTITION {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} ATTACH PARTITION {{conn|qtIdent(data.schema, data.name)}}
     {{ data.partition_value }};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql
index 7cc14012..d68c955e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql
@@ -57,7 +57,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 {### SQL for COMMENT ###}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/detach.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/detach.sql
index 4b413db1..3d35e872 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/detach.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/detach.sql
@@ -1 +1 @@
-ALTER TABLE {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} DETACH PARTITION {{conn|qtIdent(data.schema, data.name)}};
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} DETACH PARTITION {{conn|qtIdent(data.schema, data.name)}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/partition_diff.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/partition_diff.sql
index fed36f2b..7cbf9573 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/partition_diff.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/partition_diff.sql
@@ -1,4 +1,4 @@
-CREATE TABLE {{conn|qtIdent(data.schema, data.name)}} (
+CREATE TABLE IF NOT EXISTS {{conn|qtIdent(data.schema, data.name)}} (
     LIKE {{conn|qtIdent(data.schema, data.orig_name)}} INCLUDING ALL
 ) PARTITION BY {{ data.partition_scheme }};
 {{partition_sql}}
@@ -12,11 +12,11 @@ SELECT {% if data.columns and data.columns|length > 0 %}{% for c in data.columns
 {% for part in partition_data.partitions %}
 DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, part.partition_name)}};
 
-ALTER TABLE {{conn|qtIdent(data.schema, part.temp_partition_name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, part.temp_partition_name)}}
     RENAME TO {{conn|qtIdent(part.partition_name)}};
 
 {% endfor %}{% endif %}
-DROP TABLE {{conn|qtIdent(data.schema, data.orig_name)}};
+DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, data.orig_name)}};
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RENAME TO {{data.orig_name}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/11_plus/partition_diff.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/11_plus/partition_diff.sql
index bfc063c0..ab65e87f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/11_plus/partition_diff.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/11_plus/partition_diff.sql
@@ -1,4 +1,4 @@
-CREATE TABLE {{conn|qtIdent(data.schema, data.name)}} (
+CREATE TABLE IF NOT EXISTS {{conn|qtIdent(data.schema, data.name)}} (
     LIKE {{conn|qtIdent(data.schema, data.orig_name)}} INCLUDING ALL
 ) PARTITION BY {{ data.partition_scheme }};
 {{partition_sql}}{{partition_data.default_partition_header}}
@@ -14,11 +14,11 @@ SELECT {% if data.columns and data.columns|length > 0 %}{% for c in data.columns
 {% for part in partition_data.partitions %}
 DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, part.partition_name)}};
 
-ALTER TABLE {{conn|qtIdent(data.schema, part.temp_partition_name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, part.temp_partition_name)}}
     RENAME TO {{conn|qtIdent(part.partition_name)}};
 
 {% endfor %}{% endif %}
-DROP TABLE {{conn|qtIdent(data.schema, data.orig_name)}};
+DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, data.orig_name)}};
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RENAME TO {{data.orig_name}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/attach.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/attach.sql
index 0661d9cf..710eb056 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/attach.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/attach.sql
@@ -1,2 +1,2 @@
-ALTER TABLE {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} ATTACH PARTITION {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} ATTACH PARTITION {{conn|qtIdent(data.schema, data.name)}}
     {{ data.partition_value }};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql
index cefbf4f8..c4dac5b5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql
@@ -55,7 +55,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 {### SQL for COMMENT ###}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/detach.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/detach.sql
index 4b413db1..3d35e872 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/detach.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/detach.sql
@@ -1 +1 @@
-ALTER TABLE {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} DETACH PARTITION {{conn|qtIdent(data.schema, data.name)}};
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.parent_schema, data.partitioned_table_name)}} DETACH PARTITION {{conn|qtIdent(data.schema, data.name)}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/partition_diff.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/partition_diff.sql
index fed36f2b..7cbf9573 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/partition_diff.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/partition_diff.sql
@@ -1,4 +1,4 @@
-CREATE TABLE {{conn|qtIdent(data.schema, data.name)}} (
+CREATE TABLE IF NOT EXISTS {{conn|qtIdent(data.schema, data.name)}} (
     LIKE {{conn|qtIdent(data.schema, data.orig_name)}} INCLUDING ALL
 ) PARTITION BY {{ data.partition_scheme }};
 {{partition_sql}}
@@ -12,11 +12,11 @@ SELECT {% if data.columns and data.columns|length > 0 %}{% for c in data.columns
 {% for part in partition_data.partitions %}
 DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, part.partition_name)}};
 
-ALTER TABLE {{conn|qtIdent(data.schema, part.temp_partition_name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, part.temp_partition_name)}}
     RENAME TO {{conn|qtIdent(part.partition_name)}};
 
 {% endfor %}{% endif %}
-DROP TABLE {{conn|qtIdent(data.schema, data.orig_name)}};
+DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, data.orig_name)}};
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RENAME TO {{data.orig_name}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/delete.sql
index 586e114b..ffe32a05 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/9.5_plus/delete.sql
@@ -1 +1 @@
-DROP POLICY {{ conn|qtIdent(policy_name) }} ON {{conn|qtIdent(result.schema, result.table)}};
+DROP POLICY IF EXISTS {{ conn|qtIdent(policy_name) }} ON {{conn|qtIdent(result.schema, result.table)}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/delete.sql
index 586e114b..ffe32a05 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/row_security_policies/sql/default/delete.sql
@@ -1 +1 @@
-DROP POLICY {{ conn|qtIdent(policy_name) }} ON {{conn|qtIdent(result.schema, result.table)}};
+DROP POLICY IF EXISTS {{ conn|qtIdent(policy_name) }} ON {{conn|qtIdent(result.schema, result.table)}};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/delete.sql
index 227d84a1..6d92d9b6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/delete.sql
@@ -12,5 +12,5 @@ WHERE
     rw.oid={{ rid }};
 {% endif %}
 {% if rulename and relname and nspname %}
-DROP RULE {{ conn|qtIdent(rulename) }} ON {{ conn|qtIdent(nspname, relname) }} {% if cascade %} CASCADE {% endif %};
+DROP RULE IF EXISTS {{ conn|qtIdent(rulename) }} ON {{ conn|qtIdent(nspname, relname) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/create.sql
index a6f02cd7..0e61d152 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/create.sql
@@ -101,7 +101,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 
@@ -109,7 +109,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -117,7 +117,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -156,19 +156,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.name, c.name)}}
 {###  Add variables to column ###}
 {% if c.attoptions and c.attoptions|length > 0 %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     {{ VARIABLE.SET(conn, 'COLUMN', c.name, c.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if c.attstattarget is defined and c.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if c.attstorage is defined and c.attstorage != c.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STORAGE {%if c.attstorage == 'p' %}
 PLAIN{% elif c.attstorage == 'm'%}MAIN{% elif c.attstorage == 'e'%}
 EXTERNAL{% elif c.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/update.sql
index f42b1c7d..fb1ffda3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/10_plus/update.sql
@@ -5,7 +5,7 @@
 {## Rename table ##}
 {#####################################################}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, o_data.name)}}
     RENAME TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -13,7 +13,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
 {## Change table schema ##}
 {#####################################################}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, data.name)}}
   SET SCHEMA {{conn|qtIdent(data.schema)}};
 
 {% endif %}
@@ -21,7 +21,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
 {## Change table owner ##}
 {#####################################################}
 {% if data.relowner and data.relowner != o_data.relowner %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER TO {{conn|qtIdent(data.relowner)}};
 
 {% endif %}
@@ -30,14 +30,14 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {#####################################################}
 {% if data.coll_inherits_added|length > 0 %}
 {% for val in data.coll_inherits_added %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     INHERIT {{val}};
 
 {% endfor %}
 {% endif %}
 {% if data.coll_inherits_removed|length > 0 %}
 {% for val in data.coll_inherits_removed %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO INHERIT {{val}};
 
 {% endfor %}
@@ -46,7 +46,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change hasOID attribute of table ##}
 {#####################################################}
 {% if data.relhasoids is defined and data.relhasoids != o_data.relhasoids %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET {% if data.relhasoids %}WITH{% else %}WITHOUT{% endif %} OIDS;
 
 {% endif %}
@@ -54,7 +54,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change tablespace ##}
 {#####################################################}
 {% if data.spcname and data.spcname != o_data.spcname %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET TABLESPACE {{conn|qtIdent(data.spcname)}};
 
 {% endif %}
@@ -62,10 +62,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change fillfactor settings ##}
 {#####################################################}
 {% if data.fillfactor and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (FILLFACTOR={{data.fillfactor}});
 {% elif (data.fillfactor == '' or data.fillfactor == None) and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (FILLFACTOR);
 
 {% endif %}
@@ -79,7 +79,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set has_vacuum_reset = true %}
 {% endif %}
 {% if o_data.autovacuum_custom and data.autovacuum_custom == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     autovacuum_enabled,
     autovacuum_analyze_scale_factor,
     autovacuum_analyze_threshold,
@@ -93,7 +93,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_set %},
 {% endif %}
@@ -109,7 +109,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.autovacuum_enabled == 'x' and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.autovacuum_enabled =='x' and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled{% if has_vacuum_reset %},
 {% endif %}
@@ -130,10 +130,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% elif  data.rlspolicy is defined and data.rlspolicy != o_data.rlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     DISABLE ROW LEVEL SECURITY;
 
 {% endif %}
@@ -142,10 +142,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% elif  data.forcerlspolicy is defined and data.forcerlspolicy != o_data.forcerlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -159,7 +159,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set has_vacuum_toast_reset = true %}
 {% endif %}
 {% if o_data.toast_autovacuum and data.toast_autovacuum == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     toast.autovacuum_enabled,
     toast.autovacuum_freeze_max_age,
     toast.autovacuum_vacuum_cost_delay,
@@ -173,7 +173,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled = {% if data.toast_autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_toast_set %},
 {% endif %}
@@ -189,7 +189,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled{% if has_vacuum_toast_reset %},
 {% endif %}
@@ -265,5 +265,5 @@ COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change replica identity ##}
 {#####################################################}
 {% if data.replica_identity and data.replica_identity != o_data.replica_identity %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/create.sql
index 9b7d7bb4..63f32ba5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/create.sql
@@ -102,7 +102,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 
@@ -110,7 +110,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -118,7 +118,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -157,19 +157,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.name, c.name)}}
 {###  Add variables to column ###}
 {% if c.attoptions and c.attoptions|length > 0 %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     {{ VARIABLE.SET(conn, 'COLUMN', c.name, c.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if c.attstattarget is defined and c.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if c.attstorage is defined and c.attstorage != c.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STORAGE {%if c.attstorage == 'p' %}
 PLAIN{% elif c.attstorage == 'm'%}MAIN{% elif c.attstorage == 'e'%}
 EXTERNAL{% elif c.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql
index dc1e6d61..e40d2e36 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/11_plus/update.sql
@@ -5,7 +5,7 @@
 {## Rename table ##}
 {#####################################################}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, o_data.name)}}
     RENAME TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -13,7 +13,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
 {## Change table schema ##}
 {#####################################################}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, data.name)}}
   SET SCHEMA {{conn|qtIdent(data.schema)}};
 
 {% endif %}
@@ -21,7 +21,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
 {## Change table owner ##}
 {#####################################################}
 {% if data.relowner and data.relowner != o_data.relowner %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER TO {{conn|qtIdent(data.relowner)}};
 
 {% endif %}
@@ -30,14 +30,14 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {#####################################################}
 {% if data.coll_inherits_added|length > 0 %}
 {% for val in data.coll_inherits_added %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     INHERIT {{val}};
 
 {% endfor %}
 {% endif %}
 {% if data.coll_inherits_removed|length > 0 %}
 {% for val in data.coll_inherits_removed %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO INHERIT {{val}};
 
 {% endfor %}
@@ -46,7 +46,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change hasOID attribute of table ##}
 {#####################################################}
 {% if data.relhasoids is defined and data.relhasoids != o_data.relhasoids %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET {% if data.relhasoids %}WITH{% else %}WITHOUT{% endif %} OIDS;
 
 {% endif %}
@@ -54,7 +54,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change tablespace ##}
 {#####################################################}
 {% if data.spcname and data.spcname != o_data.spcname %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET TABLESPACE {{conn|qtIdent(data.spcname)}};
 
 {% endif %}
@@ -62,10 +62,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change fillfactor settings ##}
 {#####################################################}
 {% if data.fillfactor and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (FILLFACTOR={{data.fillfactor}});
 {% elif (data.fillfactor == '' or data.fillfactor == None) and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (FILLFACTOR);
 
 {% endif %}
@@ -73,10 +73,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change parallel_workers settings ##}
 {#####################################################}
 {% if (data.parallel_workers == '' or data.parallel_workers == None) and data.parallel_workers != o_data.parallel_workers %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (parallel_workers);
 {% elif data.parallel_workers is defined and data.parallel_workers != o_data.parallel_workers %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (parallel_workers={{data.parallel_workers}});
 
 {% endif %}
@@ -84,10 +84,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change toast_tuple_target settings ##}
 {#####################################################}
 {% if (data.toast_tuple_target == '' or data.toast_tuple_target == None) and data.toast_tuple_target != o_data.toast_tuple_target %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (toast_tuple_target);
 {% elif data.toast_tuple_target is defined and data.toast_tuple_target != o_data.toast_tuple_target %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (toast_tuple_target={{data.toast_tuple_target}});
 
 {% endif %}
@@ -102,7 +102,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set has_vacuum_reset = true %}
 {% endif %}
 {% if o_data.autovacuum_custom and data.autovacuum_custom == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     autovacuum_enabled,
     autovacuum_analyze_scale_factor,
     autovacuum_analyze_threshold,
@@ -116,7 +116,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_set %},
 {% endif %}
@@ -132,7 +132,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.autovacuum_enabled == 'x' and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.autovacuum_enabled =='x' and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled{% if has_vacuum_reset %},
 {% endif %}
@@ -158,7 +158,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% set has_vacuum_toast_reset = true %}
 {% endif %}
 {% if o_data.toast_autovacuum and data.toast_autovacuum == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     toast.autovacuum_enabled,
     toast.autovacuum_freeze_max_age,
     toast.autovacuum_vacuum_cost_delay,
@@ -172,7 +172,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled = {% if data.toast_autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_toast_set %},
 {% endif %}
@@ -188,7 +188,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled{% if has_vacuum_toast_reset %},
 {% endif %}
@@ -217,10 +217,10 @@ COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% elif  data.rlspolicy is defined and data.rlspolicy != o_data.rlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     DISABLE ROW LEVEL SECURITY;
 
 {% endif %}
@@ -229,10 +229,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% elif  data.forcerlspolicy is defined and data.forcerlspolicy != o_data.forcerlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -287,5 +287,5 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change replica identity ##}
 {#####################################################}
 {% if data.replica_identity and data.replica_identity != o_data.replica_identity %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql
index 8fbbb571..cdcb6e1e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql
@@ -120,7 +120,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 
@@ -128,7 +128,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -136,7 +136,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -175,19 +175,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.name, c.name)}}
 {###  Add variables to column ###}
 {% if c.attoptions and c.attoptions|length > 0 %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     {{ VARIABLE.SET(conn, 'COLUMN', c.name, c.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if c.attstattarget is defined and c.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if c.attstorage is defined and c.attstorage != c.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STORAGE {%if c.attstorage == 'p' %}
 PLAIN{% elif c.attstorage == 'm'%}MAIN{% elif c.attstorage == 'e'%}
 EXTERNAL{% elif c.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/update.sql
index a90c3a6e..1b13269d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/update.sql
@@ -5,7 +5,7 @@
 {## Rename table ##}
 {#####################################################}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, o_data.name)}}
     RENAME TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -13,7 +13,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
 {## Change table schema ##}
 {#####################################################}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, data.name)}}
   SET SCHEMA {{conn|qtIdent(data.schema)}};
 
 {% endif %}
@@ -21,7 +21,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
 {## Change table owner ##}
 {#####################################################}
 {% if data.relowner and data.relowner != o_data.relowner %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER TO {{conn|qtIdent(data.relowner)}};
 
 {% endif %}
@@ -30,14 +30,14 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {#####################################################}
 {% if data.coll_inherits_added|length > 0 %}
 {% for val in data.coll_inherits_added %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     INHERIT {{val}};
 
 {% endfor %}
 {% endif %}
 {% if data.coll_inherits_removed|length > 0 %}
 {% for val in data.coll_inherits_removed %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO INHERIT {{val}};
 
 {% endfor %}
@@ -46,7 +46,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change tablespace ##}
 {#####################################################}
 {% if data.spcname and data.spcname != o_data.spcname %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET TABLESPACE {{conn|qtIdent(data.spcname)}};
 
 {% endif %}
@@ -56,10 +56,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% elif  data.rlspolicy is defined and data.rlspolicy != o_data.rlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     DISABLE ROW LEVEL SECURITY;
 
 {% endif %}
@@ -68,10 +68,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% elif  data.forcerlspolicy is defined and data.forcerlspolicy != o_data.forcerlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -79,10 +79,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change fillfactor settings ##}
 {#####################################################}
 {% if data.fillfactor and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (FILLFACTOR={{data.fillfactor}});
 {% elif (data.fillfactor == '' or data.fillfactor == None) and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (FILLFACTOR);
 
 {% endif %}
@@ -90,10 +90,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change parallel_workers settings ##}
 {#####################################################}
 {% if (data.parallel_workers == '' or data.parallel_workers == None) and data.parallel_workers != o_data.parallel_workers %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (parallel_workers);
 {% elif data.parallel_workers is defined and data.parallel_workers != o_data.parallel_workers %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (parallel_workers={{data.parallel_workers}});
 
 {% endif %}
@@ -101,10 +101,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change toast_tuple_target settings ##}
 {#####################################################}
 {% if (data.toast_tuple_target == '' or data.toast_tuple_target == None) and data.toast_tuple_target != o_data.toast_tuple_target %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (toast_tuple_target);
 {% elif data.toast_tuple_target is defined and data.toast_tuple_target != o_data.toast_tuple_target %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (toast_tuple_target={{data.toast_tuple_target}});
 
 {% endif %}
@@ -119,7 +119,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set has_vacuum_reset = true %}
 {% endif %}
 {% if o_data.autovacuum_custom and data.autovacuum_custom == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     autovacuum_enabled,
     autovacuum_analyze_scale_factor,
     autovacuum_analyze_threshold,
@@ -133,7 +133,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_set %},
 {% endif %}
@@ -149,7 +149,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.autovacuum_enabled == 'x' and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.autovacuum_enabled =='x' and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled{% if has_vacuum_reset %},
 {% endif %}
@@ -175,7 +175,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% set has_vacuum_toast_reset = true %}
 {% endif %}
 {% if o_data.toast_autovacuum and data.toast_autovacuum == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     toast.autovacuum_enabled,
     toast.autovacuum_freeze_max_age,
     toast.autovacuum_vacuum_cost_delay,
@@ -189,7 +189,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled = {% if data.toast_autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_toast_set %},
 {% endif %}
@@ -205,7 +205,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled{% if has_vacuum_toast_reset %},
 {% endif %}
@@ -280,5 +280,5 @@ COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change replica identity ##}
 {#####################################################}
 {% if data.replica_identity and data.replica_identity != o_data.replica_identity %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/create.sql
index b8073c65..718f99e7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/create.sql
@@ -89,7 +89,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 
@@ -98,7 +98,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -106,7 +106,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -145,19 +145,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.name, c.name)}}
 {###  Add variables to column ###}
 {% if c.attoptions and c.attoptions|length > 0 %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     {{ VARIABLE.SET(conn, 'COLUMN', c.name, c.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if c.attstattarget is defined and c.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if c.attstorage is defined and c.attstorage != c.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STORAGE {%if c.attstorage == 'p' %}
 PLAIN{% elif c.attstorage == 'm'%}MAIN{% elif c.attstorage == 'e'%}
 EXTERNAL{% elif c.attstorage == 'x'%}EXTENDED{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/update.sql
index 49a8aa3b..cac02fc9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/9.6_plus/update.sql
@@ -5,7 +5,7 @@
 {## Rename table ##}
 {#####################################################}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, o_data.name)}}
     RENAME TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -13,7 +13,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
 {## Change table schema ##}
 {#####################################################}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, data.name)}}
   SET SCHEMA {{conn|qtIdent(data.schema)}};
 
 {% endif %}
@@ -21,7 +21,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
 {## Change table owner ##}
 {#####################################################}
 {% if data.relowner and data.relowner != o_data.relowner %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER TO {{conn|qtIdent(data.relowner)}};
 
 {% endif %}
@@ -30,14 +30,14 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {#####################################################}
 {% if data.coll_inherits_added|length > 0 %}
 {% for val in data.coll_inherits_added %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     INHERIT {{val}};
 
 {% endfor %}
 {% endif %}
 {% if data.coll_inherits_removed|length > 0 %}
 {% for val in data.coll_inherits_removed %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO INHERIT {{val}};
 
 {% endfor %}
@@ -47,10 +47,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% elif  data.rlspolicy is defined and data.rlspolicy != o_data.rlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     DISABLE ROW LEVEL SECURITY;
 
 {% endif %}
@@ -59,10 +59,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% elif  data.forcerlspolicy is defined and data.forcerlspolicy != o_data.forcerlspolicy%}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO FORCE ROW LEVEL SECURITY;
 
 {% endif %}
@@ -71,7 +71,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change hasOID attribute of table ##}
 {#####################################################}
 {% if data.relhasoids is defined and data.relhasoids != o_data.relhasoids %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET {% if data.relhasoids %}WITH{% else %}WITHOUT{% endif %} OIDS;
 
 {% endif %}
@@ -79,7 +79,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change tablespace ##}
 {#####################################################}
 {% if data.spcname and data.spcname != o_data.spcname %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET TABLESPACE {{conn|qtIdent(data.spcname)}};
 
 {% endif %}
@@ -87,10 +87,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change fillfactor settings ##}
 {#####################################################}
 {% if data.fillfactor and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (FILLFACTOR={{data.fillfactor}});
 {% elif (data.fillfactor == '' or data.fillfactor == None) and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (FILLFACTOR);
 
 {% endif %}
@@ -98,10 +98,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change parallel_workers settings ##}
 {#####################################################}
 {% if (data.parallel_workers == '' or data.parallel_workers == None) and data.parallel_workers != o_data.parallel_workers %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (parallel_workers);
 {% elif data.parallel_workers is defined and data.parallel_workers != o_data.parallel_workers %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (parallel_workers={{data.parallel_workers}});
 
 {% endif %}
@@ -115,7 +115,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set has_vacuum_reset = true %}
 {% endif %}
 {% if o_data.autovacuum_custom and data.autovacuum_custom == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     autovacuum_enabled,
     autovacuum_analyze_scale_factor,
     autovacuum_analyze_threshold,
@@ -129,7 +129,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_set %},
 {% endif %}
@@ -145,7 +145,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.autovacuum_enabled == 'x' and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.autovacuum_enabled =='x' and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled{% if has_vacuum_reset %},
 {% endif %}
@@ -171,7 +171,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% set has_vacuum_toast_reset = true %}
 {% endif %}
 {% if o_data.toast_autovacuum and data.toast_autovacuum == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     toast.autovacuum_enabled,
     toast.autovacuum_freeze_max_age,
     toast.autovacuum_vacuum_cost_delay,
@@ -185,7 +185,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled = {% if data.toast_autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_toast_set %},
 {% endif %}
@@ -201,7 +201,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled{% if has_vacuum_toast_reset %},
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/create.sql
index a384629c..5a7dc4eb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/create.sql
@@ -88,7 +88,7 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }};
 {### Alter SQL for Owner ###}
 {% if data.relowner %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER to {{conn|qtIdent(data.relowner)}};
 {% endif %}
 {### Security Labels on Table ###}
@@ -126,19 +126,19 @@ COMMENT ON COLUMN {{conn|qtIdent(data.schema, data.name, c.name)}}
 {###  Add variables to column ###}
 {% if c.attoptions and c.attoptions|length > 0 %}
 
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     {{ VARIABLE.SET(conn, 'COLUMN', c.name, c.attoptions) }}
 
 {% endif %}
 {###  Alter column statistics value ###}
 {% if c.attstattarget is defined and c.attstattarget > -1 %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STATISTICS {{c.attstattarget}};
 
 {% endif %}
 {###  Alter column storage value ###}
 {% if c.attstorage is defined and c.attstorage != c.defaultstorage %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ALTER COLUMN {{conn|qtTypeIdent(c.name)}} SET STORAGE {%if c.attstorage == 'p' %}
 PLAIN{% elif c.attstorage == 'm'%}MAIN{% elif c.attstorage == 'e'%}
 EXTERNAL{% elif c.attstorage == 'x'%}EXTENDED{% endif %};
@@ -175,7 +175,7 @@ EXTERNAL{% elif c.attstorage == 'x'%}EXTENDED{% endif %};
 {## Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.rlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     ENABLE ROW LEVEL SECURITY;
 {% endif %}
 
@@ -183,6 +183,6 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Force Enable Row Level Security Policy on table ##}
 {#####################################################}
 {% if data.forcerlspolicy %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     FORCE ROW LEVEL SECURITY;
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/delete.sql
index 01d0314b..deb017b8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/delete.sql
@@ -1 +1 @@
-DROP TABLE {{conn|qtIdent(data.schema, data.name)}}{% if cascade %} CASCADE{% endif %};
\ No newline at end of file
+DROP TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}{% if cascade %} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql
index 0aaf9acc..7ba883b7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/default/update.sql
@@ -5,7 +5,7 @@
 {## Rename table ##}
 {#####################################################}
 {% if data.name and data.name != o_data.name %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, o_data.name)}}
     RENAME TO {{conn|qtIdent(data.name)}};
 
 {% endif %}
@@ -13,7 +13,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, o_data.name)}}
 {## Change table schema ##}
 {#####################################################}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(o_data.schema, data.name)}}
   SET SCHEMA {{conn|qtIdent(data.schema)}};
 
 {% endif %}
@@ -21,7 +21,7 @@ ALTER TABLE {{conn|qtIdent(o_data.schema, data.name)}}
 {## Change table owner ##}
 {#####################################################}
 {% if data.relowner and data.relowner != o_data.relowner %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     OWNER TO {{conn|qtIdent(data.relowner)}};
 
 {% endif %}
@@ -30,14 +30,14 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {#####################################################}
 {% if data.coll_inherits_added|length > 0 %}
 {% for val in data.coll_inherits_added %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     INHERIT {{val}};
 
 {% endfor %}
 {% endif %}
 {% if data.coll_inherits_removed|length > 0 %}
 {% for val in data.coll_inherits_removed %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     NO INHERIT {{val}};
 
 {% endfor %}
@@ -46,7 +46,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change hasOID attribute of table ##}
 {#####################################################}
 {% if data.relhasoids is defined and data.relhasoids != o_data.relhasoids %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET {% if data.relhasoids %}WITH{% else %}WITHOUT{% endif %} OIDS;
 
 {% endif %}
@@ -54,7 +54,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change tablespace ##}
 {#####################################################}
 {% if data.spcname and data.spcname != o_data.spcname %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET TABLESPACE {{conn|qtIdent(data.spcname)}};
 
 {% endif %}
@@ -62,10 +62,10 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## change fillfactor settings ##}
 {#####################################################}
 {% if data.fillfactor and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     SET (FILLFACTOR={{data.fillfactor}});
 {% elif (data.fillfactor == '' or data.fillfactor == None) and data.fillfactor != o_data.fillfactor %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}}
     RESET (FILLFACTOR);
 
 {% endif %}
@@ -79,7 +79,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}}
 {% set has_vacuum_reset = true %}
 {% endif %}
 {% if o_data.autovacuum_custom and data.autovacuum_custom == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     autovacuum_enabled,
     autovacuum_analyze_scale_factor,
     autovacuum_analyze_threshold,
@@ -93,7 +93,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.autovacuum_enabled in ('t', 'f') and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_set %},
 {% endif %}
@@ -109,7 +109,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.autovacuum_enabled == 'x' and data.autovacuum_enabled != o_data.autovacuum_enabled) or has_vacuum_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.autovacuum_enabled =='x' and data.autovacuum_enabled != o_data.autovacuum_enabled %}
     autovacuum_enabled{% if has_vacuum_reset %},
 {% endif %}
@@ -137,7 +137,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% set has_vacuum_toast_reset = true %}
 {% endif %}
 {% if o_data.toast_autovacuum and data.toast_autovacuum == false %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
     toast.autovacuum_enabled,
     toast.autovacuum_freeze_max_age,
     toast.autovacuum_vacuum_cost_delay,
@@ -151,7 +151,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
 );
 {% else %}
 {% if (data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_set %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} SET (
 {% if data.toast_autovacuum_enabled in ('t', 'f') and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled = {% if data.toast_autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if has_vacuum_toast_set %},
 {% endif %}
@@ -167,7 +167,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} SET (
 );
 {% endif %}
 {% if (data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled) or has_vacuum_toast_reset %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} RESET (
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} RESET (
 {% if data.toast_autovacuum_enabled == 'x' and data.toast_autovacuum_enabled != o_data.toast_autovacuum_enabled %}
     toast.autovacuum_enabled{% if has_vacuum_toast_reset %},
 {% endif %}
@@ -243,6 +243,6 @@ COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}}
 {## Change replica identity ##}
 {#####################################################}
 {% if data.replica_identity and data.replica_identity != o_data.replica_identity %}
-ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
+ALTER TABLE IF EXISTS {{conn|qtIdent(data.schema, data.name)}} REPLICA IDENTITY {{data.replica_identity }};
 {% endif %}
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/delete.sql
index 4c6e82b2..0a916a19 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/pg/default/delete.sql
@@ -1 +1 @@
-DROP TRIGGER {{conn|qtIdent(data.name)}} ON {{conn|qtIdent(data.nspname, data.relname )}}{% if cascade %} CASCADE{% endif %};
\ No newline at end of file
+DROP TRIGGER IF EXISTS {{conn|qtIdent(data.name)}} ON {{conn|qtIdent(data.nspname, data.relname )}}{% if cascade %} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/ppas/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/ppas/default/delete.sql
index 4c6e82b2..0a916a19 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/ppas/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/triggers/sql/ppas/default/delete.sql
@@ -1 +1 @@
-DROP TRIGGER {{conn|qtIdent(data.name)}} ON {{conn|qtIdent(data.nspname, data.relname )}}{% if cascade %} CASCADE{% endif %};
\ No newline at end of file
+DROP TRIGGER IF EXISTS {{conn|qtIdent(data.name)}} ON {{conn|qtIdent(data.nspname, data.relname )}}{% if cascade %} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table.sql
index e0b9cfd3..70c567d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table_msql.sql
index f738d3ec..89a93ace 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/alter_table_with_toast_table_msql.sql
@@ -1,12 +1,12 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition.sql
index 601e7979..3821f29e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
@@ -24,5 +24,5 @@ COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition_msql.sql
index a5fb12c7..fec9679b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_partition_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition.sql
index e873317a..142e1abc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_range_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 -- Partitions SQL
@@ -21,5 +21,5 @@ ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES FROM ('20') TO ('25');
 
-ALTER TABLE public."cust_arr_small PARTITION"
+ALTER TABLE IF EXISTS public."cust_arr_small PARTITION"
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition_msql.sql
index 9a512427..ea340086 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/10_plus/create_table_with_range_partition_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql
index e0b9cfd3..70c567d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table_msql.sql
index a1a588be..f8cf5a96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/alter_table_with_toast_table_msql.sql
@@ -1,11 +1,11 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql
index 0b562ef1..4e4cfa13 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_hash_patition_$%{}[]()&*^!@\"'`\\/#
 
--- DROP TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
+-- DROP TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
@@ -24,5 +24,5 @@ COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 CREATE TABLE IF NOT EXISTS public.cust_part11 PARTITION OF public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     FOR VALUES WITH (modulus 2, remainder 1);
 
-ALTER TABLE public.cust_part11
+ALTER TABLE IF EXISTS public.cust_part11
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql
index 3fdc6da0..49cdb5bf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/11_plus/create_table_with_hash_partition_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql
index 42d22f4a..5aae1bd9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk_msql.sql
index bdcbfcb6..f1cc9a21 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_another_fk_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT fk2 FOREIGN KEY (col2)
     REFERENCES public.fk_reference_tbl (name)
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql
index cf4aa604..7f437e5d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols_msql.sql
index 776060df..43b57e4e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_cols_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col3_$%{}[]()&*^!@\""'`\\/#" numeric(10, 5);
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col4_$%{}[]()&*^!@\""'`\\/#" text;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql
index b9af2ccc..9d60a82b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint_msql.sql
index 3a027c68..a70e2599 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_exclude_constraint_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT ex_constr EXCLUDE USING gist (
     col1 WITH <>);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql
index 5031c5a0..be1620fe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col_msql.sql
index bf6a926c..6da62563 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_null_constraint_rename_col_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     RENAME col1 TO col1_rename;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col4 SET NOT NULL;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql
index 02547e7a..fbd26e60 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     arr numeric
 ) PARTITION BY LIST (status);
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
@@ -20,12 +20,12 @@ COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to postgres;
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to postgres;
 CREATE TABLE IF NOT EXISTS public.cust_archived PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('EXPIRED');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql
index 594c1a5e..28d04c67 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint_msql.sql
index 628422d7..265a86ab 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_pk_not_null_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 SET NOT NULL;
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ADD PRIMARY KEY (col1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql
index f8944236..8197a80f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const_msql.sql
index d5ade04d..8bc96855 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_add_unique_const_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT "unique" UNIQUE ("col1_$%{}[]()&*^!@\""'`\\/#")
     WITH (FILLFACTOR=13);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql
index b9497c6f..51b96990 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_change_col_data_type.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql
index f6870cd5..fb8c64a4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols_msql.sql
index 673ff675..4f7f5c76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_cols_msql.sql
@@ -1 +1 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN "col2_$%{}[]()&*^!@\""'`\\/#";
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col2_$%{}[]()&*^!@\""'`\\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql
index bc80c6e7..ae03929b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints_msql.sql
index 47a3cf8d..ad937b15 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_delete_constraints_msql.sql
@@ -1,2 +1,2 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT "unique";
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT chk_const;
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS "unique";
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS chk_const;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql
index 10d5abe8..d9de71da 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants_msql.sql
index 363195b7..ed686217 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_update_grants_msql.sql
@@ -1,7 +1,7 @@
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     DISABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     NO FORCE ROW LEVEL SECURITY;
 
 GRANT SELECT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql
index 8ce89cc1..1ae90fa6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table_msql.sql
index a1a588be..f8cf5a96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/alter_table_with_toast_table_msql.sql
@@ -1,11 +1,11 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql
index 88afb68f..525a83eb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,13 +13,13 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql
index b78ca959..8fcea6a4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_advanced_options_msql.sql
@@ -8,13 +8,13 @@ WITH (
     FILLFACTOR = 50
 );
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql
index 5af0c41e..7d1736fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -22,7 +22,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql
index 0a8f1c45..f56f3d10 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_custom_autovacuum_msql.sql
@@ -17,7 +17,7 @@ WITH (
     autovacuum_freeze_table_age = 1300000
 );
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql
index 08f7379b..9f332369 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql
index 29117132..f5d3268e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_fk_msql.sql
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
         NOT VALID
 );
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql
index 0fba3df7..58b20721 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_hash_patition_$%{}[]()&*^!@\"'`\\/#
 
--- DROP TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
+-- DROP TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\
     arr numeric
 ) PARTITION BY HASH (id);
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
@@ -20,5 +20,5 @@ COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 CREATE TABLE IF NOT EXISTS public.cust_part11 PARTITION OF public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     FOR VALUES WITH (modulus 2, remainder 1);
 
-ALTER TABLE public.cust_part11
+ALTER TABLE IF EXISTS public.cust_part11
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql
index 2f9ea03f..7aecb081 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_hash_partition_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\
     arr numeric
 ) PARTITION BY HASH (id);
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql
index 04be033f..29ff52ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_like_tbl$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 (
@@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql
index b29e2e12..484a0d0e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_lik_tbl_msql.sql
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 
 );
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql
index 635c79bc..d0b0cf38 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     arr numeric
 ) PARTITION BY LIST (status);
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
@@ -20,5 +20,5 @@ COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql
index 0b25e4d1..0371c6d1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_partition_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     arr numeric
 ) PARTITION BY LIST (status);
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql
index d560b4d3..ed5b924e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql
index c89a4966..c0124d15 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql
index 89729a0c..8abf24d4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_chk_msql.sql
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
     CONSTRAINT chk_const CHECK (col2  != null)
 );
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql
index 3b417ade..71bc769d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_pk_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     PRIMARY KEY ("col1_$%{}[]()&*^!@\""'`\\/#")
 );
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql
index cf98bd3f..82ed6da2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_range_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/
     arr numeric
 ) PARTITION BY RANGE (arr);
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 -- Partitions SQL
@@ -17,5 +17,5 @@ ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES FROM ('20') TO ('25');
 
-ALTER TABLE public."cust_arr_small PARTITION"
+ALTER TABLE IF EXISTS public."cust_arr_small PARTITION"
     OWNER to postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql
index 5f8a8283..77ae9a4a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_with_range_partition_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/
     arr numeric
 ) PARTITION BY RANGE (arr);
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql
index 46eec152..903bad0f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql
index a343f07d..9cd042d6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/12_plus/create_table_without_primary_key_msql.sql
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     col6 timestamp(5) with time zone
 );
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql
index 41fc1d34..cb7f2d7a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -23,7 +23,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk_msql.sql
index bdcbfcb6..f1cc9a21 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_another_fk_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT fk2 FOREIGN KEY (col2)
     REFERENCES public.fk_reference_tbl (name)
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql
index 920f9301..c38552f6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols_msql.sql
index 776060df..38b9590f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_cols_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col3_$%{}[]()&*^!@\""'`\\/#" numeric(10, 5);
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col3_$%{}[]()&*^!@\""'`\\/#" numeric(10, 5);
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col4_$%{}[]()&*^!@\""'`\\/#" text;
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col4_$%{}[]()&*^!@\""'`\\/#" text;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql
index e418ed66..0c37babc 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint_msql.sql
index 3a027c68..a70e2599 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_exclude_constraint_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT ex_constr EXCLUDE USING gist (
     col1 WITH <>);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql
index 2763f9b8..883ee07a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -17,7 +17,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col_msql.sql
index bf6a926c..6da62563 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_null_constraint_rename_col_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     RENAME col1 TO col1_rename;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col4 SET NOT NULL;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql
index 45047b28..92798ecf 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -17,7 +17,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint_msql.sql
index 628422d7..265a86ab 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_pk_not_null_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 SET NOT NULL;
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ADD PRIMARY KEY (col1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql
index 8d6d442b..9073ae41 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -18,7 +18,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const_msql.sql
index d5ade04d..8bc96855 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_add_unique_const_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT "unique" UNIQUE ("col1_$%{}[]()&*^!@\""'`\\/#")
     WITH (FILLFACTOR=13);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql
index 44f0935c..5ed38dd5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_change_col_data_type.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql
index e428375e..154b0184 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols_msql.sql
index 673ff675..4f7f5c76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_cols_msql.sql
@@ -1 +1 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN "col2_$%{}[]()&*^!@\""'`\\/#";
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col2_$%{}[]()&*^!@\""'`\\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql
index 005738c1..b4e9092d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints_msql.sql
index 47a3cf8d..ad937b15 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_delete_constraints_msql.sql
@@ -1,2 +1,2 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT "unique";
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT chk_const;
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS "unique";
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS chk_const;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql
index caba3460..6d5a4ce6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO postgres;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants_msql.sql
index 363195b7..ed686217 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_update_grants_msql.sql
@@ -1,7 +1,7 @@
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     DISABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     NO FORCE ROW LEVEL SECURITY;
 
 GRANT SELECT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql
index e0b9cfd3..70c567d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table_msql.sql
index a1a588be..f8cf5a96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/alter_table_with_toast_table_msql.sql
@@ -1,11 +1,11 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql
index b065c487..0bf11157 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,13 +13,13 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql
index 7a091ded..295227c2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_advanced_options_msql.sql
@@ -8,13 +8,13 @@ WITH (
     FILLFACTOR = 50
 );
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql
index 0664e614..c1bc7c66 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -22,7 +22,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql
index 394aec38..f6f6f313 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_custom_autovacuum_msql.sql
@@ -17,7 +17,7 @@ WITH (
     autovacuum_freeze_table_age = 1300000
 );
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql
index 11e73017..709bee33 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -18,7 +18,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql
index e2ce7202..604d4e56 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_fk_msql.sql
@@ -14,7 +14,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql
index 1309cdc5..039ac925 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_like_tbl$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql
index bf9eb073..1d293587 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_lik_tbl_msql.sql
@@ -12,7 +12,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql
index bcac72e9..368495c7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql
index aab4b539..71907e17 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql
index 2ba138e5..3a333983 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_chk_msql.sql
@@ -11,7 +11,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql
index 32120e75..ef345d65 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_with_pk_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql
index bafbffc8..e0fd4755 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql
index ec4c305e..ec698c8b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/pg/default/create_table_without_primary_key_msql.sql
@@ -11,7 +11,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to postgres;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table.sql
index 94de9467..2fc4a551 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table_msql.sql
index f738d3ec..89a93ace 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/alter_table_with_toast_table_msql.sql
@@ -1,12 +1,12 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition.sql
index 8299a896..c32bcc37 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
@@ -24,5 +24,5 @@ COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition_msql.sql
index 10910fbf..7b2b7445 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_partition_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition.sql
index d3aff026..a9aaf885 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_range_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 -- Partitions SQL
@@ -21,5 +21,5 @@ ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES FROM ('20') TO ('25');
 
-ALTER TABLE public."cust_arr_small PARTITION"
+ALTER TABLE IF EXISTS public."cust_arr_small PARTITION"
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition_msql.sql
index 4acd8df5..c44bb024 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/10_plus/create_table_with_range_partition_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table.sql
index 94de9467..2fc4a551 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table_msql.sql
index a1a588be..f8cf5a96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/alter_table_with_toast_table_msql.sql
@@ -1,11 +1,11 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition.sql
index 750ac33d..39e0791b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_hash_patition_$%{}[]()&*^!@\"'`\\/#
 
--- DROP TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
+-- DROP TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
@@ -24,5 +24,5 @@ COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 CREATE TABLE IF NOT EXISTS public.cust_part11 PARTITION OF public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     FOR VALUES WITH (modulus 2, remainder 1);
 
-ALTER TABLE public.cust_part11
+ALTER TABLE IF EXISTS public.cust_part11
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition_msql.sql
index 07bcc239..a9486b2c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/11_plus/create_table_with_hash_partition_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk.sql
index 3c7cc8e4..520943fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk_msql.sql
index bdcbfcb6..f1cc9a21 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_another_fk_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT fk2 FOREIGN KEY (col2)
     REFERENCES public.fk_reference_tbl (name)
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols.sql
index a92d8c8e..c203a7b1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols_msql.sql
index 776060df..43b57e4e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_cols_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col3_$%{}[]()&*^!@\""'`\\/#" numeric(10, 5);
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     ADD COLUMN "col4_$%{}[]()&*^!@\""'`\\/#" text;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint.sql
index df8debbe..b828c6c0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint_msql.sql
index 3a027c68..a70e2599 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_exclude_constraint_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT ex_constr EXCLUDE USING gist (
     col1 WITH <>);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col.sql
index 8bbef97a..6695974b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col_msql.sql
index bf6a926c..6da62563 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_null_constraint_rename_col_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     RENAME col1 TO col1_rename;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col4 SET NOT NULL;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql
index 569f7cfa..6d4df84d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     arr numeric
 ) PARTITION BY LIST (status);
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
@@ -20,12 +20,12 @@ COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to postgres;
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to postgres;
 CREATE TABLE IF NOT EXISTS public.cust_archived PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('EXPIRED');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint.sql
index 89717203..e3247b6f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint_msql.sql
index 628422d7..265a86ab 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_pk_not_null_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 SET NOT NULL;
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ADD PRIMARY KEY (col1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const.sql
index 2337fb64..4d241798 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const_msql.sql
index d5ade04d..8bc96855 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_add_unique_const_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT "unique" UNIQUE ("col1_$%{}[]()&*^!@\""'`\\/#")
     WITH (FILLFACTOR=13);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_change_col_data_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_change_col_data_type.sql
index 660419b5..7a5901f1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_change_col_data_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_change_col_data_type.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols.sql
index d7857c7b..75c7303a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols_msql.sql
index 673ff675..4f7f5c76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_cols_msql.sql
@@ -1 +1 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN "col2_$%{}[]()&*^!@\""'`\\/#";
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col2_$%{}[]()&*^!@\""'`\\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints.sql
index 644a3a76..64088340 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints_msql.sql
index 47a3cf8d..ad937b15 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_delete_constraints_msql.sql
@@ -1,2 +1,2 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT "unique";
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT chk_const;
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS "unique";
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS chk_const;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants.sql
index bb4872d3..b5b9559a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants_msql.sql
index 363195b7..ed686217 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_update_grants_msql.sql
@@ -1,7 +1,7 @@
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     DISABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     NO FORCE ROW LEVEL SECURITY;
 
 GRANT SELECT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table.sql
index 08ccc0d1..23e3c2c9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table_msql.sql
index a1a588be..f8cf5a96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/alter_table_with_toast_table_msql.sql
@@ -1,11 +1,11 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options.sql
index 5c8b1422..b10776a3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,13 +13,13 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options_msql.sql
index df6124f7..4f196ce7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_advanced_options_msql.sql
@@ -8,13 +8,13 @@ WITH (
     FILLFACTOR = 50
 );
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum.sql
index 5318261b..56187441 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -22,7 +22,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum_msql.sql
index 178f3847..bddb655b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_custom_autovacuum_msql.sql
@@ -17,7 +17,7 @@ WITH (
     autovacuum_freeze_table_age = 1300000
 );
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk.sql
index 43ce55fa..f1ed97b4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk_msql.sql
index 19aa1c9e..b0191f0a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_fk_msql.sql
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#
         NOT VALID
 );
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition.sql
index dcb9005a..2b449ea3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_hash_patition_$%{}[]()&*^!@\"'`\\/#
 
--- DROP TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
+-- DROP TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\
     arr numeric
 ) PARTITION BY HASH (id);
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
@@ -20,5 +20,5 @@ COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
 CREATE TABLE IF NOT EXISTS public.cust_part11 PARTITION OF public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     FOR VALUES WITH (modulus 2, remainder 1);
 
-ALTER TABLE public.cust_part11
+ALTER TABLE IF EXISTS public.cust_part11
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition_msql.sql
index 6335e693..a33b3305 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_hash_partition_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\
     arr numeric
 ) PARTITION BY HASH (id);
 
-ALTER TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
+ALTER TABLE IF EXISTS public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_hash_patition_$%{}[]()&*^!@\""'`\\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl.sql
index 53f33e9b..23554016 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_like_tbl$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 (
@@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl_msql.sql
index aece0436..1d41ebb2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_lik_tbl_msql.sql
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 
 );
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition.sql
index 30c085ab..53916719 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     arr numeric
 ) PARTITION BY LIST (status);
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
@@ -20,5 +20,5 @@ COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public.cust_active PARTITION OF public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES IN ('ACTIVE');
 
-ALTER TABLE public.cust_active
+ALTER TABLE IF EXISTS public.cust_active
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition_msql.sql
index cec8de28..5bd3de2e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_partition_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     arr numeric
 ) PARTITION BY LIST (status);
 
-ALTER TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk.sql
index c8b03201..4fa40293 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk.sql
index 7669add6..ca9ae87b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk_msql.sql
index 6be77999..661a97a6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_chk_msql.sql
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'
     CONSTRAINT chk_const CHECK (col2  != null)
 );
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_msql.sql
index a34aa01e..7a599072 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_pk_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     PRIMARY KEY ("col1_$%{}[]()&*^!@\""'`\\/#")
 );
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition.sql
index d0b66e47..6a6096b4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_range_patition_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 (
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/
     arr numeric
 ) PARTITION BY RANGE (arr);
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 -- Partitions SQL
@@ -17,5 +17,5 @@ ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     FOR VALUES FROM ('20') TO ('25');
 
-ALTER TABLE public."cust_arr_small PARTITION"
+ALTER TABLE IF EXISTS public."cust_arr_small PARTITION"
     OWNER to enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition_msql.sql
index d1f690fe..db2aac1b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_with_range_partition_msql.sql
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/
     arr numeric
 ) PARTITION BY RANGE (arr);
 
-ALTER TABLE public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 CREATE TABLE IF NOT EXISTS public."cust_arr_small PARTITION" PARTITION OF public."table_with_range_patition_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key.sql
index 21a61793..d5e23497 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key_msql.sql
index 4b454e18..3551842c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/12_plus/create_table_without_primary_key_msql.sql
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     col6 timestamp(5) with time zone
 );
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk.sql
index 9cccc52b..78128ae9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -23,7 +23,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk_msql.sql
index bdcbfcb6..f1cc9a21 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_another_fk_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT fk2 FOREIGN KEY (col2)
     REFERENCES public.fk_reference_tbl (name)
     ON UPDATE NO ACTION
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols.sql
index 2903aff8..ab001276 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols_msql.sql
index 776060df..38b9590f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_cols_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col3_$%{}[]()&*^!@\""'`\\/#" numeric(10, 5);
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col3_$%{}[]()&*^!@\""'`\\/#" numeric(10, 5);
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
-    ADD COLUMN "col4_$%{}[]()&*^!@\""'`\\/#" text;
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+    ADD COLUMN IF NOT EXISTS "col4_$%{}[]()&*^!@\""'`\\/#" text;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint.sql
index 20857a45..419ec278 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint_msql.sql
index 3a027c68..a70e2599 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_exclude_constraint_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT ex_constr EXCLUDE USING gist (
     col1 WITH <>);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col.sql
index a002447c..e9e418ef 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -17,7 +17,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col_msql.sql
index bf6a926c..6da62563 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_null_constraint_rename_col_msql.sql
@@ -1,5 +1,5 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     RENAME col1 TO col1_rename;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col4 SET NOT NULL;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint.sql
index 04a8662b..bc628795 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -17,7 +17,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint_msql.sql
index 628422d7..265a86ab 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_pk_not_null_constraint_msql.sql
@@ -1,4 +1,4 @@
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ALTER COLUMN col1 SET NOT NULL;
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     ADD PRIMARY KEY (col1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const.sql
index 3ac540cf..58333a2e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -18,7 +18,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const_msql.sql
index d5ade04d..8bc96855 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_add_unique_const_msql.sql
@@ -1,3 +1,3 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     ADD CONSTRAINT "unique" UNIQUE ("col1_$%{}[]()&*^!@\""'`\\/#")
     WITH (FILLFACTOR=13);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_change_col_data_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_change_col_data_type.sql
index 28c440c7..021cb3c6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_change_col_data_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_change_col_data_type.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols.sql
index c1ddd58a..b0154ffe 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols_msql.sql
index 673ff675..4f7f5c76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_cols_msql.sql
@@ -1 +1 @@
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN "col2_$%{}[]()&*^!@\""'`\\/#";
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#" DROP COLUMN IF EXISTS "col2_$%{}[]()&*^!@\""'`\\/#";
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints.sql
index 83388cdd..5bf52ff9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -15,7 +15,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints_msql.sql
index 47a3cf8d..ad937b15 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_delete_constraints_msql.sql
@@ -1,2 +1,2 @@
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT "unique";
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT chk_const;
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS "unique";
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#" DROP CONSTRAINT IF EXISTS chk_const;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants.sql
index 766d1853..37bdc4d2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 GRANT ALL ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO enterprisedb;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants_msql.sql
index 363195b7..ed686217 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_update_grants_msql.sql
@@ -1,7 +1,7 @@
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     DISABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     NO FORCE ROW LEVEL SECURITY;
 
 GRANT SELECT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#" TO PUBLIC;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table.sql
index 94de9467..2fc4a551 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -26,7 +26,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table_msql.sql
index a1a588be..f8cf5a96 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/alter_table_with_toast_table_msql.sql
@@ -1,11 +1,11 @@
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     autovacuum_analyze_threshold = 60,
     autovacuum_vacuum_cost_limit = 100
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" RESET (
     autovacuum_enabled
 );
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#" SET (
     toast.autovacuum_enabled = false,
     toast.autovacuum_freeze_max_age = 2000000,
     toast.autovacuum_vacuum_cost_delay = 50,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options.sql
index c483acc4..92d1688f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_advanced_options_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#";
 
 CREATE UNLOGGED TABLE IF NOT EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
 (
@@ -13,13 +13,13 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options_msql.sql
index ca5c4235..df7cd7b2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_advanced_options_msql.sql
@@ -8,13 +8,13 @@ WITH (
     FILLFACTOR = 50
 );
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     ENABLE ROW LEVEL SECURITY;
 
-ALTER TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
     FORCE ROW LEVEL SECURITY;
 
 COMMENT ON TABLE public."table_with_advanced_options_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum.sql
index 7a89dbb7..e8289d8a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_custom_autovaccum_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
 (
@@ -22,7 +22,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum_msql.sql
index 456eb7c8..6041f756 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_custom_autovacuum_msql.sql
@@ -17,7 +17,7 @@ WITH (
     autovacuum_freeze_table_age = 1300000
 );
 
-ALTER TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_custom_autovaccum_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk.sql
index 5b8de526..f7872b94 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_fk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -18,7 +18,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk_msql.sql
index 426df33a..8d8eda04 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_fk_msql.sql
@@ -14,7 +14,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_fk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl.sql
index abef7785..d62b3f1e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_like_tbl$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
 (
@@ -14,7 +14,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl_msql.sql
index 0e3c0659..cf6bfc80 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_lik_tbl_msql.sql
@@ -12,7 +12,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_like_tbl$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_like_tbl$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk.sql
index 4cf7aaf1..163a5bd0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_with_pk$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
 (
@@ -13,7 +13,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk.sql
index 87612dfb..b011c933 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk.sql
@@ -1,6 +1,6 @@
 -- Table: public.table_with_pk_chk_constraints$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk_msql.sql
index c56da9e2..dbe94cca 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_chk_msql.sql
@@ -11,7 +11,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."table_with_pk_chk_constraints$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_msql.sql
index ca6042f8..6de40666 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_with_pk_msql.sql
@@ -8,7 +8,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_with_pk$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key.sql
index 0e59600d..6a163d35 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key.sql
@@ -1,6 +1,6 @@
 -- Table: public.simple_table_$%{}[]()&*^!@"'`\/#
 
--- DROP TABLE public."simple_table_$%{}[]()&*^!@""'`\/#";
+-- DROP TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#";
 
 CREATE TABLE IF NOT EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
 (
@@ -16,7 +16,7 @@ WITH (
 )
 TABLESPACE pg_default;
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key_msql.sql
index a1942441..91c5cc7c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/tests/ppas/default/create_table_without_primary_key_msql.sql
@@ -11,7 +11,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."simple_table_$%{}[]()&*^!@""'`\/#"
     OWNER to enterprisedb;
 
 COMMENT ON TABLE public."simple_table_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_delete_event_trigger_with_transition.sql
index fee4f916..fec89493 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_insert_event_trigger_with_transition.sql
index c28c43e0..220bca3d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_update_event_trigger_enable_always.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_update_event_trigger_enable_always.sql
index 81b7420a..0c11eb3e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_update_event_trigger_enable_always.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_after_update_event_trigger_enable_always.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_before_update_event_trigger_enable_replica.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_before_update_event_trigger_enable_replica.sql
index 06f8d896..b24753da 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_before_update_event_trigger_enable_replica.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/alter_before_update_event_trigger_enable_replica.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_delete_event_trigger_with_transition.sql
index 8cb8cd2c..e2846514 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_insert_event_trigger_with_transition.sql
index a1fa3c39..c3414c5c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_update_event_trigger.sql
index 7d9550ce..d8339b88 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_after_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_before_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_before_update_event_trigger.sql
index 42071e8c..2125a2ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_before_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/10_plus/create_before_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_delete_event_trigger_with_transition.sql
index 8180195f..ece31b34 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_insert_event_trigger_with_transition.sql
index 30d535b6..c42f6d02 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_update_event_trigger_enable_always.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_update_event_trigger_enable_always.sql
index fb408501..d5b9767e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_update_event_trigger_enable_always.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_after_update_event_trigger_enable_always.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_insert_event_trigger.sql
index 9ffbce48..b9608008 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_update_event_trigger_enable_replica.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_update_event_trigger_enable_replica.sql
index 400df80e..1aae2013 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_update_event_trigger_enable_replica.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/alter_before_update_event_trigger_enable_replica.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger.sql
index df82706d..c0c3bbd3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger_with_transition.sql
index 08fc2024..92b3b097 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_insert_event_trigger_with_transition.sql
index 81bf82e5..d7d068ee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_update_event_trigger.sql
index 3c8beb69..d2894d82 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_after_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_b4r_update_multiple_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_b4r_update_multiple_event_trigger.sql
index 18d5aede..bf0d6bf5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_b4r_update_multiple_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_b4r_update_multiple_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_b4r_update_mul_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT OR UPDATE OF col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_at_statement.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_at_statement.sql
index 4b20ac92..b5a72504 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_at_statement.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_at_statement.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_statement_$%{}[]()&*^!@\"'`\\/#"
 
--- DROP TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#"""
     BEFORE INSERT OR DELETE OR TRUNCATE OR UPDATE OF col1, col2, col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_trigger.sql
index 15bbcd28..0aede597 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_update_event_trigger.sql
index 85465cd2..ff2a1573 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/11_plus/create_before_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_after_update_event_trigger_enable_always.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_after_update_event_trigger_enable_always.sql
index 81b7420a..0c11eb3e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_after_update_event_trigger_enable_always.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_after_update_event_trigger_enable_always.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_insert_event_trigger.sql
index cf8ee745..2a5c0b6e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_update_event_trigger_enable_replica.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_update_event_trigger_enable_replica.sql
index 06f8d896..b24753da 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_update_event_trigger_enable_replica.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/alter_before_update_event_trigger_enable_replica.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_delete_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_delete_event_trigger.sql
index a85a3550..23d22361 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_delete_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_delete_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_insert_event_trigger_with_transition.sql
index 81bf82e5..d7d068ee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_update_event_trigger.sql
index 7d9550ce..d8339b88 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_after_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_b4r_update_multiple_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_b4r_update_multiple_event_trigger.sql
index a0f3f8b4..013b45ff 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_b4r_update_multiple_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_b4r_update_multiple_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_b4r_update_mul_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT OR UPDATE OF col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_at_statement.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_at_statement.sql
index c0cf9c6a..1a441212 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_at_statement.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_at_statement.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_statement_$%{}[]()&*^!@\"'`\\/#"
 
--- DROP TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#"""
     BEFORE INSERT OR DELETE OR TRUNCATE OR UPDATE OF col1, col2, col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_trigger.sql
index 26064949..d0194501 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_update_event_trigger.sql
index 42071e8c..2125a2ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/pg/default/create_before_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_delete_event_trigger_with_transition.sql
index fee4f916..fec89493 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_insert_event_trigger_with_transition.sql
index c28c43e0..220bca3d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_update_event_trigger_enable_always.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_update_event_trigger_enable_always.sql
index 81b7420a..0c11eb3e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_update_event_trigger_enable_always.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_after_update_event_trigger_enable_always.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_before_update_event_trigger_enable_replica.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_before_update_event_trigger_enable_replica.sql
index 06f8d896..b24753da 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_before_update_event_trigger_enable_replica.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/alter_before_update_event_trigger_enable_replica.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_delete_event_trigger_with_transition.sql
index 8cb8cd2c..e2846514 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_insert_event_trigger_with_transition.sql
index a1fa3c39..c3414c5c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_update_event_trigger.sql
index 7d9550ce..d8339b88 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_after_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_before_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_before_update_event_trigger.sql
index 42071e8c..2125a2ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_before_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/10_plus/create_before_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_delete_event_trigger_with_transition.sql
index 8180195f..ece31b34 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_insert_event_trigger_with_transition.sql
index 30d535b6..c42f6d02 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_update_event_trigger_enable_always.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_update_event_trigger_enable_always.sql
index fb408501..d5b9767e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_update_event_trigger_enable_always.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_after_update_event_trigger_enable_always.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_insert_event_trigger.sql
index 9ffbce48..b9608008 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_update_event_trigger_enable_replica.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_update_event_trigger_enable_replica.sql
index 400df80e..1aae2013 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_update_event_trigger_enable_replica.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/alter_before_update_event_trigger_enable_replica.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger.sql
index df82706d..c0c3bbd3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger_with_transition.sql
index 08fc2024..92b3b097 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_delete_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_delete_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_insert_event_trigger_with_transition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_insert_event_trigger_with_transition.sql
index 81bf82e5..d7d068ee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_insert_event_trigger_with_transition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_insert_event_trigger_with_transition.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_insert_events_with_transition_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_after_insert_events_with_transition_$%{}[]()&*^!@""'`\/#"
     AFTER INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_update_event_trigger.sql
index 3c8beb69..d2894d82 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_after_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_b4r_update_multiple_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_b4r_update_multiple_event_trigger.sql
index 18d5aede..bf0d6bf5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_b4r_update_multiple_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_b4r_update_multiple_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_b4r_update_mul_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT OR UPDATE OF col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_at_statement.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_at_statement.sql
index 4b20ac92..b5a72504 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_at_statement.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_at_statement.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_statement_$%{}[]()&*^!@\"'`\\/#"
 
--- DROP TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#"""
     BEFORE INSERT OR DELETE OR TRUNCATE OR UPDATE OF col1, col2, col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_trigger.sql
index 15bbcd28..0aede597 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_update_event_trigger.sql
index 85465cd2..ff2a1573 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/11_plus/create_before_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_after_update_event_trigger_enable_always.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_after_update_event_trigger_enable_always.sql
index 81b7420a..0c11eb3e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_after_update_event_trigger_enable_always.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_after_update_event_trigger_enable_always.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_insert_event_trigger.sql
index cf8ee745..2a5c0b6e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_update_event_trigger_enable_replica.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_update_event_trigger_enable_replica.sql
index 06f8d896..b24753da 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_update_event_trigger_enable_replica.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/alter_before_update_event_trigger_enable_replica.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_delete_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_delete_event_trigger.sql
index a85a3550..23d22361 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_delete_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_delete_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_delete_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_delete_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_delete_events_$%{}[]()&*^!@""'`\/#"
     AFTER DELETE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_update_event_trigger.sql
index 7d9550ce..d8339b88 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_after_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_after_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_after_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE CONSTRAINT TRIGGER "trig_after_update_$%{}[]()&*^!@""'`\/#"
     AFTER UPDATE OF col2
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_b4r_update_multiple_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_b4r_update_multiple_event_trigger.sql
index a0f3f8b4..013b45ff 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_b4r_update_multiple_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_b4r_update_multiple_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_b4r_update_mul_events_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_b4r_update_mul_events_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT OR UPDATE OF col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_at_statement.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_at_statement.sql
index c0cf9c6a..1a441212 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_at_statement.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_at_statement.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_statement_$%{}[]()&*^!@\"'`\\/#"
 
--- DROP TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_statement_$%{}[]()&*^!@\""'`\\/#""" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_statement_$%{}[]()&*^!@\""'`\\/#"""
     BEFORE INSERT OR DELETE OR TRUNCATE OR UPDATE OF col1, col2, col3
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_trigger.sql
index 26064949..d0194501 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_insert_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_test_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_test_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_test_$%{}[]()&*^!@""'`\/#"
     BEFORE INSERT
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_update_event_trigger.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_update_event_trigger.sql
index 42071e8c..2125a2ae 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_update_event_trigger.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/tests/ppas/default/create_before_update_event_trigger.sql
@@ -1,6 +1,6 @@
 -- Trigger: trig_be4r_update_$%{}[]()&*^!@"'`\/#
 
--- DROP TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
+-- DROP TRIGGER IF EXISTS "trig_be4r_update_$%{}[]()&*^!@""'`\/#" ON public.tablefortrigger;
 
 CREATE TRIGGER "trig_be4r_update_$%{}[]()&*^!@""'`\/#"
     BEFORE UPDATE OF col1
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/pg/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/pg/sql/default/delete.sql
index c2588270..f09cbb87 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/pg/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/pg/sql/default/delete.sql
@@ -1 +1 @@
-DROP TYPE {{ conn|qtIdent(data.schema, data.name) }}{% if cascade%} CASCADE{% endif %};
\ No newline at end of file
+DROP TYPE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}{% if cascade%} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/ppas/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/ppas/sql/default/delete.sql
index c2588270..f09cbb87 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/ppas/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/types/ppas/sql/default/delete.sql
@@ -1 +1 @@
-DROP TYPE {{ conn|qtIdent(data.schema, data.name) }}{% if cascade%} CASCADE{% endif %};
\ No newline at end of file
+DROP TYPE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}{% if cascade%} CASCADE{% endif %};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_acl_grantee_change.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_acl_grantee_change.sql
index 5977dd02..82f806c8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_acl_grantee_change.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_acl_grantee_change.sql
@@ -1,6 +1,6 @@
 -- Type: range_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."range_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_acl_description.sql
index 4769bf1d..f1e5a781 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_add_member.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_add_member.sql
index b864240c..48145c0e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_add_member.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_add_member.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_remove_member.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_remove_member.sql
index 013245da..c7e9d7d0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_remove_member.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_composite_type_remove_member.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_acl_description.sql
index e114d0cf..aec7de47 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: enum_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."enum_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
     ('a', 'b', 'c', 'd');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_label.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_label.sql
index 1a7a1530..8eb66451 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_label.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_enum_type_label.sql
@@ -1,6 +1,6 @@
 -- Type: enum_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."enum_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
     ('a', 'b', 'c', 'd');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_range_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_range_type_acl_description.sql
index 496f8422..1a0b6243 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_range_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_range_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: range_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."range_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_shell_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_shell_type_acl_description.sql
index 3f78bfd2..d3159758 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_shell_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/alter_shell_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: shell_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."shell_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type.sql
index d48f7053..0eae8b9d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type_one_field.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type_one_field.sql
index 16d5758b..b6a83314 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type_one_field.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_composite_type_one_field.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_enum_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_enum_type.sql
index ebccea87..a65d1796 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_enum_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_enum_type.sql
@@ -1,6 +1,6 @@
 -- Type: enum_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."enum_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
     ('a', 'b', 'c');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_range_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_range_type.sql
index be9c1a75..e001dd4c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_range_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_range_type.sql
@@ -1,6 +1,6 @@
 -- Type: range_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."range_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_shell_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_shell_type.sql
index 126f2b7f..b65d92df 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_shell_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/pg/default/create_shell_type.sql
@@ -1,6 +1,6 @@
 -- Type: shell_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."shell_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_acl_grantee_change.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_acl_grantee_change.sql
index f3a429ea..49a7706c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_acl_grantee_change.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_acl_grantee_change.sql
@@ -1,6 +1,6 @@
 -- Type: range_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."range_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_acl_description.sql
index 4769bf1d..f1e5a781 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_add_member.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_add_member.sql
index b864240c..48145c0e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_add_member.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_add_member.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_remove_member.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_remove_member.sql
index 013245da..c7e9d7d0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_remove_member.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_composite_type_remove_member.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_acl_description.sql
index e114d0cf..aec7de47 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: enum_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."enum_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
     ('a', 'b', 'c', 'd');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_label.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_label.sql
index 1a7a1530..8eb66451 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_label.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_enum_type_label.sql
@@ -1,6 +1,6 @@
 -- Type: enum_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."enum_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
     ('a', 'b', 'c', 'd');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_range_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_range_type_acl_description.sql
index 496f8422..1a0b6243 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_range_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_range_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: range_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."range_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_shell_type_acl_description.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_shell_type_acl_description.sql
index 3f78bfd2..d3159758 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_shell_type_acl_description.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/alter_shell_type_acl_description.sql
@@ -1,6 +1,6 @@
 -- Type: shell_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."shell_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type.sql
index d48f7053..0eae8b9d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type_one_field.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type_one_field.sql
index 16d5758b..b6a83314 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type_one_field.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_composite_type_one_field.sql
@@ -1,6 +1,6 @@
 -- Type: composite_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."composite_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."composite_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."composite_type_$%{}[]()&*^!@""'`\/#" AS
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_enum_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_enum_type.sql
index ebccea87..a65d1796 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_enum_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_enum_type.sql
@@ -1,6 +1,6 @@
 -- Type: enum_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."enum_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."enum_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."enum_type_$%{}[]()&*^!@""'`\/#" AS ENUM
     ('a', 'b', 'c');
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_nested_table_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_nested_table_type.sql
index 82188ce5..fbff67b6 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_nested_table_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_nested_table_type.sql
@@ -1,6 +1,6 @@
 -- Type: nested_table_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."nested_table_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."nested_table_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."nested_table_type_$%{}[]()&*^!@""'`\/#" AS TABLE OF
     numeric(2,1);
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_range_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_range_type.sql
index be9c1a75..e001dd4c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_range_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_range_type.sql
@@ -1,6 +1,6 @@
 -- Type: range_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."range_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."range_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."range_type_$%{}[]()&*^!@""'`\/#" AS RANGE
 (
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_shell_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_shell_type.sql
index 126f2b7f..b65d92df 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_shell_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_shell_type.sql
@@ -1,6 +1,6 @@
 -- Type: shell_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."shell_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."shell_type_$%{}[]()&*^!@""'`\/#";
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_varray_type.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_varray_type.sql
index b7f01d41..3d6cdfa5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_varray_type.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/tests/ppas/default/create_varray_type.sql
@@ -1,6 +1,6 @@
 -- Type: varray_type_$%{}[]()&*^!@"'`\/#
 
--- DROP TYPE public."varray_type_$%{}[]()&*^!@""'`\/#";
+-- DROP TYPE IF EXISTS public."varray_type_$%{}[]()&*^!@""'`\/#";
 
 CREATE TYPE public."varray_type_$%{}[]()&*^!@""'`\/#" AS VARRAY(10) OF
     integer;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/create.sql
index f092223a..3aa46653 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/create.sql
@@ -6,7 +6,7 @@
 
 {% endif %}
 {% if data.name and data.schema and data.definition %}
-CREATE MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
+CREATE MATERIALIZED VIEW IF NOT EXISTS {{ conn|qtIdent(data.schema, data.name) }}
 {% if(data.fillfactor or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum_enabled in ('t', 'f') or data['vacuum_data']|length > 0) %}
 {% set ns = namespace(add_comma=false) %}
 WITH (
@@ -34,7 +34,7 @@ WITH NO DATA;
 {% endif %}
 {% if data.owner %}
 
-ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% if data.comment %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/delete.sql
index bae4dfb9..2f45fcee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
+DROP MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/update.sql
index 48f3cfe4..e3fb4719 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.3_plus/sql/update.sql
@@ -7,26 +7,26 @@
 {% set def = data.definition.rstrip(';') if data.definition %}
 {# ===== Rename mat view ===== #}
 {% if data.name and data.name != o_data.name %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(o_data.schema, o_data.name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
   RENAME TO {{ conn|qtIdent(data.name) }};
 
 {% endif %}
 {# ===== Alter schema view ===== #}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(o_data.schema, view_name ) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
   SET SCHEMA {{ conn|qtIdent(data.schema) }};
 
 {% endif %}
 {# ===== Alter Table owner ===== #}
 {% if data.owner and data.owner != o_data.owner %}
-ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
   OWNER TO {{ conn|qtIdent(data.owner) }};
 
 {% endif %}
 {# ===== First Drop and then create mat view ===== #}
 {% if def and def != o_data.definition.rstrip(';') %}
-DROP MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }};
-CREATE MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+DROP MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }};
+CREATE MATERIALIZED VIEW IF NOT EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 {% if data.fillfactor or o_data.fillfactor %}
 WITH(
 {% if data.fillfactor %}
@@ -57,19 +57,19 @@ COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% else %}
 {# ======= Alter Tablespace ========= #}
 {%- if data.spcoid and o_data.spcoid != data.spcoid  -%}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
   SET TABLESPACE {{ data.spcoid }};
 
 {% endif %}
 {# ======= SET/RESET Fillfactor ========= #}
 {% if data.fillfactor and o_data.fillfactor != data.fillfactor %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 SET(
   FILLFACTOR = {{ data.fillfactor }}
 );
 
 {% elif data.fillfactor == '' and o_data.fillfactor|default('', 'true') != data.fillfactor %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 RESET(
   FILLFACTOR
 );
@@ -82,7 +82,7 @@ REFRESH MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} WITH{{ ' NO
 {% endif %}
 {# ===== Check for Autovacuum options ===== #}
 {% if data.autovacuum_custom is defined and data.autovacuum_custom == False %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
   autovacuum_enabled,
   autovacuum_vacuum_threshold,
   autovacuum_analyze_threshold,
@@ -98,7 +98,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
 {% endif %}
 
 {% if data.toast_autovacuum is defined and data.toast_autovacuum == False %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
   toast.autovacuum_enabled,
   toast.autovacuum_vacuum_threshold,
   toast.autovacuum_analyze_threshold,
@@ -113,7 +113,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
 
 {% endif %}{#-- toast_endif ends --#}
 {% if data['vacuum_data']['changed']|length > 0 or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum_enabled in ('t', 'f') %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(data.schema, data.name) }} SET(
 {% if data.autovacuum_enabled in ('t', 'f') %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if data['vacuum_data']['changed']|length > 0 or data.toast_autovacuum_enabled in ('t', 'f') %},
 {% endif %}
@@ -131,7 +131,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
 );
 {% endif %}
 {% if data['vacuum_data']['reset']|length > 0 or data.autovacuum_enabled == 'x' or data.toast_autovacuum_enabled == 'x' %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
 {% if data.autovacuum_enabled == 'x' %}
     autovacuum_enabled{% if data['vacuum_data']['reset']|length > 0 or data.toast_autovacuum_enabled == 'x' %},
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/create.sql
index f092223a..3aa46653 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/create.sql
@@ -6,7 +6,7 @@
 
 {% endif %}
 {% if data.name and data.schema and data.definition %}
-CREATE MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
+CREATE MATERIALIZED VIEW IF NOT EXISTS {{ conn|qtIdent(data.schema, data.name) }}
 {% if(data.fillfactor or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum_enabled in ('t', 'f') or data['vacuum_data']|length > 0) %}
 {% set ns = namespace(add_comma=false) %}
 WITH (
@@ -34,7 +34,7 @@ WITH NO DATA;
 {% endif %}
 {% if data.owner %}
 
-ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% if data.comment %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/delete.sql
index bae4dfb9..2f45fcee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
+DROP MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql
index 48f3cfe4..e3fb4719 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/pg/9.4_plus/sql/update.sql
@@ -7,26 +7,26 @@
 {% set def = data.definition.rstrip(';') if data.definition %}
 {# ===== Rename mat view ===== #}
 {% if data.name and data.name != o_data.name %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(o_data.schema, o_data.name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
   RENAME TO {{ conn|qtIdent(data.name) }};
 
 {% endif %}
 {# ===== Alter schema view ===== #}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(o_data.schema, view_name ) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
   SET SCHEMA {{ conn|qtIdent(data.schema) }};
 
 {% endif %}
 {# ===== Alter Table owner ===== #}
 {% if data.owner and data.owner != o_data.owner %}
-ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
   OWNER TO {{ conn|qtIdent(data.owner) }};
 
 {% endif %}
 {# ===== First Drop and then create mat view ===== #}
 {% if def and def != o_data.definition.rstrip(';') %}
-DROP MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }};
-CREATE MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+DROP MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }};
+CREATE MATERIALIZED VIEW IF NOT EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 {% if data.fillfactor or o_data.fillfactor %}
 WITH(
 {% if data.fillfactor %}
@@ -57,19 +57,19 @@ COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% else %}
 {# ======= Alter Tablespace ========= #}
 {%- if data.spcoid and o_data.spcoid != data.spcoid  -%}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
   SET TABLESPACE {{ data.spcoid }};
 
 {% endif %}
 {# ======= SET/RESET Fillfactor ========= #}
 {% if data.fillfactor and o_data.fillfactor != data.fillfactor %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 SET(
   FILLFACTOR = {{ data.fillfactor }}
 );
 
 {% elif data.fillfactor == '' and o_data.fillfactor|default('', 'true') != data.fillfactor %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 RESET(
   FILLFACTOR
 );
@@ -82,7 +82,7 @@ REFRESH MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} WITH{{ ' NO
 {% endif %}
 {# ===== Check for Autovacuum options ===== #}
 {% if data.autovacuum_custom is defined and data.autovacuum_custom == False %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
   autovacuum_enabled,
   autovacuum_vacuum_threshold,
   autovacuum_analyze_threshold,
@@ -98,7 +98,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
 {% endif %}
 
 {% if data.toast_autovacuum is defined and data.toast_autovacuum == False %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
   toast.autovacuum_enabled,
   toast.autovacuum_vacuum_threshold,
   toast.autovacuum_analyze_threshold,
@@ -113,7 +113,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
 
 {% endif %}{#-- toast_endif ends --#}
 {% if data['vacuum_data']['changed']|length > 0 or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum_enabled in ('t', 'f') %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(data.schema, data.name) }} SET(
 {% if data.autovacuum_enabled in ('t', 'f') %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if data['vacuum_data']['changed']|length > 0 or data.toast_autovacuum_enabled in ('t', 'f') %},
 {% endif %}
@@ -131,7 +131,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
 );
 {% endif %}
 {% if data['vacuum_data']['reset']|length > 0 or data.autovacuum_enabled == 'x' or data.toast_autovacuum_enabled == 'x' %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
 {% if data.autovacuum_enabled == 'x' %}
     autovacuum_enabled{% if data['vacuum_data']['reset']|length > 0 or data.toast_autovacuum_enabled == 'x' %},
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/create.sql
index f092223a..3aa46653 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/create.sql
@@ -6,7 +6,7 @@
 
 {% endif %}
 {% if data.name and data.schema and data.definition %}
-CREATE MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
+CREATE MATERIALIZED VIEW IF NOT EXISTS {{ conn|qtIdent(data.schema, data.name) }}
 {% if(data.fillfactor or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum_enabled in ('t', 'f') or data['vacuum_data']|length > 0) %}
 {% set ns = namespace(add_comma=false) %}
 WITH (
@@ -34,7 +34,7 @@ WITH NO DATA;
 {% endif %}
 {% if data.owner %}
 
-ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% if data.comment %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/delete.sql
index bae4dfb9..2f45fcee 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
+DROP MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql
index 48f3cfe4..e3fb4719 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mviews/ppas/9.3_plus/sql/update.sql
@@ -7,26 +7,26 @@
 {% set def = data.definition.rstrip(';') if data.definition %}
 {# ===== Rename mat view ===== #}
 {% if data.name and data.name != o_data.name %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(o_data.schema, o_data.name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
   RENAME TO {{ conn|qtIdent(data.name) }};
 
 {% endif %}
 {# ===== Alter schema view ===== #}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(o_data.schema, view_name ) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
   SET SCHEMA {{ conn|qtIdent(data.schema) }};
 
 {% endif %}
 {# ===== Alter Table owner ===== #}
 {% if data.owner and data.owner != o_data.owner %}
-ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
   OWNER TO {{ conn|qtIdent(data.owner) }};
 
 {% endif %}
 {# ===== First Drop and then create mat view ===== #}
 {% if def and def != o_data.definition.rstrip(';') %}
-DROP MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }};
-CREATE MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+DROP MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }};
+CREATE MATERIALIZED VIEW IF NOT EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 {% if data.fillfactor or o_data.fillfactor %}
 WITH(
 {% if data.fillfactor %}
@@ -57,19 +57,19 @@ COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {% else %}
 {# ======= Alter Tablespace ========= #}
 {%- if data.spcoid and o_data.spcoid != data.spcoid  -%}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
   SET TABLESPACE {{ data.spcoid }};
 
 {% endif %}
 {# ======= SET/RESET Fillfactor ========= #}
 {% if data.fillfactor and o_data.fillfactor != data.fillfactor %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 SET(
   FILLFACTOR = {{ data.fillfactor }}
 );
 
 {% elif data.fillfactor == '' and o_data.fillfactor|default('', 'true') != data.fillfactor %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
 RESET(
   FILLFACTOR
 );
@@ -82,7 +82,7 @@ REFRESH MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} WITH{{ ' NO
 {% endif %}
 {# ===== Check for Autovacuum options ===== #}
 {% if data.autovacuum_custom is defined and data.autovacuum_custom == False %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
   autovacuum_enabled,
   autovacuum_vacuum_threshold,
   autovacuum_analyze_threshold,
@@ -98,7 +98,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
 {% endif %}
 
 {% if data.toast_autovacuum is defined and data.toast_autovacuum == False %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
   toast.autovacuum_enabled,
   toast.autovacuum_vacuum_threshold,
   toast.autovacuum_analyze_threshold,
@@ -113,7 +113,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
 
 {% endif %}{#-- toast_endif ends --#}
 {% if data['vacuum_data']['changed']|length > 0 or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum_enabled in ('t', 'f') %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(data.schema, data.name) }} SET(
 {% if data.autovacuum_enabled in ('t', 'f') %}
     autovacuum_enabled = {% if data.autovacuum_enabled == 't' %}true{% else %}false{% endif %}{% if data['vacuum_data']['changed']|length > 0 or data.toast_autovacuum_enabled in ('t', 'f') %},
 {% endif %}
@@ -131,7 +131,7 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
 );
 {% endif %}
 {% if data['vacuum_data']['reset']|length > 0 or data.autovacuum_enabled == 'x' or data.toast_autovacuum_enabled == 'x' %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET(
+ALTER MATERIALIZED VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET(
 {% if data.autovacuum_enabled == 'x' %}
     autovacuum_enabled{% if data['vacuum_data']['reset']|length > 0 or data.toast_autovacuum_enabled == 'x' %},
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.3_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.3_plus/sql/delete.sql
index 6b0305b1..987752ac 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.3_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.3_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
+DROP VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.4_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.4_plus/sql/delete.sql
index 1d6611fe..40118da9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.4_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/pg/9.4_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP VIEW {{ conn|qtIdent(nspname, name) }}{% if cascade %} CASCADE {% endif %};
+DROP VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }}{% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/create.sql
index dac7b12c..5099cc10 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/create.sql
@@ -13,7 +13,7 @@ WITH (
 {{ data.definition.rstrip(';') }};
 {% if data.owner %}
 
-ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% if data.comment %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/delete.sql
index 6b0305b1..987752ac 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
+DROP VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/update.sql
index 429919f9..718bae6a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.3_plus/sql/update.sql
@@ -6,15 +6,15 @@
 {% set view_schema = data.schema if data.schema else o_data.schema %}
 {% set def = data.definition.rstrip(';') if data.definition %}
 {% if data.name and data.name != o_data.name %}
-ALTER VIEW {{ conn|qtIdent(o_data.schema, o_data.name) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
     RENAME TO {{ conn|qtIdent(data.name) }};
 {% endif %}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER VIEW {{ conn|qtIdent(o_data.schema, view_name ) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
     SET SCHEMA {{ conn|qtIdent(data.schema) }};
 {% endif %}
 {% if data.owner and data.owner != o_data.owner %}
-ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% if def and def != o_data.definition.rstrip(';') %}
@@ -24,7 +24,7 @@ CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
     {{ def }};
 {% else %}
 {% if (data.security_barrier is defined and data.security_barrier|lower !=  o_data.security_barrier|lower) %}
-ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
     SET (security_barrier={{ data.security_barrier|lower }});
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/create.sql
index ba3c810b..d0521050 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/create.sql
@@ -18,7 +18,7 @@ WITH ({% if data.check_option and data.check_option.lower() != 'no' %}
 {{ data.definition.rstrip(';') }};
 {% if data.owner and data.m_view is undefined %}
 
-ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(data.schema, data.name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% if data.comment %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/delete.sql
index 6b0305b1..987752ac 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/delete.sql
@@ -9,5 +9,5 @@ LEFT JOIN pg_catalog.pg_namespace nsp ON c.relnamespace = nsp.oid
 WHERE
     c.relfilenode = {{ vid }};
 {% elif (name and nspname) %}
-DROP VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
+DROP VIEW IF EXISTS {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/update.sql
index c3558a6f..cd9ddafa 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/views/ppas/9.4_plus/sql/update.sql
@@ -6,11 +6,11 @@
 {% set view_schema = data.schema if data.schema else o_data.schema %}
 {% set def = data.definition.rstrip(';') if data.definition %}
 {% if data.name and data.name != o_data.name %}
-ALTER VIEW {{ conn|qtIdent(o_data.schema, o_data.name) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, o_data.name) }}
     RENAME TO {{ conn|qtIdent(data.name) }};
 {% endif %}
 {% if data.schema and data.schema != o_data.schema %}
-ALTER VIEW {{ conn|qtIdent(o_data.schema, view_name ) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(o_data.schema, view_name ) }}
     SET SCHEMA {{ conn|qtIdent(data.schema) }};
 {% endif %}
 {% if def and def != o_data.definition.rstrip(';') %}
@@ -25,18 +25,18 @@ CREATE OR REPLACE VIEW {{ conn|qtIdent(view_schema, view_name) }}
     {{ def }};
 {% else %}
 {% if (data.security_barrier is defined and data.security_barrier|lower !=  o_data.security_barrier|lower) %}
-ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
     SET (security_barrier={{ data.security_barrier|lower }});
 {% endif %}
 {% if (data.check_option and data.check_option != o_data.check_option and data.check_option != 'no') %}
-ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }}
+ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
     SET (check_option={{ data.check_option }});
 {% elif (data.check_option and data.check_option != o_data.check_option and data.check_option == 'no') %}
-ALTER VIEW {{ conn|qtIdent(view_schema, view_name) }} RESET (check_option);
+ALTER VIEW IF EXISTS {{ conn|qtIdent(view_schema, view_name) }} RESET (check_option);
 {% endif %}
 {% endif %}
 {% if data.owner and data.owner != o_data.owner %}
-ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
+ALTER TABLE IF EXISTS {{ conn|qtIdent(view_schema, view_name) }}
     OWNER TO {{ conn|qtIdent(data.owner) }};
 {% endif %}
 {% set old_comment = o_data.comment|default('', true) %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview.sql
index 71636fdb..c53b0970 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql
index c79991c4..49b2625d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor.sql
@@ -2,7 +2,7 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 WITH (
     FILLFACTOR = 18
 )
@@ -11,7 +11,7 @@ AS
  SELECT 12
 WITH DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql
index 2ef36421..555e1e4c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_fillfactor_msql.sql
@@ -1,4 +1,4 @@
-ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+ALTER MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
 SET(
   FILLFACTOR = 18
 );
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql
index 824b3d13..a05ab8df 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter.sql
@@ -2,7 +2,7 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 WITH (
     FILLFACTOR = 18,
     autovacuum_enabled = TRUE,
@@ -13,7 +13,7 @@ AS
  SELECT 12
 WITH DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter_msql.sql
index 6f13ab46..8106e5fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_add_table_parameter_msql.sql
@@ -1,4 +1,4 @@
-ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" SET(
+ALTER MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#" SET(
     autovacuum_enabled = true,
     autovacuum_analyze_scale_factor = 0.2
 );
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_change_grantee_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_change_grantee_priv.sql
index d15b0e6b..fcd7b144 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_change_grantee_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_change_grantee_priv.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql
index 53e17798..1caca831 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 12
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql
index 16b77223..d4573733 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_definition_msql.sql
@@ -1,5 +1,5 @@
-DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+DROP MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#";
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
  AS
 SELECT 12
  WITH NO DATA;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_drop_all_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_drop_all_priv.sql
index ee78e306..949fe0cd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_drop_all_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_drop_all_priv.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql
index c79991c4..49b2625d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter.sql
@@ -2,7 +2,7 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 WITH (
     FILLFACTOR = 18
 )
@@ -11,7 +11,7 @@ AS
  SELECT 12
 WITH DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter_msql.sql
index cccaa388..db2a0825 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/alter_mview_remove_table_parameter_msql.sql
@@ -1,4 +1,4 @@
-ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" RESET(
+ALTER MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#" RESET(
     autovacuum_enabled,
     autovacuum_analyze_scale_factor
 );
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview.sql
index acd7ced6..7541f284 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview_msql.sql
index 51173889..0f49fa60 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/pg/9.4_plus/create_mview_msql.sql
@@ -1,10 +1,10 @@
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
 SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO postgres;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview.sql
index e0f8d603..4e22b650 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql
index d281242c..11cc4e76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor.sql
@@ -2,7 +2,7 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 WITH (
     FILLFACTOR = 18
 )
@@ -11,7 +11,7 @@ AS
  SELECT 12
 WITH DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql
index 2ef36421..555e1e4c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_fillfactor_msql.sql
@@ -1,4 +1,4 @@
-ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+ALTER MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
 SET(
   FILLFACTOR = 18
 );
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql
index b38de214..dc7795f2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter.sql
@@ -2,7 +2,7 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 WITH (
     FILLFACTOR = 18,
     autovacuum_enabled = TRUE,
@@ -13,7 +13,7 @@ AS
  SELECT 12
 WITH DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter_msql.sql
index 6f13ab46..8106e5fd 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_add_table_parameter_msql.sql
@@ -1,4 +1,4 @@
-ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" SET(
+ALTER MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#" SET(
     autovacuum_enabled = true,
     autovacuum_analyze_scale_factor = 0.2
 );
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_change_grantee_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_change_grantee_priv.sql
index b5527759..02581ca9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_change_grantee_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_change_grantee_priv.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql
index 170a14d9..3b116a5c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 12
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql
index 16b77223..d4573733 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_definition_msql.sql
@@ -1,5 +1,5 @@
-DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+DROP MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#";
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
  AS
 SELECT 12
  WITH NO DATA;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_drop_all_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_drop_all_priv.sql
index 424c69c9..77b1a19f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_drop_all_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_drop_all_priv.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql
index d281242c..11cc4e76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter.sql
@@ -2,7 +2,7 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 WITH (
     FILLFACTOR = 18
 )
@@ -11,7 +11,7 @@ AS
  SELECT 12
 WITH DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter_msql.sql
index cccaa388..db2a0825 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_mview_remove_table_parameter_msql.sql
@@ -1,4 +1,4 @@
-ALTER MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#" RESET(
+ALTER MATERIALIZED VIEW IF EXISTS public."testmview_$%{}[]()&*^!/@`#" RESET(
     autovacuum_enabled,
     autovacuum_analyze_scale_factor
 );
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view.sql
index d267e529..aaf66bf7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view.sql
@@ -10,7 +10,7 @@ WITH (
  SELECT test_view_table.col1
    FROM test_view_table;
 
-ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     OWNER TO enterprisedb;
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
     IS 'Testcomment-updated';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql
index f378fb1b..9efdda8a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_add_some_priv.sql
@@ -10,7 +10,7 @@ WITH (
  SELECT test_view_table.col1
    FROM test_view_table;
 
-ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     OWNER TO enterprisedb;
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
     IS 'Testcomment-updated';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_delete_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_delete_priv.sql
index fbd46ee5..7e45bfc5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_delete_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_delete_priv.sql
@@ -10,7 +10,7 @@ WITH (
  SELECT test_view_table.col1
    FROM test_view_table;
 
-ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     OWNER TO enterprisedb;
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
     IS 'Testcomment-updated';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_msql.sql
index da566991..a7729f15 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_msql.sql
@@ -1,6 +1,6 @@
-ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER VIEW IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     SET (security_barrier=true);
-ALTER VIEW public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER VIEW IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     SET (check_option=cascaded);
 
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_update_priv.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_update_priv.sql
index 3db18ba2..6dafdf05 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_update_priv.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/alter_view_update_priv.sql
@@ -10,7 +10,7 @@ WITH (
  SELECT test_view_table.col1
    FROM test_view_table;
 
-ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     OWNER TO enterprisedb;
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
     IS 'Testcomment-updated';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview.sql
index b0f0e44d..b64a2d27 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview.sql
@@ -2,13 +2,13 @@
 
 -- DROP MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#";
 
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
  SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview_msql.sql
index 324235f8..36b1dbc2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_mview_msql.sql
@@ -1,10 +1,10 @@
-CREATE MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
+CREATE MATERIALIZED VIEW IF NOT EXISTS public."testmview_$%{}[]()&*^!/@`#"
 TABLESPACE pg_default
 AS
 SELECT 1
 WITH NO DATA;
 
-ALTER TABLE public."testmview_$%{}[]()&*^!/@`#"
+ALTER TABLE IF EXISTS public."testmview_$%{}[]()&*^!/@`#"
     OWNER TO enterprisedb;
 
 COMMENT ON MATERIALIZED VIEW public."testmview_$%{}[]()&*^!/@`#"
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view.sql
index 18c8d52e..14b3e47e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view.sql
@@ -9,7 +9,7 @@ WITH (
  SELECT test_view_table.col1
    FROM test_view_table;
 
-ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     OWNER TO enterprisedb;
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
     IS 'Testcomment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view_msql.sql
index 7cd95ed2..831b3b5a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view_msql.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/ppas/9.4_plus/create_view_msql.sql
@@ -4,7 +4,7 @@ WITH (
 ) AS
 select col1 from test_view_table;
 
-ALTER TABLE public."testview_$%{}[]()&*^!@""'`\/#"
+ALTER TABLE IF EXISTS public."testview_$%{}[]()&*^!@""'`\/#"
     OWNER TO enterprisedb;
 COMMENT ON VIEW public."testview_$%{}[]()&*^!@""'`\/#"
     IS 'Testcomment';
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/delete.sql
index 45922066..0259fa01 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/delete.sql
@@ -4,5 +4,5 @@
 {% endif %}
 {# ============= Drop the language ============= #}
 {% if subname %}
-DROP SUBSCRIPTION {{ conn|qtIdent(subname) }}{% if cascade %} CASCADE{% endif%};
+DROP SUBSCRIPTION IF EXISTS {{ conn|qtIdent(subname) }}{% if cascade %} CASCADE{% endif%};
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.6_plus/delete.sql b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.6_plus/delete.sql
new file mode 100644
index 00000000..2b52461d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.6_plus/delete.sql
@@ -0,0 +1,8 @@
+{# We need database name before we execute drop #}
+{% if did %}
+SELECT db.datname as name FROM pg_catalog.pg_database as db WHERE db.oid = {{did}};
+{% endif %}
+{# Using name from above query we will drop the database #}
+{% if datname %}
+DROP DATABASE IF EXISTS {{ conn|qtIdent(datname) }};
+{% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/sql/default/delete.sql b/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/sql/default/delete.sql
index 0ec62277..667b8007 100644
--- a/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/sql/default/delete.sql
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/templates/tablespaces/sql/default/delete.sql
@@ -1,2 +1,2 @@
 {### SQL to delete tablespace object ###}
-DROP TABLESPACE {{ conn|qtIdent(tsname) }};
+DROP TABLESPACE IF EXISTS {{ conn|qtIdent(tsname) }};
diff --git a/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql b/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql
index 222d947b..d20bfcaa 100644
--- a/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql
+++ b/web/pgadmin/tools/erd/tests/sql/12_plus/test_sql_output.sql
@@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS public.newtable3
 )
 ;
 
-ALTER TABLE public.newtable2
+ALTER TABLE IF EXISTS public.newtable2
     ADD FOREIGN KEY (table1_id)
     REFERENCES public.newtable1 (id)
     NOT VALID;
diff --git a/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql b/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql
index 94fff62e..2547c83f 100644
--- a/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql
+++ b/web/pgadmin/tools/erd/tests/sql/default/test_sql_output.sql
@@ -28,7 +28,7 @@ WITH (
     OIDS = FALSE
 );
 
-ALTER TABLE public.newtable2
+ALTER TABLE IF EXISTS public.newtable2
     ADD FOREIGN KEY (table1_id)
     REFERENCES public.newtable1 (id)
     NOT VALID;
