forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc5b2818
committed
Force NO SCROLL for plpgsql's implicit cursors.
Further thought about bug #17050 suggests that it's a good ideato use CURSOR_OPT_NO_SCROLL for the implicit cursor opened bya plpgsql FOR-over-query loop. This ensures that, if somebodycommits inside the loop, PersistHoldablePortal won't try torewind and re-read the cursor. While we'd have selected NO_SCROLLanyway if FOR UPDATE/SHARE appears in the query, there are otherhazards with volatile functions; and in any case, it's silly toexpend effort storing rows that we know for certain won't be needed.(While here, improve the comment in exec_run_select, which was a bitconfused about the rationale for when we can use parallel mode.Cursor operations aren't a hazard for nameless portals.)This wasn't an issue until v11, which introduced the possibilityof persisting such cursors. Hence, back-patch to v11.Per bug #17050 from Алексей Булгаков.Discussion:https://postgr.es/m/17050-f77aa827dc85247c@postgresql.org1 parentc1fd756 commitc5b2818
1 file changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4558 | 4558 | | |
4559 | 4559 | | |
4560 | 4560 | | |
4561 | | - | |
| 4561 | + | |
4562 | 4562 | | |
4563 | 4563 | | |
4564 | 4564 | | |
| |||
5903 | 5903 | | |
5904 | 5904 | | |
5905 | 5905 | | |
5906 | | - | |
5907 | | - | |
5908 | | - | |
5909 | | - | |
| 5906 | + | |
| 5907 | + | |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
| 5911 | + | |
5910 | 5912 | | |
5911 | 5913 | | |
5912 | | - | |
5913 | | - | |
| 5914 | + | |
| 5915 | + | |
| 5916 | + | |
| 5917 | + | |
| 5918 | + | |
| 5919 | + | |
| 5920 | + | |
5914 | 5921 | | |
5915 | 5922 | | |
5916 | 5923 | | |
| |||
0 commit comments
Comments
(0)