diff --git a/doc/src/sgml/ref/create_materialized_view.sgml b/doc/src/sgml/ref/create_materialized_view.sgml
index a7e4e210eeb0ef20bb7ea046f5c72a36cc4ad880..0ed764b353394137afd73c9a013e031e197ae79c 100644
*** a/doc/src/sgml/ref/create_materialized_view.sgml
--- b/doc/src/sgml/ref/create_materialized_view.sgml
*************** PostgreSQL documentation
*** 21,27 ****
  
   <refsynopsisdiv>
  <synopsis>
! CREATE [ UNLOGGED ] MATERIALIZED VIEW <replaceable>table_name</replaceable>
      [ (<replaceable>column_name</replaceable> [, ...] ) ]
      [ WITH ( <replaceable class="PARAMETER">storage_parameter</replaceable> [= <replaceable class="PARAMETER">value</replaceable>] [, ... ] ) ]
      [ TABLESPACE <replaceable class="PARAMETER">tablespace_name</replaceable> ]
--- 21,27 ----
  
   <refsynopsisdiv>
  <synopsis>
! CREATE MATERIALIZED VIEW <replaceable>table_name</replaceable>
      [ (<replaceable>column_name</replaceable> [, ...] ) ]
      [ WITH ( <replaceable class="PARAMETER">storage_parameter</replaceable> [= <replaceable class="PARAMETER">value</replaceable>] [, ... ] ) ]
      [ TABLESPACE <replaceable class="PARAMETER">tablespace_name</replaceable> ]
*************** CREATE [ UNLOGGED ] MATERIALIZED VIEW <r
*** 55,70 ****
  
    <variablelist>
     <varlistentry>
-     <term><literal>UNLOGGED</></term>
-     <listitem>
-      <para>
-       If specified, the materialized view will be unlogged.
-       Refer to <xref linkend="sql-createtable"> for details.
-      </para>
-     </listitem>
-    </varlistentry>
- 
-    <varlistentry>
      <term><replaceable>table_name</replaceable></term>
      <listitem>
       <para>
