aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-03-11 21:31:28 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2013-03-11 21:31:28 -0400
commitcc3f281ffb0a5d9b187e7a7b7de4a045809ff683 (patch)
treeb4e6954f09642abb8502d15e5127aabbaf9c056d /contrib/postgres_fdw/postgres_fdw.h
parent8f9cc41daf08be802933dc788517743719ee0949 (diff)
downloadpostgresql-cc3f281ffb0a5d9b187e7a7b7de4a045809ff683.tar.gz
postgresql-cc3f281ffb0a5d9b187e7a7b7de4a045809ff683.zip
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 value the same way it was meant. pg_dump has been aware of this hazard for a long time, but postgres_fdw needs to deal with it too. To fix data retrieval from the remote server, set the necessary remote GUC settings at connection startup. (We were already assuming that settings made then would persist throughout the remote session.) To fix data transmission to the remote server, temporarily force the relevant GUCs to the right values when 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 to think of defining one uber-GUC that would override any settings that might render printed data values unportable. But of course, older remote servers wouldn't know any such thing and would still need this logic. While at it, revert commit f7951eef89be78c50ea2241f593d76dfefe176c9, since this provides a real fix. (The timestamptz given in the error message returned from the "remote" server will now reliably be shown in UTC.)
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.h')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h
index 236a60b4898..9149aa186f7 100644
--- a/contrib/postgres_fdw/postgres_fdw.h
+++ b/contrib/postgres_fdw/postgres_fdw.h
@@ -20,6 +20,10 @@
#include "libpq-fe.h"
+/* in postgres_fdw.c */
+extern int set_transmission_modes(void);
+extern void reset_transmission_modes(int nestlevel);
+
/* in connection.c */
extern PGconn *GetConnection(ForeignServer *server, UserMapping *user,
bool will_prep_stmt);