1. 25 Jun, 2015 1 commit
  2. 24 Jun, 2015 1 commit
  3. 23 Jun, 2015 4 commits
  4. 22 Jun, 2015 3 commits
    • Tom Lane's avatar
      Improve inheritance_planner()'s performance for large inheritance sets. · 2cb9ec1b
      Tom Lane authored
      Commit c03ad560 introduced a planner
      performance regression for UPDATE/DELETE on large inheritance sets.
      It required copying the append_rel_list (which is of size proportional to
      the number of inherited tables) once for each inherited table, thus
      resulting in O(N^2) time and memory consumption.  While it's difficult to
      avoid that in general, the extra work only has to be done for
      append_rel_list entries that actually reference subquery RTEs, which
      inheritance-set entries will not.  So we can buy back essentially all of
      the loss in cases without subqueries in FROM; and even for those, the added
      work is mainly proportional to the number of UNION ALL subqueries.
      
      Back-patch to 9.2, like the previous commit.
      
      Tom Lane and Dean Rasheed, per a complaint from Thomas Munro.
      2cb9ec1b
    • Robert Haas's avatar
      psql: Add some tab completion for TABLESAMPLE. · da9ee026
      Robert Haas authored
      Petr Jelinek, reviewed by Brendan Jurd
      da9ee026
    • Noah Misch's avatar
      Truncate strings in tarCreateHeader() with strlcpy(), not sprintf(). · 4318118e
      Noah Misch authored
      This supplements the GNU libc bug #6530 workarounds introduced in commit
      54cd4f04.  On affected systems, a
      tar-format pg_basebackup failed when some filename beneath the data
      directory was not valid character data in the postmaster/walsender
      locale.  Back-patch to 9.1, where pg_basebackup was introduced.  Extant,
      bug-prone conversion specifications receive only ASCII bytes or involve
      low-importance messages.
      4318118e
  5. 21 Jun, 2015 4 commits
    • Alvaro Herrera's avatar
      Add transforms to pg_get_object_address and friends · ad89a5d1
      Alvaro Herrera authored
      This was missed when transforms were added by commit cac76582.
      
      Extracted from a larger patch
      Author: Michael Paquier
      ad89a5d1
    • Andres Freund's avatar
      Improve multixact emergency autovacuum logic. · 667912ae
      Andres Freund authored
      Previously autovacuum was not necessarily triggered if space in the
      members slru got tight. The first problem was that the signalling was
      tied to values in the offsets slru, but members can advance much
      faster. Thats especially a problem if old sessions had been around that
      previously prevented the multixact horizon to increase. Secondly the
      skipping logic doesn't work if the database was restarted after
      autovacuum was triggered - that knowledge is not preserved across
      restart. This is especially a problem because it's a common
      panic-reaction to restart the database if it gets slow to
      anti-wraparound vacuums.
      
      Fix the first problem by separating the logic for members from
      offsets. Trigger autovacuum whenever a multixact crosses a segment
      boundary, as the current member offset increases in irregular values, so
      we can't use a simple modulo logic as for offsets.  Add a stopgap for
      the second problem, by signalling autovacuum whenver ERRORing out
      because of boundaries.
      
      Discussion: 20150608163707.GD20772@alap3.anarazel.de
      
      Backpatch into 9.3, where it became more likely that multixacts wrap
      around.
      667912ae
    • Andres Freund's avatar
      Add missing check for wal_debug GUC. · 90231cd5
      Andres Freund authored
      9a20a9b2 added a new elog(), enabled when WAL_DEBUG is defined. The
      other WAL_DEBUG dependant messages check for the wal_debug GUC, but this
      one did not. While at it replace 'upto' with 'up to'.
      
      Discussion: 20150610110253.GF3832@alap3.anarazel.de
      
      Backpatch to 9.4, the first release containing 9a20a9b2.
      90231cd5
    • Peter Eisentraut's avatar
      103382ab
  6. 20 Jun, 2015 4 commits
    • Noah Misch's avatar
      Fix failure to copy setlocale() return value. · f0a264a3
      Noah Misch authored
      POSIX permits setlocale() calls to invalidate any previous setlocale()
      return values, but commit 5f538ad0
      neglected to account for setlocale(LC_CTYPE, NULL) doing so.  The effect
      was to set the LC_CTYPE environment variable to an unintended value.
      pg_perm_setlocale() sets this variable to assist PL/Perl; without it,
      Perl would undo PostgreSQL's locale settings.  The known-affected
      configurations are 32-bit, release builds using Visual Studio 2012 or
      Visual Studio 2013.  Visual Studio 2010 is unaffected, as were all
      buildfarm-attested configurations.  In principle, this bug could leave
      the wrong LC_CTYPE in effect after PL/Perl use, which could in turn
      facilitate problems like corrupt tsvector datums.  No known platform
      experiences that consequence, because PL/Perl on Windows does not use
      this environment variable.
      
      The bug has been user-visible, as early postmaster failure, on systems
      with Windows ANSI code page set to CP936 for "Chinese (Simplified, PRC)"
      and probably on systems using other multibyte code pages.
      (SetEnvironmentVariable() rejects values containing character data not
      valid under the Windows ANSI code page.)  Back-patch to 9.4, where the
      faulty commit first appeared.
      
      Reported by Didi Hu and 林鹏程.  Reviewed by Tom Lane, though this fix
      strategy was not his first choice.
      f0a264a3
    • Noah Misch's avatar
      Revert "Detect setlocale(LC_CTYPE, NULL) clobbering previous return values." · 1f2a378d
      Noah Misch authored
      This reverts commit b76e76be.  The
      buildfarm yielded no related failures.
      1f2a378d
    • Alvaro Herrera's avatar
      Fix BRIN supported operators table · 1443a165
      Alvaro Herrera authored
      Some of the entries in the inclusion opclasses where missing operators,
      and we had an entry for inet_inclusion_ops instead of
      network_inclusion_ops.  Sort the operators within each opclass by
      strategy number, just to make it easier to spot mistakes.
      
      Also sort the rows by data type name, rather than OID.
      1443a165
    • Alvaro Herrera's avatar
      3c400a3f
  7. 19 Jun, 2015 6 commits
    • Tom Lane's avatar
      In immediate shutdown, postmaster should not exit till children are gone. · 48913db8
      Tom Lane authored
      This adjusts commit 82233ce7 so that the
      postmaster does not exit until all its child processes have exited, even
      if the 5-second timeout elapses and we have to send SIGKILL.  There is no
      great value in having the postmaster process quit sooner, and doing so can
      mislead onlookers into thinking that the cluster is fully terminated when
      actually some child processes still survive.
      
      This effect might explain recent test failures on buildfarm member hamster,
      wherein we failed to restart a cluster just after shutting it down with
      "pg_ctl stop -m immediate".
      
      I also did a bit of code review/beautification, including fixing a faulty
      use of the Max() macro on a volatile expression.
      
      Back-patch to 9.4.  In older branches, the postmaster never waited for
      children to exit during immediate shutdowns, and changing that would be
      too much of a behavioral change.
      48913db8
    • Alvaro Herrera's avatar
      Clamp autovacuum launcher sleep time to 5 minutes · da1a9d0f
      Alvaro Herrera authored
      This avoids the problem that it might go to sleep for an unreasonable
      amount of time in unusual conditions like the server clock moving
      backwards an unreasonable amount of time.
      
      (Simply moving the server clock forward again doesn't solve the problem
      unless you wake up the autovacuum launcher manually, say by sending it
      SIGHUP).
      
      Per trouble report from Prakash Itnal in
      https://www.postgresql.org/message-id/CAHC5u79-UqbapAABH2t4Rh2eYdyge0Zid-X=Xz-ZWZCBK42S0Q@mail.gmail.com
      
      Analyzed independently by Haribabu Kommi and Tom Lane.
      da1a9d0f
    • Tom Lane's avatar
      Fix bogus range_table_mutator() logic for RangeTblEntry.tablesample. · be87143f
      Tom Lane authored
      Must make a copy of the TableSampleClause node; the previous coding
      modified the input data structure in-place.
      
      Petr Jelinek
      be87143f
    • Robert Haas's avatar
      Fix corner case in autovacuum-forcing logic for multixact wraparound. · ed16f73c
      Robert Haas authored
      Since find_multixact_start() relies on SimpleLruDoesPhysicalPageExist(),
      and that function looks only at the on-disk state, it's possible for it
      to fail to find a page that exists in the in-memory SLRU that has not
      been written yet.  If that happens, SetOffsetVacuumLimit() will
      erroneously decide to force emergency autovacuuming immediately.
      
      We should probably fix find_multixact_start() to consider the data
      cached in memory as well as on the on-disk state, but that's no excuse
      for SetOffsetVacuumLimit() to be stupid about the case where it can
      no longer read the value after having previously succeeded in doing so.
      
      Report by Andres Freund.
      ed16f73c
    • Robert Haas's avatar
      Add PASSWORD to tab completions for CREATE/ALTER ROLE/USER/GROUP. · 86e47517
      Robert Haas authored
      Jeevan Chalke
      86e47517
    • Robert Haas's avatar
      Change TAP test framework to not rely on having a chmod executable. · ca3f43aa
      Robert Haas authored
      This might not work at all on Windows, and is not ever efficient.
      
      Michael Paquier
      ca3f43aa
  8. 17 Jun, 2015 1 commit
  9. 16 Jun, 2015 1 commit
  10. 15 Jun, 2015 2 commits
  11. 14 Jun, 2015 7 commits
  12. 13 Jun, 2015 6 commits