]> granicus.if.org Git - postgresql/commit
postgres_fdw: Clean up handling of system columns.
authorRobert Haas <rhaas@postgresql.org>
Fri, 15 Apr 2016 15:58:56 +0000 (11:58 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 15 Apr 2016 16:08:14 +0000 (12:08 -0400)
commitda7d44b627ba839de32c9409aca659f60324de76
treede848f1342a4a69ac08f70fa0df83d50892352a6
parent5702277ca97396384eaf5c58d582b79b9984ce73
postgres_fdw: Clean up handling of system columns.

Previously, querying the xmin column of a single postgres_fdw foreign
table fetched the tuple length, xmax the typmod, and cmin or cmax the
composite type OID of the tuple.  However, when you queried several
such tables and the join got shipped to the remote side, these columns
ended up containing the remote values of the corresponding columns.
Both behaviors are rather unprincipled, the former for obvious reasons
and the latter because the remote values of these columns don't have
any local significance; our transaction IDs are in a different space
than those of the remote machine.  Clean this up by setting all of
these fields to 0 in both cases.  Also fix the handling of tableoid
to be sane.

Robert Haas and Ashutosh Bapat, reviewed by Etsuro Fujita.
contrib/postgres_fdw/deparse.c
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/postgres_fdw.c