We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1933ae6 commit db98918Copy full SHA for db98918
src/backend/tcop/postgres.c
@@ -1155,7 +1155,16 @@ exec_simple_query(const char *query_string)
1155
plantree_list = pg_plan_queries(querytree_list,
1156
CURSOR_OPT_PARALLEL_OK, NULL);
1157
1158
- /* Done with the snapshot used for parsing/planning */
+ /*
1159
+ * Done with the snapshot used for parsing/planning.
1160
+ *
1161
+ * While it looks promising to reuse the same snapshot for query
1162
+ * execution (at least for simple protocol), unfortunately it causes
1163
+ * execution to use a snapshot that has been acquired before locking
1164
+ * any of the tables mentioned in the query. This creates user-
1165
+ * visible anomalies, so refrain. Refer to
1166
+ * https://postgr.es/m/flat/5075D8DF.6050500@fuzzy.cz for details.
1167
+ */
1168
if (snapshot_set)
1169
PopActiveSnapshot();
1170
0 commit comments