forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit57e6e86
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 parentd1c56ad commit57e6e86
File tree
3 files changed
+44
-0
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+44
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16880 | 16880 |
| |
16881 | 16881 |
| |
16882 | 16882 |
| |
| 16883 | + | |
| 16884 | + | |
| 16885 | + | |
| 16886 | + | |
| 16887 | + | |
| 16888 | + | |
16883 | 16889 |
| |
16884 | 16890 |
| |
16885 | 16891 |
| |
16886 | 16892 |
| |
16887 | 16893 |
| |
16888 | 16894 |
| |
16889 | 16895 |
| |
| 16896 | + | |
| 16897 | + | |
16890 | 16898 |
| |
16891 | 16899 |
| |
16892 | 16900 |
| |
|
Lines changed: 20 additions & 0 deletions
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 |
| |
|
Lines changed: 16 additions & 0 deletions
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)