forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2b2bacd
committed
Reset statement_timeout between queries of a multi-query string.
Historically, we started the timer (if StatementTimeout > 0) at thebeginning of a simple-Query message and usually let it run until theend, so that the timeout limit applied to the entire query string,and intra-string changes of the statement_timeout GUC had no effect.But, confusingly, a COMMIT within the string would reset the stateand allow a fresh timeout cycle to start with the current setting.Commitf8e5f15 changed the behavior of statement_timeout for extendedquery protocol, and as an apparently-unintended side effect, a change inthe statement_timeout GUC during a multi-statement simple-Query messagemight have an effect immediately --- but only if it was going from"disabled" to "enabled".This is all pretty confusing, not to mention completely undocumented.Let's change things so that the timeout is always reset between queriesof a multi-query string, whether they're transaction control commandsor not. Thus the active timeout setting is applied to each query inthe string, separately. This costs a few more cycles if statement_timeoutis active, but it provides much more intuitive behavior, especially if onechanges statement_timeout in one of the queries of the string.Also, add something to the documentation to explain all this.Per bug #16035 from Raj Mohite. Although this is a bug fix, I'm hesitantto back-patch it; conceivably somebody has worked out the old behaviorand is depending on it. (But note that this change should make thebehavior less restrictive in most cases, since the timeout will nowbe applied to shorter segments of code.)Discussion:https://postgr.es/m/16035-456e6e69ebfd4374@postgresql.org1 parentc114229 commit2b2bacd
2 files changed
+29
-6
lines changedLines changed: 18 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7592 | 7592 |
| |
7593 | 7593 |
| |
7594 | 7594 |
| |
7595 |
| - | |
7596 |
| - | |
7597 |
| - | |
7598 |
| - | |
7599 |
| - | |
| 7595 | + | |
| 7596 | + | |
| 7597 | + | |
| 7598 | + | |
| 7599 | + | |
| 7600 | + | |
| 7601 | + | |
| 7602 | + | |
| 7603 | + | |
| 7604 | + | |
| 7605 | + | |
| 7606 | + | |
| 7607 | + | |
| 7608 | + | |
| 7609 | + | |
| 7610 | + | |
| 7611 | + | |
| 7612 | + | |
7600 | 7613 |
| |
7601 | 7614 |
| |
7602 | 7615 |
| |
|
Lines changed: 11 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1270 | 1270 |
| |
1271 | 1271 |
| |
1272 | 1272 |
| |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1273 | 1280 |
| |
1274 | 1281 |
| |
1275 | 1282 |
| |
| |||
2135 | 2142 |
| |
2136 | 2143 |
| |
2137 | 2144 |
| |
2138 |
| - | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
2139 | 2149 |
| |
2140 | 2150 |
| |
2141 | 2151 |
| |
|
0 commit comments
Comments
(0)