]> granicus.if.org Git - postgresql/commit
Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Mar 2013 19:22:21 +0000 (15:22 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Mar 2013 19:22:21 +0000 (15:22 -0400)
commitf24820618b05348c7d6d7cf5e8ab4f272073a18f
tree9ef33304f7e831e07f5192f6376b3a08adbeaf9f
parentb8f459979f4ce5c1b1c32346bedb8dadc9c0e835
Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely.

If the remote database's settings of these GUCs are different from ours,
ambiguous datetime values may be read incorrectly.  To fix, temporarily
adopt the remote server's settings while we ingest a query result.

This is not a complete fix, since it doesn't do anything about ambiguous
values in commands sent to the remote server; but there seems little we
can do about that end of it given dblink's entirely textual API for
transmitted commands.

Back-patch to 9.2.  The hazard exists in all versions, but this patch
would need more work to apply before 9.2.  Given the lack of field
complaints about this issue, it doesn't seem worth the effort at present.

Daniel Farina and Tom Lane
contrib/dblink/dblink.c
contrib/dblink/expected/dblink.out
contrib/dblink/sql/dblink.sql