forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcc3f281
committed
Fix postgres_fdw's issues with inconsistent interpretation of data values.
For datatypes whose output formatting depends on one or more GUC settings,we have to worry about whether the other server will interpret the valuethe same way it was meant. pg_dump has been aware of this hazard for along time, but postgres_fdw needs to deal with it too. To fix dataretrieval from the remote server, set the necessary remote GUC settings atconnection startup. (We were already assuming that settings made thenwould persist throughout the remote session.) To fix data transmission tothe remote server, temporarily force the relevant GUCs to the right valueswhen we're about to convert any data values to text for transmission.This is all pretty grotty, and not very cheap either. It's tempting tothink of defining one uber-GUC that would override any settings that mightrender printed data values unportable. But of course, older remote serverswouldn't know any such thing and would still need this logic.While at it, revert commitf7951ee, sincethis provides a real fix. (The timestamptz given in the error messagereturned from the "remote" server will now reliably be shown in UTC.)1 parent8f9cc41 commitcc3f281
File tree
6 files changed
+122
-29
lines changed- contrib/postgres_fdw
- expected
- sql
6 files changed
+122
-29
lines changedLines changed: 40 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
| |||
314 | 315 |
| |
315 | 316 |
| |
316 | 317 |
| |
317 |
| - | |
318 |
| - | |
| 318 | + | |
319 | 319 |
| |
320 | 320 |
| |
321 |
| - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
322 | 355 |
| |
323 | 356 |
| |
324 | 357 |
| |
| |||
339 | 372 |
| |
340 | 373 |
| |
341 | 374 |
| |
342 |
| - | |
343 | 375 |
| |
344 | 376 |
| |
345 | 377 |
| |
| |||
353 | 385 |
| |
354 | 386 |
| |
355 | 387 |
| |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
| 388 | + | |
360 | 389 |
| |
361 | 390 |
| |
362 | 391 |
| |
| |||
370 | 399 |
| |
371 | 400 |
| |
372 | 401 |
| |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
| 402 | + | |
377 | 403 |
| |
378 | 404 |
| |
379 | 405 |
| |
| |||
509 | 535 |
| |
510 | 536 |
| |
511 | 537 |
| |
512 |
| - | |
513 |
| - | |
514 |
| - | |
515 |
| - | |
| 538 | + | |
516 | 539 |
| |
517 | 540 |
| |
518 | 541 |
| |
| |||
647 | 670 |
| |
648 | 671 |
| |
649 | 672 |
| |
650 |
| - | |
651 |
| - | |
652 |
| - | |
653 |
| - | |
| 673 | + | |
654 | 674 |
| |
655 | 675 |
| |
656 | 676 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
469 | 469 |
| |
470 | 470 |
| |
471 | 471 |
| |
| 472 | + | |
472 | 473 |
| |
473 | 474 |
| |
| 475 | + | |
| 476 | + | |
| 477 | + | |
474 | 478 |
| |
475 | 479 |
| |
476 | 480 |
| |
| |||
487 | 491 |
| |
488 | 492 |
| |
489 | 493 |
| |
| 494 | + | |
| 495 | + | |
490 | 496 |
| |
491 | 497 |
| |
492 | 498 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1983 | 1983 |
| |
1984 | 1984 |
| |
1985 | 1985 |
| |
1986 |
| - | |
| 1986 | + | |
1987 | 1987 |
| |
1988 |
| - | |
1989 |
| - | |
| 1988 | + | |
| 1989 | + | |
1990 | 1990 |
| |
1991 | 1991 |
| |
1992 | 1992 |
| |
| |||
2142 | 2142 |
| |
2143 | 2143 |
| |
2144 | 2144 |
| |
2145 |
| - | |
| 2145 | + | |
2146 | 2146 |
| |
2147 |
| - | |
2148 |
| - | |
| 2147 | + | |
| 2148 | + | |
2149 | 2149 |
| |
2150 | 2150 |
| |
2151 | 2151 |
| |
|
Lines changed: 64 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
| |||
1554 | 1555 |
| |
1555 | 1556 |
| |
1556 | 1557 |
| |
| 1558 | + | |
1557 | 1559 |
| |
1558 | 1560 |
| |
1559 | 1561 |
| |
| 1562 | + | |
| 1563 | + | |
1560 | 1564 |
| |
1561 | 1565 |
| |
1562 | 1566 |
| |
| |||
1598 | 1602 |
| |
1599 | 1603 |
| |
1600 | 1604 |
| |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1601 | 1608 |
| |
1602 | 1609 |
| |
1603 | 1610 |
| |
| |||
1705 | 1712 |
| |
1706 | 1713 |
| |
1707 | 1714 |
| |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1708 | 1765 |
| |
1709 | 1766 |
| |
1710 | 1767 |
| |
| |||
1791 | 1848 |
| |
1792 | 1849 |
| |
1793 | 1850 |
| |
| 1851 | + | |
1794 | 1852 |
| |
1795 | 1853 |
| |
1796 | 1854 |
| |
1797 | 1855 |
| |
1798 | 1856 |
| |
1799 | 1857 |
| |
1800 |
| - | |
| 1858 | + | |
1801 | 1859 |
| |
| 1860 | + | |
1802 | 1861 |
| |
1803 | 1862 |
| |
| 1863 | + | |
| 1864 | + | |
1804 | 1865 |
| |
1805 | 1866 |
| |
1806 | 1867 |
| |
| |||
1815 | 1876 |
| |
1816 | 1877 |
| |
1817 | 1878 |
| |
| 1879 | + | |
| 1880 | + | |
1818 | 1881 |
| |
1819 | 1882 |
| |
1820 | 1883 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 |
| |
24 | 28 |
| |
25 | 29 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
319 |
| - | |
| 319 | + | |
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
340 |
| - | |
| 340 | + | |
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
|
0 commit comments
Comments
(0)