diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-22 17:22:31 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-22 17:22:31 -0400 |
commit | 5b86fedfb57ea943f883a13c6d50c5a9e2a1cc57 (patch) | |
tree | 36bfff9b4b7794abb5f04fc9e91afc36ba23f9b2 /contrib/postgres_fdw/connection.c | |
parent | 8a3b6772aedbd95557ab1fc489ddf007ac9d405d (diff) | |
download | postgresql-5b86fedfb57ea943f883a13c6d50c5a9e2a1cc57.tar.gz postgresql-5b86fedfb57ea943f883a13c6d50c5a9e2a1cc57.zip |
Document cross-version compatibility issues for contrib/postgres_fdw.
One of the use-cases for postgres_fdw is extracting data from older PG
servers, so cross-version compatibility is important. Document what we
can do here, and further annotate some of the coding choices that create
compatibility constraints. In passing, remove one unnecessary
incompatibility with old servers, namely assuming that we didn't need to
quote the timezone name 'UTC'.
Diffstat (limited to 'contrib/postgres_fdw/connection.c')
-rw-r--r-- | contrib/postgres_fdw/connection.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c index 0a723f0dfa1..7b9e8c1b6fa 100644 --- a/contrib/postgres_fdw/connection.c +++ b/contrib/postgres_fdw/connection.c @@ -326,9 +326,10 @@ configure_remote_session(PGconn *conn) * anyway. However it makes the regression test outputs more predictable. * * We don't risk setting remote zone equal to ours, since the remote - * server might use a different timezone database. + * server might use a different timezone database. Instead, use UTC + * (quoted, because very old servers are picky about case). */ - do_sql_command(conn, "SET timezone = UTC"); + do_sql_command(conn, "SET timezone = 'UTC'"); /* * Set values needed to ensure unambiguous data output from remote. (This @@ -542,8 +543,14 @@ pgfdw_xact_callback(XactEvent event, void *arg) * prepared statements, do a DEALLOCATE ALL to make sure we * get rid of all prepared statements. This is annoying and * not terribly bulletproof, but it's probably not worth - * trying harder. We intentionally ignore any errors in the - * DEALLOCATE. + * trying harder. + * + * DEALLOCATE ALL only exists in 8.3 and later, so this + * constrains how old a server postgres_fdw can communicate + * with. We intentionally ignore errors in the DEALLOCATE, so + * that we can hobble along to some extent with older servers + * (leaking prepared statements as we go; but we don't really + * support update operations pre-8.3 anyway). */ if (entry->have_prep_stmt && entry->have_error) { |