- Notifications
You must be signed in to change notification settings - Fork5
Commit9c58101
committed
Fix mishandling of system columns in FDW queries.
postgres_fdw would send query conditions involving system columns to theremote server, even though it makes no effort to ensure that systemcolumns other than CTID match what the remote side thinks. tableoid,in particular, probably won't match and might have some use in queries.Hence, prevent sending conditions that include non-CTID system columns.Also, create_foreignscan_plan neglected to check local restrictionconditions while determining whether to set fsSystemCol for a foreignscan plan node. This again would bollix the results for queries thattest a foreign table's tableoid.Back-patch the first fix to 9.3 where postgres_fdw was introduced.Back-patch the second to 9.2. The code is probably broken in 9.1 aswell, but the patch doesn't apply cleanly there; given the weak stateof support for FDWs in 9.1, it doesn't seem worth fixing.Etsuro Fujita, reviewed by Ashutosh Bapat, and somewhat modified by me1 parenteca2b9b commit9c58101
File tree
4 files changed
+116
-2
lines changed- contrib/postgres_fdw
- expected
- sql
- src/backend/optimizer/plan
4 files changed
+116
-2
lines changedLines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
257 | 269 |
| |
258 | 270 |
| |
259 | 271 |
| |
|
Lines changed: 68 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
832 | 832 |
| |
833 | 833 |
| |
834 | 834 |
| |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
835 | 903 |
| |
836 | 904 |
| |
837 | 905 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
257 | 271 |
| |
258 | 272 |
| |
259 | 273 |
| |
|
Lines changed: 22 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
1957 | 1958 |
| |
1958 | 1959 |
| |
1959 | 1960 |
| |
| 1961 | + | |
| 1962 | + | |
1960 | 1963 |
| |
1961 | 1964 |
| |
1962 | 1965 |
| |
| |||
2004 | 2007 |
| |
2005 | 2008 |
| |
2006 | 2009 |
| |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
2007 | 2014 |
| |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
2008 | 2026 |
| |
2009 |
| - | |
| 2027 | + | |
2010 | 2028 |
| |
2011 |
| - | |
| 2029 | + | |
2012 | 2030 |
| |
2013 | 2031 |
| |
2014 | 2032 |
| |
2015 | 2033 |
| |
2016 | 2034 |
| |
2017 | 2035 |
| |
| 2036 | + | |
| 2037 | + | |
2018 | 2038 |
| |
2019 | 2039 |
| |
2020 | 2040 |
| |
|
0 commit comments
Comments
(0)