1. 25 Jan, 2017 3 commits
    • Tom Lane's avatar
      Improve speed of contrib/postgres_fdw regression tests. · aa7f593b
      Tom Lane authored
      Commit 7012b132 added some tests that consumed an excessive amount of
      time, more than tripling the time needed for "make installcheck" for this
      module.  Add filter conditions to reduce the number of rows scanned,
      bringing the runtime down to within hailing distance of what it was before.
      
      Jeevan Chalke and Ashutosh Bapat, per a gripe from me
      
      Discussion: https://postgr.es/m/16565.1478104765@sss.pgh.pa.us
      aa7f593b
    • Robert Haas's avatar
      Be more aggressive in avoiding tuple conversion. · 3838074f
      Robert Haas authored
      According to the comments in tupconvert.c, it's necessary to perform
      tuple conversion when either table has OIDs, and this was previously
      checked by ensuring that the tdtypeid value matched between the tables
      in question.  However, that's overly stringent: we have access to
      tdhasoid and can test directly whether OIDs are present, which lets us
      avoid conversion in cases where the type OIDs are different but the
      tuple descriptors are entirely the same (and neither has OIDs).  This
      is useful to the partitioning code, which can thereby avoid converting
      tuples when inserting into a partition whose columns appear in the
      same order as the parent columns, the normal case.  It's possible
      for the tuple routing code to avoid some additional overhead in this
      case as well, so do that, too.
      
      It's not clear whether it would be OK to skip this when both tables
      have OIDs: do callers count on this to build a new tuple (losing the
      previous OID) in such instances?  Until we figure it out, leave the
      behavior in that case alone.
      
      Amit Langote, reviewed by me.
      3838074f
    • Tom Lane's avatar
      Use non-conflicting table names in new regression test case. · 7fa7bf18
      Tom Lane authored
      Commit 587cda35 added a test to updatable_views.sql that created
      tables named the same as tables used by the concurrent inherit.sql
      script.  Unsurprisingly, this results in random failures.
      Pick different names.
      
      Per buildfarm.
      7fa7bf18
  2. 24 Jan, 2017 15 commits
  3. 23 Jan, 2017 11 commits
  4. 22 Jan, 2017 3 commits
    • Tom Lane's avatar
      Relocate static function declarations to be after typedefs in jsonfuncs.c. · 90992e0e
      Tom Lane authored
      Project style is to put things in this order, for the good and sufficient
      reason that you often need the typedefs in the function declarations.
      There already was one function declaration that needed a typedef, which
      was randomly placed away from all the other static function declarations
      in consequence.  And the submitted patch for better json_populate_record
      functionality jumped through even more hoops in order to preserve this
      bad idea.
      
      This patch only moves lines from point A to point B, no other changes.
      90992e0e
    • Tom Lane's avatar
      Remove no-longer-needed loop in ExecGather(). · 0a8b9d3b
      Tom Lane authored
      Coverity complained quite properly that commit ea15e186 had introduced
      unreachable code into ExecGather(); to wit, it was no longer possible to
      iterate the final for-loop more or less than once.  So remove the for().
      
      In passing, clean up a couple of comments, and make better use of a local
      variable.
      0a8b9d3b
    • Peter Eisentraut's avatar
      Add missing break · 8f164e1e
      Peter Eisentraut authored
      8f164e1e
  5. 21 Jan, 2017 3 commits
    • Peter Eisentraut's avatar
      b4800867
    • Tom Lane's avatar
      Fix cross-shlib linking in temporary installs on HPUX 10. · d2ab1176
      Tom Lane authored
      Turns out this has been broken for years and we'd not noticed.  The one
      case that was getting exercised in the buildfarm, or probably anywhere
      else, was postgres_fdw.sl's reference to libpq.sl; and it turns out that
      that was always going to libpq.sl in the actual installation directory
      not the temporary install.  We'd not noticed because the buildfarm script
      does "make install" before it tests contrib.  However, the recent addition
      of a logical-replication test to the core regression scripts resulted in
      trying to use libpqwalreceiver.sl before "make install" happens, and that
      failed for lack of finding libpq.sl, as shown by failures on buildfarm
      members gaur and pademelon.
      
      There are two changes needed to fix it: the magic environment variable to
      specify shlib search path at runtime is SHLIB_PATH not LD_LIBRARY_PATH,
      and the shlib link command needs to specify the +s switch else the library
      will not honor SHLIB_PATH.
      
      I'm not quite sure why buildfarm members anole and gharial (HPUX 11) didn't
      show the same failure.  Consulting man pages on the web says that HPUX 11
      honors both LD_LIBRARY_PATH and SHLIB_PATH, which would explain half of it,
      and the rather confusing wording I've been able to find suggests that +s
      might effectively be the default in HPUX 11.  But it seems at least as
      likely that there's just a libpq.so installed in /usr/lib on that machine;
      as long as it's not too ancient, that would satisfy the test.  In any case
      I do not think this patch will break HPUX 11.
      
      At the moment I don't see a need to back-patch this, since it only matters
      for testing purposes, not to mention that HPUX 10 is probably dead in the
      real world anyway.
      d2ab1176
    • Peter Eisentraut's avatar
      Move some things from builtins.h to new header files · f21a563d
      Peter Eisentraut authored
      This avoids that builtins.h has to include additional header files.
      f21a563d
  6. 20 Jan, 2017 5 commits
    • Robert Haas's avatar
      Avoid useless respawining the autovacuum launcher at high speed. · c6a38979
      Robert Haas authored
      When (1) autovacuum = off and (2) there's at least one database with
      an XID age greater than autovacuum_freeze_max_age and (3) all tables
      in that database that need vacuuming are already being processed by a
      worker and (4) the autovacuum launcher is started, a kind of infinite
      loop occurs.  The launcher starts a worker and immediately exits.  The
      worker, finding no worker to do, immediately starts the launcher,
      supposedly so that the next database can be processed.  But because
      datfrozenxid for that database hasn't been advanced yet, the new
      worker gets put right back into the same database as the old one,
      where it once again starts the launcher and exits.  High-speed ping
      pong ensues.
      
      There are several possible ways to break the cycle; this seems like
      the safest one.
      
      Amit Khandekar (code) and Robert Haas (comments), reviewed by
      Álvaro Herrera.
      
      Discussion: http://postgr.es/m/CAJ3gD9eWejf72HKquKSzax0r+epS=nAbQKNnykkMA0E8c+rMDg@mail.gmail.com
      c6a38979
    • Robert Haas's avatar
      Fix comparison logic in partition_bounds_equal for non-finite bounds. · 6546ffb3
      Robert Haas authored
      If either bound is infinite, then we shouldn't even try to perform a
      comparison of the values themselves.  Rearrange the logic so that
      we don't.
      
      Per buildfarm member skink and Tom Lane.
      6546ffb3
    • Alvaro Herrera's avatar
      Record dependencies on owners for logical replication objects · 50cf1c80
      Alvaro Herrera authored
      This was forgotten in 665d1fad and
      caused the whole buildfarm to become red for a little while.
      
      Author: Petr Jelínek
      
      Also fix a typo in a nearby error message.
      50cf1c80
    • Alvaro Herrera's avatar
      tests: Use the right Perl operator · a600ee9e
      Alvaro Herrera authored
      We were using != to compare strings, for which "ne" is the right thing.
      It's not clear why it works everywhere except on Pavan's machine, but
      it's clearly bogus anyway.
      
      Author and reporter: Pavan Deolasee
      Discussion: https://postgr.es/m/CABOikdPhsHM+pX8skoEY1_T0OtKdO1udzUj4VCjU5VEt+bj4eA@mail.gmail.com
      a600ee9e
    • Tom Lane's avatar
      Try to fix non-MSVC Windows builds in the wake of logical replication. · 0502e854
      Tom Lane authored
      pgoutput evidently needs to be built without -DBUILDING_DLL.  (It seems
      like a pretty bad idea that these makefiles need to know exactly where
      all the shlibs are in the tree, or maybe what's bad is putting them under
      src/backend/.  But right now is not the time to redesign that.)
      
      Also, remove "override CPPFLAGS" in pgoutput's Makefile.  I don't think
      that that actually has any bad consequences, but it's certainly useless
      in a directory that has no .h files, and it might be contributing to the
      failure somehow.
      
      Per buildfarm.
      0502e854