diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
index de8d66f..588d2e1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
@@ -564,10 +564,11 @@ class ViewNode(PGChildNodeView, VacuumSettings):
         cascade = True if self.cmd == 'delete' else False

         try:
-
-            # Get name for view from did
+            # Get name for view from vid
             SQL = render_template("/".join(
-              [self.template_path, 'sql/delete.sql']), vid=vid)
+              [self.template_path, 'sql/properties.sql']),
+                  vid=vid,
+                  datlastsysoid=self.datlastsysoid)
             status, res_data = self.conn.execute_dict(SQL)
             if not status:
                 return internal_server_error(errormsg=res_data)
@@ -575,7 +576,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
             # drop view
             SQL = render_template("/".join(
               [self.template_path, 'sql/delete.sql']),
-                nspname=res_data['rows'][0]['nspname'],
+                nspname=res_data['rows'][0]['schema'],
                 name=res_data['rows'][0]['name'], cascade=cascade
               )
             status, res = self.conn.execute_scalar(SQL)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/create.sql
index d8cac27..785a406 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/create.sql
@@ -14,10 +14,9 @@ WITH (
 {% endif %}
 {% for field in data['vacuum_data'] %}
 {% if field.value is defined and field.value != '' and field.value != none %}
-{% if loop.index > 1%},
+{% if loop.index > 1 %},
 {% endif %}    {{ field.name }} = {{ field.value|lower }}{% endif %}
-{% endfor %}
-
+{% endfor %}{{ '\r' }}
 )
 {% endif %}
 {% if data.spcname %}TABLESPACE {{ data.spcname }}
@@ -35,7 +34,7 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
 {% endif %}
 {% if data.comment %}

-COMMENT ON VIEW {{ conn|qtIdent(data.schema, data.name) }}
+COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
     IS {{ data.comment|qtLiteral }};
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/update.sql
index e366fde..c3ee57b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/pg/9.3_plus/sql/update.sql
@@ -156,7 +156,6 @@ SET(
 {% endif %}
 {% endfor %}
 );
-
 {% endif %}
 {% if data['vacuum_data']['reset']|length > 0 %}
 ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
@@ -166,7 +165,6 @@ RESET(
 {% endfor %}
 );
 {% endif %}
