Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY.
Kevin Grittner <kgrittn@postgresql.org>
Add support for REFRESH MATERIALIZED VIEW CONCURRENTLY. This allows reads to continue without any blocking while a REFRESH runs. The new data appears atomically as part of transaction commit. Review questioned the Assert that a matview was not a system relation. This will be addressed separately. Reviewed by Hitoshi Harada, Robert Haas, Andres Freund. Merged after review with security patch f3ab5d4.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/mvcc.sgml | modified | +1 −2 |
| doc/src/sgml/ref/refresh_materialized_view.sgml | modified | +33 −1 |
| src/backend/commands/cluster.c | modified | +21 −6 |
| src/backend/commands/matview.c | modified | +487 −37 |
| src/backend/commands/tablecmds.c | modified | +2 −1 |
| src/backend/executor/execMain.c | modified | +6 −4 |
| src/backend/executor/nodeModifyTable.c | modified | +3 −2 |
| src/backend/nodes/copyfuncs.c | modified | +1 −0 |
| src/backend/nodes/equalfuncs.c | modified | +1 −0 |
| src/backend/parser/gram.y | modified | +4 −3 |
| src/bin/psql/tab-complete.c | modified | +17 −0 |
| src/include/commands/cluster.h | modified | +2 −1 |
| src/include/commands/matview.h | modified | +2 −0 |
| src/include/nodes/parsenodes.h | modified | +1 −0 |
| src/test/regress/expected/matview.out | modified | +37 −1 |
| src/test/regress/sql/matview.sql | modified | +28 −1 |