forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0d1a7cd
committed
Ensure we have a snapshot while dropping ON COMMIT DROP temp tables.
Dropping a temp table could entail TOAST table access to clean outtoasted catalog entries, such as large pg_constraint.conbin stringsfor complex CHECK constraints. If we did that via ON COMMIT DROP,we triggered the assertion in init_toast_snapshot(), becausethere was no provision for setting up a snapshot for the dropactions. Fix that.(I assume here that the adjacent truncation actions for ON COMMITDELETE ROWS don't have a similar problem: it doesn't seem likenontransactional truncations would need to touch any toasted fields.If that proves wrong, we could refactor a bit to have the samesnapshot acquisition cover that too.)The test case added here does not fail before v15, because thatassertion was added in2776922 which was not back-patched.However, the race condition the assertion warns of surelyexists further back, so back-patch to all supported branches.Per report from Richard Guo.Discussion:https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com1 parent882e522 commit0d1a7cd
File tree
3 files changed
+44
-0
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+44
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16900 | 16900 | | |
16901 | 16901 | | |
16902 | 16902 | | |
| 16903 | + | |
| 16904 | + | |
| 16905 | + | |
| 16906 | + | |
| 16907 | + | |
| 16908 | + | |
16903 | 16909 | | |
16904 | 16910 | | |
16905 | 16911 | | |
16906 | 16912 | | |
16907 | 16913 | | |
16908 | 16914 | | |
16909 | 16915 | | |
| 16916 | + | |
| 16917 | + | |
16910 | 16918 | | |
16911 | 16919 | | |
16912 | 16920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
111 | 131 | | |
112 | 132 | | |
113 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
| |||
0 commit comments
Comments
(0)