forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3c4ca21
committed
Have DISCARD ALL/TEMP remove leftover temp tables
Previously, it would only remove temp tables created in the samesession; but if the session uses the BackendId of a previously crashedbackend that left temp tables around, those would not get removed.Since autovacuum would not drop them either (because it sees that theBackendId is in use by the current session) these can cause annoyingxid-wraparound warnings.Apply to branches 9.4 to 10. This is not a problem since version 11,because commit943576b added state tracking that makes autovacuumrealize that those temp tables are not ours, so it removes them.This is useful to handle in DISCARD, because even though it does nothandle all situations, it does handle the common one where a connectionpooler keeps the same session open for an indefinitely long time.Discussion:https://postgr.es/m/20181226190834.wsk2wzott5yzrjiq@alvherre.pgsqlReviewed-by: Takayuki Tsunakawa, Michaël Paquier1 parenta6ca47c commit3c4ca21
1 file changed
+19
-0
lines changedLines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4042 | 4042 |
| |
4043 | 4043 |
| |
4044 | 4044 |
| |
| 4045 | + | |
| 4046 | + | |
| 4047 | + | |
4045 | 4048 |
| |
4046 | 4049 |
| |
4047 | 4050 |
| |
4048 | 4051 |
| |
| 4052 | + | |
| 4053 | + | |
4049 | 4054 |
| |
4050 | 4055 |
| |
| 4056 | + | |
| 4057 | + | |
| 4058 | + | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
4051 | 4070 |
| |
4052 | 4071 |
| |
4053 | 4072 |
| |
|
0 commit comments
Comments
(0)