File tree 2 files changed +9
-2
lines changed 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -923,7 +923,8 @@ ERROR: could not serialize access due to read/write dependencies among transact
923
923
924
924
<para>
925
925
Acquired by <command>VACUUM</command> (without <option>FULL</option>),
926
- <command>ANALYZE</>, <command>CREATE INDEX CONCURRENTLY</>, and
926
+ <command>ANALYZE</>, <command>CREATE INDEX CONCURRENTLY</>,
927
+ <command>CREATE STATISTICS</> and
927
928
<command>ALTER TABLE VALIDATE</command> and other
928
929
<command>ALTER TABLE</command> variants (for full details see
929
930
<xref linkend="SQL-ALTERTABLE">).
Original file line number Diff line number Diff line change @@ -96,7 +96,13 @@ CreateStatistics(CreateStatsStmt *stmt)
96
96
errmsg ("statistics \"%s\" already exist" , namestr )));
97
97
}
98
98
99
- rel = heap_openrv (stmt -> relation , AccessExclusiveLock );
99
+ /*
100
+ * CREATE STATISTICS will influence future execution plans but does
101
+ * not interfere with currently executing plans so it is safe to
102
+ * take only ShareUpdateExclusiveLock on relation, conflicting with
103
+ * ANALYZE and other DDL that sets statistical information.
104
+ */
105
+ rel = heap_openrv (stmt -> relation , ShareUpdateExclusiveLock );
100
106
relid = RelationGetRelid (rel );
101
107
102
108
if (rel -> rd_rel -> relkind != RELKIND_RELATION &&
You can’t perform that action at this time.
0 commit comments