1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Move materialized views' is-populated status into their pg_class entries.

Previously this state was represented by whether the view's disk file had
zero or nonzero size, which is problematic for numerous reasons, since it's
breaking a fundamental assumption about heap storage.  This was done to
allow unlogged matviews to revert to unpopulated status after a crash
despite our lack of any ability to update catalog entries post-crash.
However, this poses enough risk of future problems that it seems better to
not support unlogged matviews until we can find another way.  Accordingly,
revert that choice as well as a number of existing kluges forced by it
in favor of creating a pg_class.relispopulated flag column.
This commit is contained in:
Tom Lane
2013-05-06 13:26:51 -04:00
parent 5da5798004
commit 1d6c72a55b
22 changed files with 141 additions and 179 deletions

View File

@ -1863,6 +1863,14 @@
<entry>True if table has (or once had) any inheritance children</entry>
</row>
<row>
<entry><structfield>relispopulated</structfield></entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>True if relation is populated (this is true for all
relations other than some materialized views)</entry>
</row>
<row>
<entry><structfield>relfrozenxid</structfield></entry>
<entry><type>xid</type></entry>
@ -7776,14 +7784,14 @@
<row>
<entry><structfield>hasindexes</structfield></entry>
<entry><type>boolean</type></entry>
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasindex</literal></entry>
<entry></entry>
<entry>True if materialized view has (or recently had) any indexes</entry>
</row>
<row>
<entry><structfield>isscannable</structfield></entry>
<entry><structfield>ispopulated</structfield></entry>
<entry><type>boolean</type></entry>
<entry></entry>
<entry>True if materialized view can currently be scanned</entry>
<entry>True if materialized view is currently populated</entry>
</row>
<row>
<entry><structfield>definition</structfield></entry>

View File

@ -14238,10 +14238,6 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<primary>pg_tablespace_location</primary>
</indexterm>
<indexterm>
<primary>pg_relation_is_scannable</primary>
</indexterm>
<indexterm>
<primary>pg_typeof</primary>
</indexterm>
@ -14410,11 +14406,6 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry><type>text</type></entry>
<entry>get the path in the file system that this tablespace is located in</entry>
</row>
<row>
<entry><literal><function>pg_relation_is_scannable(<parameter>relation_oid</parameter>)</function></literal></entry>
<entry><type>boolean</type></entry>
<entry>is the relation scannable; a materialized view which has not been loaded will not be scannable</entry>
</row>
<row>
<entry><literal><function>pg_typeof(<parameter>any</parameter>)</function></literal></entry>
<entry><type>regtype</type></entry>