2 REFRESH MATERIALIZED VIEW
4 REFRESH MATERIALIZED VIEW — replace the contents of a materialized view
8 REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] name
13 REFRESH MATERIALIZED VIEW completely replaces the contents of a
14 materialized view. To execute this command you must have the MAINTAIN
15 privilege on the materialized view. The old contents are discarded. If
16 WITH DATA is specified (or defaults) the backing query is executed to
17 provide the new data, and the materialized view is left in a scannable
18 state. If WITH NO DATA is specified no new data is generated and the
19 materialized view is left in an unscannable state.
21 CONCURRENTLY and WITH NO DATA may not be specified together.
26 Refresh the materialized view without locking out concurrent
27 selects on the materialized view. Without this option a refresh
28 which affects a lot of rows will tend to use fewer resources and
29 complete more quickly, but could block other connections which
30 are trying to read from the materialized view. This option may
31 be faster in cases where a small number of rows are affected.
33 This option is only allowed if there is at least one UNIQUE
34 index on the materialized view which uses only column names and
35 includes all rows; that is, it must not be an expression index
36 or include a WHERE clause.
38 This option can only be used when the materialized view is
41 Even with this option only one REFRESH at a time may run against
42 any one materialized view.
45 The name (optionally schema-qualified) of the materialized view
50 If there is an ORDER BY clause in the materialized view's defining
51 query, the original contents of the materialized view will be ordered
52 that way; but REFRESH MATERIALIZED VIEW does not guarantee to preserve
55 While REFRESH MATERIALIZED VIEW is running, the search_path is
56 temporarily changed to pg_catalog, pg_temp.
60 This command will replace the contents of the materialized view called
61 order_summary using the query from the materialized view's definition,
62 and leave it in a scannable state:
63 REFRESH MATERIALIZED VIEW order_summary;
65 This command will free storage associated with the materialized view
66 annual_statistics_basis and leave it in an unscannable state:
67 REFRESH MATERIALIZED VIEW annual_statistics_basis WITH NO DATA;
71 REFRESH MATERIALIZED VIEW is a PostgreSQL extension.
75 CREATE MATERIALIZED VIEW, ALTER MATERIALIZED VIEW, DROP MATERIALIZED