Skip to content
Snippets Groups Projects
  1. Mar 12, 2013
    • Tom Lane's avatar
      Fix postgres_fdw's issues with inconsistent interpretation of data values. · cc3f281f
      Tom Lane authored
      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 f7951eef, 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.)
      cc3f281f
  2. Mar 10, 2013
    • Tom Lane's avatar
      Support writable foreign tables. · 21734d2f
      Tom Lane authored
      This patch adds the core-system infrastructure needed to support updates
      on foreign tables, and extends contrib/postgres_fdw to allow updates
      against remote Postgres servers.  There's still a great deal of room for
      improvement in optimization of remote updates, but at least there's basic
      functionality there now.
      
      KaiGai Kohei, reviewed by Alexander Korotkov and Laurenz Albe, and rather
      heavily revised by Tom Lane.
      21734d2f
  3. Feb 22, 2013
    • Tom Lane's avatar
      Fix some planning oversights in postgres_fdw. · c0c6acdf
      Tom Lane authored
      Include eval costs of local conditions in remote-estimate mode, and don't
      assume the remote eval cost is zero in local-estimate mode.  (The best
      we can do with that at the moment is to assume a seqscan, which may well
      be wildly pessimistic ... but zero won't do at all.)
      
      To get a reasonable local estimate, we need to know the relpages count
      for the remote rel, so improve the ANALYZE code to fetch that rather
      than just setting the foreign table's relpages field to zero.
      c0c6acdf
  4. Feb 21, 2013
    • Tom Lane's avatar
      Add postgres_fdw contrib module. · d0d75c40
      Tom Lane authored
      There's still a lot of room for improvement, but it basically works,
      and we need this to be present before we can do anything much with the
      writable-foreign-tables patch.  So let's commit it and get on with testing.
      
      Shigeru Hanada, reviewed by KaiGai Kohei and Tom Lane
      d0d75c40
Loading