diff options
author | Jeff Davis | 2024-07-16 22:41:29 +0000 |
---|---|---|
committer | Jeff Davis | 2024-07-16 22:41:29 +0000 |
commit | 4b74ebf726d444ba820830cad986a1f92f724649 (patch) | |
tree | 7b985099966a2649debd6628f4f416baf8467108 /src/include | |
parent | 0a8ca122e511884d98a640cb3302866b74638688 (diff) |
When creating materialized views, use REFRESH to load data.
Previously, CREATE MATERIALIZED VIEW ... WITH DATA populated the MV
the same way as CREATE TABLE ... AS.
Instead, reuse the REFRESH logic, which locks down security-restricted
operations and restricts the search_path. This reduces the chance that
a subsequent refresh will fail.
Reported-by: Noah Misch
Backpatch-through: 17
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/commands/matview.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/commands/matview.h b/src/include/commands/matview.h index 817b2ba0b6f..a226b2e68fb 100644 --- a/src/include/commands/matview.h +++ b/src/include/commands/matview.h @@ -25,6 +25,9 @@ extern void SetMatViewPopulatedState(Relation relation, bool newstate); extern ObjectAddress ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString, ParamListInfo params, QueryCompletion *qc); +extern ObjectAddress RefreshMatViewByOid(Oid matviewOid, bool skipData, bool concurrent, + const char *queryString, ParamListInfo params, + QueryCompletion *qc); extern DestReceiver *CreateTransientRelDestReceiver(Oid transientoid); |