forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5c571a3

Etsuro Fujita
postgres_fdw: Avoid "cursor can only scan forward" error.
Commitd844cd7 disallowed rewind in a non-scrollable cursor to resolveanomalies arising from such a cursor operation. However, this failed totake into account the assumption in postgres_fdw that when rescanning aforeign relation, it can rewind the cursor created for scanning theforeign relation without specifying the SCROLL option, regardless of itsscrollability, causing this error when it tried to do such a rewind in anon-scrollable cursor. Fix by modifying postgres_fdw to insteadrecreate the cursor, regardless of its scrollability, when rescanningthe foreign relation. (If we had a way to check its scrollability, wecould improve this by rewinding it if it is scrollable and recreating itif not, but we do not have it, so this commit modifies it to recreate itin any case.)Per bug #17889 from Eric Cyr. Devrim Gunduz also reported this problem.Back-patch to v15 where that commit enforced the prohibition.Reviewed by Tom Lane.Discussion:https://postgr.es/m/17889-e8c39a251d258dda%40postgresql.orgDiscussion:https://postgr.es/m/b415ac3255f8352d1ea921cf3b7ba39e0587768a.camel%40gunduz.org1 parentc145f32 commit5c571a3
File tree
3 files changed
+85
-5
lines changed- contrib/postgres_fdw
- expected
- sql
3 files changed
+85
-5
lines changedLines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6853 | 6853 |
| |
6854 | 6854 |
| |
6855 | 6855 |
| |
| 6856 | + | |
| 6857 | + | |
| 6858 | + | |
| 6859 | + | |
| 6860 | + | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
| 6867 | + | |
| 6868 | + | |
| 6869 | + | |
| 6870 | + | |
| 6871 | + | |
| 6872 | + | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
| 6876 | + | |
| 6877 | + | |
| 6878 | + | |
| 6879 | + | |
| 6880 | + | |
| 6881 | + | |
| 6882 | + | |
| 6883 | + | |
| 6884 | + | |
| 6885 | + | |
| 6886 | + | |
| 6887 | + | |
| 6888 | + | |
| 6889 | + | |
| 6890 | + | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
| 6898 | + | |
| 6899 | + | |
| 6900 | + | |
6856 | 6901 |
| |
6857 | 6902 |
| |
6858 | 6903 |
| |
|
Lines changed: 15 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1662 | 1662 |
| |
1663 | 1663 |
| |
1664 | 1664 |
| |
1665 |
| - | |
1666 |
| - | |
1667 |
| - | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
1668 | 1671 |
| |
1669 | 1672 |
| |
1670 | 1673 |
| |
| |||
1674 | 1677 |
| |
1675 | 1678 |
| |
1676 | 1679 |
| |
1677 |
| - | |
1678 |
| - | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
1679 | 1689 |
| |
1680 | 1690 |
| |
1681 | 1691 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1647 | 1647 |
| |
1648 | 1648 |
| |
1649 | 1649 |
| |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
1650 | 1675 |
| |
1651 | 1676 |
| |
1652 | 1677 |
| |
|
0 commit comments
Comments
(0)