-
 {% endif %}{# ===== End check for custom autovaccum ===== #}
 {% endif %}{# ===== End block for check data definition ===== #}
 {% set old_comment = o_data.comment|default('', true) %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/create.sql
index 041f69d..785a406 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/create.sql
@@ -7,23 +7,16 @@
 {% endif %}
 {% if data.name and data.schema and data.definition %}
 CREATE MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
-{% if(data.fillfactor or data['autovacuum_enabled'] or data['toast_autovacuum_enabled']) %}
+{% if(data.fillfactor or data['vacuum_data']|length > 0) %}
 WITH (
 {% if data.fillfactor %}
     FILLFACTOR = {{ data.fillfactor }}{% if data['autovacuum_enabled'] or data['toast_autovacuum_enabled'] or data['vacuum_data']|length > 0 %},{{ '\r' }}{% endif %}
 {% endif %}
-{% if data['autovacuum_enabled'] %}
-    autovacuum_enabled = {{ data['autovacuum_enabled']|lower }}{% if data['toast_autovacuum_enabled'] or data['vacuum_data']|length > 0 %},{{ '\r' }}{% endif %}
-{% endif %}
-{% if data['toast_autovacuum_enabled'] %}
-    {{ 'toast.autovacuum_enabled' }} = {{ data['toast_autovacuum_enabled']|lower }}{% if data['vacuum_data']|length > 0 %},{{ '\r' }}{% endif %}
-{% endif %}
 {% for field in data['vacuum_data'] %}
 {% if field.value is defined and field.value != '' and field.value != none %}
-{% if loop.index > 1%},
+{% if loop.index > 1 %},
 {% endif %}    {{ field.name }} = {{ field.value|lower }}{% endif %}
-{% endfor %}
-
+{% endfor %}{{ '\r' }}
 )
 {% endif %}
 {% if data.spcname %}TABLESPACE {{ data.spcname }}
@@ -41,7 +34,7 @@ ALTER TABLE {{ conn|qtIdent(data.schema, data.name) }}
 {% endif %}
 {% if data.comment %}

-COMMENT ON VIEW {{ conn|qtIdent(data.schema, data.name) }}
+COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
     IS {{ data.comment|qtLiteral }};
 {% endif %}
 {% endif %}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/get_schema.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/get_schema.sql
index 7244ed3..bcc3d1c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/get_schema.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/get_schema.sql
@@ -1,6 +1,6 @@
 {# ===== fetch schema name =====#}
 SELECT
-   nspname
+    nspname
 FROM
     pg_namespace
 WHERE
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/update.sql
index b577ce7..c3ee57b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/update.sql
@@ -23,29 +23,11 @@ ALTER TABLE {{ conn|qtIdent(view_schema, view_name) }}
   OWNER TO {{ conn|qtIdent(data.owner) }};

 {% endif %}
-{% if data['vacuum_data']['reset']|length == 0 and
-data['vacuum_data']['changed']|length == 0 and data['settings']|length > 0 %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
-SET(
-{% for field in data['settings'] %}
-  {{ field }} = {{ data['settings'][field]|lower }}{% if not loop.last  %},{% endif %}{{ '\r' }}
-{% endfor %}
-);
-
-{% endif %}
-{% if data['vacuum_data']['reset']|length > 0 %}
-ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
-RESET(
-{% for field in data['vacuum_data']['reset'] %}
-  {{ field.name }}{% if not loop.last  %},{% endif %}{{ '\r' }}
-{% endfor %}
-);
-{% endif %}
 {# ===== First Drop and then create mat view ===== #}
 {% if def and def != o_data.definition.rstrip(';') %}
-{% if data.fillfactor or ( data['vacuum_data']['changed']|length > 0 ) %}
 DROP MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }};
 CREATE MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+{% if data.fillfactor or (data['vacuum_data']['changed']|length > 0 ) %}
 WITH(
 {% if data.fillfactor %}
   FILLFACTOR = {{ data.fillfactor }}{% if data['vacuum_data']['changed']|length > 0 %},{% endif %}{{ '\r' }}
@@ -56,16 +38,16 @@ WITH(
 {% endfor %}
 {% endif %}
 )
+{% endif %}
  AS
 {{ def }}
-{% if data.with_data %}
- WITH DATA;
+{% if data.with_data is defined %}
+ WITH {{ 'DATA' if data.with_data else 'NO DATA' }};

-{% else %}
- WITH NO DATA;
+{% elif o_data.with_data %}
+ WITH {{ 'DATA' if o_data.with_data else 'NO DATA' }};

 {% endif %}
-{% endif %}
 {% else %}
 {# ======= Alter Tablespace ========= #}
 {%- if data.spcoid and o_data.spcoid != data.spcoid  -%}
@@ -76,9 +58,11 @@ ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 {# ======= SET/RESET Fillfactor ========= #}
 {% if data.fillfactor and o_data.fillfactor != data.fillfactor %}
 ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
-SET(FILLFACTOR = {{ data.fillfactor }});
+SET(
+  FILLFACTOR = {{ data.fillfactor }}
+);

-{% elif data.fillfactor == '' %}
+{% elif data.fillfactor == '' and o_data.fillfactor|default('', 'true') != data.fillfactor %}
 ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 RESET(
   FILLFACTOR
@@ -94,9 +78,10 @@ REFRESH MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }} WITH{{ ' NO
 {% if ((data.autovacuum_custom is defined and data.autovacuum_custom|lower == 'false') or
 (data.toast_autovacuum is defined and data.toast_autovacuum|lower == 'false')
 ) %}
-{% if data.autovacuum_custom is defined %}
+{% if data.autovacuum_custom|lower == 'false' %}
 ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 RESET(
+  autovacuum_enabled,
   autovacuum_vacuum_threshold,
   autovacuum_analyze_threshold,
   autovacuum_vacuum_scale_factor,
@@ -107,10 +92,25 @@ RESET(
   autovacuum_freeze_max_age,
   autovacuum_freeze_table_age
 );
+
+{% if data.toast_autovacuum is defined and data.toast_autovacuum|lower != 'false' %}
+{% if('vacuum_toast' in data and data['vacuum_toast']['changed']|length > 0) %}
+ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
+{% for field in data['vacuum_toast']['changed'] %}
+{% if field.value != None %}
+  {{ field.name }} = {{ field.value|lower }}{% if not loop.last  %},{% endif %}{{ '\r' }}
+{% endif %}
+{% endfor %}
+);
+
+{% endif %}
+{% endif %}
+
 {% endif %}
-{% if data.toast_autovacuum is defined %}
+{% if data.toast_autovacuum|lower == 'false' %}
 ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
 RESET(
+  toast.autovacuum_enabled,
   toast.autovacuum_vacuum_threshold,
   toast.autovacuum_analyze_threshold,
   toast.autovacuum_vacuum_scale_factor,
@@ -121,19 +121,54 @@ RESET(
   toast.autovacuum_freeze_max_age,
   toast.autovacuum_freeze_table_age
 );
-{% endif %}
-{% elif(data['vacuum_data']['changed']|length > 0) %}
+
+{% if data.autovacuum_custom is defined and data.autovacuum_custom|lower != 'false' %}
+{% if('vacuum_table' in data and data['vacuum_table']['changed']|length > 0) %}
 ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }} SET(
-{% for field in data['vacuum_data']['changed'] %}
+{% for field in data['vacuum_table']['changed'] %}
 {% if field.value != None %}
   {{ field.name }} = {{ field.value|lower }}{% if not loop.last  %},{% endif %}{{ '\r' }}
 {% endif %}
 {% endfor %}
 );

+{% endif %}
+{% endif %}
+{% endif %}{#-- toast_endif ends --#}
+
+{% else %}
+{% if data['vacuum_data']['reset']|length == 0 and
+data['vacuum_data']['changed']|length == 0 and data['settings']|length > 0 %}
+ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+SET(
+{% for field in data['settings'] %}
+  {{ field }} = {{ data['settings'][field]|lower }}{% if not loop.last  %},{% endif %}{{ '\r' }}
+{% endfor %}
+);
+
+{% endif %}
+{% if(data['vacuum_data']['changed']|length > 0) %}
+ALTER MATERIALIZED VIEW {{ conn|qtIdent(data.schema, data.name) }}
+SET(
+{% for field in data['vacuum_data']['changed'] %}
+{% if field.value != None %}
+  {{ field.name }} = {{ field.value|lower }}{% if not loop.last  %},{% endif %}{{ '\r' }}
+{% endif %}
+{% endfor %}
+);
+{% endif %}
+{% if data['vacuum_data']['reset']|length > 0 %}
+ALTER MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
+RESET(
+{% for field in data['vacuum_data']['reset'] %}
+  {{ field.name }}{% if not loop.last  %},{% endif %}{{ '\r' }}
+{% endfor %}
+);
+{% endif %}
 {% endif %}{# ===== End check for custom autovaccum ===== #}
 {% endif %}{# ===== End block for check data definition ===== #}
-{% if data.comment and data.comment != o_data.comment %}
+{% set old_comment = o_data.comment|default('', true) %}
+{% if (data.comment is defined and (data.comment != old_comment)) %}

 COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
   IS {{ data.comment|qtLiteral }};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/view_id.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/view_id.sql
index d192a80..487e59e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/view_id.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/templates/mview/ppas/9.3_plus/sql/view_id.sql
@@ -1,4 +1,4 @@
 {# ===== Below will provide view id for last created view ==== #}
 {% if data %}
-SELECT c.oid FROM pg_class c WHERE c.relname = '{{ data.name }}';
+SELECT c.oid, c.relname FROM pg_class c WHERE c.relname = '{{ data.name }}';
 {% endif %}
