mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
Add a materialized view relations.
A materialized view has a rule just like a view and a heap and other physical properties like a table. The rule is only used to populate the table, references in queries refer to the materialized data. This is a minimal implementation, but should still be useful in many cases. Currently data is only populated "on demand" by the CREATE MATERIALIZED VIEW and REFRESH MATERIALIZED VIEW statements. It is expected that future releases will add incremental updates with various timings, and that a more refined concept of defining what is "fresh" data will be developed. At some point it may even be possible to have queries use a materialized in place of references to underlying tables, but that requires the other above-mentioned features to be working first. Much of the documentation work by Robert Haas. Review by Noah Misch, Thom Brown, Robert Haas, Marko Tiikkaja Security review by KaiGai Kohei, with a decision on how best to implement sepgsql still pending.
This commit is contained in:
@ -2908,7 +2908,8 @@ _getObjectDescription(PQExpBuffer buf, TocEntry *te, ArchiveHandle *AH)
|
||||
const char *type = te->desc;
|
||||
|
||||
/* Use ALTER TABLE for views and sequences */
|
||||
if (strcmp(type, "VIEW") == 0 || strcmp(type, "SEQUENCE") == 0)
|
||||
if (strcmp(type, "VIEW") == 0 || strcmp(type, "SEQUENCE") == 0||
|
||||
strcmp(type, "MATERIALIZED VIEW") == 0)
|
||||
type = "TABLE";
|
||||
|
||||
/* objects named by a schema and name */
|
||||
@ -3140,6 +3141,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
|
||||
strcmp(te->desc, "TABLE") == 0 ||
|
||||
strcmp(te->desc, "TYPE") == 0 ||
|
||||
strcmp(te->desc, "VIEW") == 0 ||
|
||||
strcmp(te->desc, "MATERIALIZED VIEW") == 0 ||
|
||||
strcmp(te->desc, "SEQUENCE") == 0 ||
|
||||
strcmp(te->desc, "FOREIGN TABLE") == 0 ||
|
||||
strcmp(te->desc, "TEXT SEARCH DICTIONARY") == 0 ||
|
||||
|
Reference in New Issue
Block a user