aboutsummaryrefslogtreecommitdiff
path: root/src/backend/regex/regc_lex.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2016-02-16 02:15:44 +0900
committerFujii Masao <fujii@postgresql.org>2016-02-16 02:15:44 +0900
commit31b6606c48edf7c008ffe91907c080404a8c8046 (patch)
treec2b95eb84d1dd8d1e0d6fb29f052b1d2085d8af4 /src/backend/regex/regc_lex.c
parent57c932475504d63d8f8a68fc6925d7decabc378a (diff)
downloadpostgresql-31b6606c48edf7c008ffe91907c080404a8c8046.tar.gz
postgresql-31b6606c48edf7c008ffe91907c080404a8c8046.zip
Make concurrent refresh check early that there is a unique index on matview.
In REFRESH MATERIALIZED VIEW command, CONCURRENTLY option is only allowed if there is at least one unique index with no WHERE clause on one or more columns of the matview. Previously, concurrent refresh checked the existence of a unique index on the matview after filling the data to new snapshot, i.e., after calling refresh_matview_datafill(). So, when there was no unique index, we could need to wait a long time before we detected that and got the error. It was a waste of time. To eliminate such wasting time, this commit changes concurrent refresh so that it checks the existence of a unique index at the beginning of the refresh operation, i.e., before starting any time-consuming jobs. If CONCURRENTLY option is not allowed due to lack of a unique index, concurrent refresh can immediately detect it and emit an error. Author: Masahiko Sawada Reviewed-by: Michael Paquier, Fujii Masao
Diffstat (limited to 'src/backend/regex/regc_lex.c')
0 files changed, 0 insertions, 0 deletions