--- 55,60 ----
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index fb28e471685c7462e8076556a78ef45b561f3d2e..53ff4ed9c1eed923219ee3f0bfc1eff6ccdcf202 100644
*** a/src/backend/parser/analyze.c
--- b/src/backend/parser/analyze.c
*************** transformCreateTableAsStmt(ParseState *p
*** 2167,2172 ****
--- 2167,2184 ----
  					 errmsg("materialized views may not be defined using bound parameters")));
  
  		/*
+ 		 * For now, we disallow unlogged materialized views, because it
+ 		 * seems like a bad idea for them to just go to empty after a crash.
+ 		 * (If we could make them go into unscannable state, that would be
+ 		 * better, but that requires catalog changes which crash recovery
+ 		 * can't presently do.)
+ 		 */
+ 		if (stmt->into->rel->relpersistence == RELPERSISTENCE_UNLOGGED)
+ 			ereport(ERROR,
+ 					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ 					 errmsg("materialized views cannot be UNLOGGED")));
+ 
+ 		/*
  		 * At runtime, we'll need a copy of the parsed-but-not-rewritten Query
  		 * for purposes of creating the view's ON SELECT rule.  We stash that
  		 * in the IntoClause because that's where intorel_startup() can
diff --git a/src/test/regress/expected/matview.out b/src/test/regress/expected/matview.out
index e87775679ac9eb059af776e6e4c20e3bed7360da..06bb2551a83480361ddfce5ad02b76240d9eaf63 100644
*** a/src/test/regress/expected/matview.out
--- b/src/test/regress/expected/matview.out
*************** SELECT * FROM tvvm;
*** 279,337 ****
  (1 row)
  
  -- test diemv when the mv does not exist
! DROP MATERIALIZED VIEW IF EXISTS tum;
! NOTICE:  materialized view "tum" does not exist, skipping
! -- make sure that an unlogged materialized view works (in the absence of a crash)
! CREATE UNLOGGED MATERIALIZED VIEW tum AS SELECT type, sum(amt) AS totamt FROM t GROUP BY type WITH NO DATA;
! SELECT pg_relation_is_scannable('tum'::regclass);
!  pg_relation_is_scannable 
! --------------------------
!  f
! (1 row)
! 
! SELECT * FROM tum;
! ERROR:  materialized view "tum" has not been populated
! HINT:  Use the REFRESH MATERIALIZED VIEW command.
! REFRESH MATERIALIZED VIEW tum;
! SELECT pg_relation_is_scannable('tum'::regclass);
!  pg_relation_is_scannable 
! --------------------------
!  t
! (1 row)
! 
! SELECT * FROM tum;
!  type | totamt 
! ------+--------
!  y    |     12
!  z    |     24
!  x    |      5
! (3 rows)
! 
! REFRESH MATERIALIZED VIEW tum WITH NO DATA;
! SELECT pg_relation_is_scannable('tum'::regclass);
!  pg_relation_is_scannable 
! --------------------------
!  f
! (1 row)
! 
! SELECT * FROM tum;
! ERROR:  materialized view "tum" has not been populated
! HINT:  Use the REFRESH MATERIALIZED VIEW command.
! REFRESH MATERIALIZED VIEW tum WITH DATA;
! SELECT pg_relation_is_scannable('tum'::regclass);
!  pg_relation_is_scannable 
! --------------------------
!  t
! (1 row)
! 
! SELECT * FROM tum;
!  type | totamt 
! ------+--------
!  y    |     12
!  z    |     24
!  x    |      5
! (3 rows)
! 
  -- test join of mv and view
  SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type) ORDER BY type;
   type | mtot | vtot 
--- 279,286 ----
  (1 row)
  
  -- test diemv when the mv does not exist
! DROP MATERIALIZED VIEW IF EXISTS no_such_mv;
! NOTICE:  materialized view "no_such_mv" does not exist, skipping
  -- test join of mv and view
  SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type) ORDER BY type;
   type | mtot | vtot 
*************** SELECT type, m.totamt AS mtot, v.totamt 
*** 341,348 ****
   z    |   24 |   24
  (3 rows)
  
- -- test diemv when the mv does exist
- DROP MATERIALIZED VIEW IF EXISTS tum;
  -- make sure that dependencies are reported properly when they block the drop
  DROP TABLE t;
  ERROR:  cannot drop table t because other objects depend on it
--- 290,295 ----
diff --git a/src/test/regress/sql/matview.sql b/src/test/regress/sql/matview.sql
index 9fbaafac6d0ae609e80f777754d6f71189cc4af0..09a7378133c86d66755dafd1629719a712badfdf 100644
*** a/src/test/regress/sql/matview.sql
--- b/src/test/regress/sql/matview.sql
*************** SELECT * FROM tvmm;
*** 87,114 ****
  SELECT * FROM tvvm;
  
  -- test diemv when the mv does not exist
! DROP MATERIALIZED VIEW IF EXISTS tum;
! 
! -- make sure that an unlogged materialized view works (in the absence of a crash)
! CREATE UNLOGGED MATERIALIZED VIEW tum AS SELECT type, sum(amt) AS totamt FROM t GROUP BY type WITH NO DATA;
! SELECT pg_relation_is_scannable('tum'::regclass);
! SELECT * FROM tum;
! REFRESH MATERIALIZED VIEW tum;
! SELECT pg_relation_is_scannable('tum'::regclass);
! SELECT * FROM tum;
! REFRESH MATERIALIZED VIEW tum WITH NO DATA;
! SELECT pg_relation_is_scannable('tum'::regclass);
! SELECT * FROM tum;
! REFRESH MATERIALIZED VIEW tum WITH DATA;
! SELECT pg_relation_is_scannable('tum'::regclass);
! SELECT * FROM tum;
  
  -- test join of mv and view
  SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type) ORDER BY type;
  
- -- test diemv when the mv does exist
- DROP MATERIALIZED VIEW IF EXISTS tum;
- 
  -- make sure that dependencies are reported properly when they block the drop
  DROP TABLE t;
  
--- 87,97 ----
  SELECT * FROM tvvm;
  
  -- test diemv when the mv does not exist
! DROP MATERIALIZED VIEW IF EXISTS no_such_mv;
  
  -- test join of mv and view
  SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type) ORDER BY type;
  
  -- make sure that dependencies are reported properly when they block the drop
  DROP TABLE t;
  
