1. 02 Feb, 2014 5 commits
  2. 01 Feb, 2014 13 commits
    • Tom Lane's avatar
      Fix some wide-character bugs in the text-search parser. · 082c0dfa
      Tom Lane authored
      In p_isdigit and other character class test functions generated by the
      p_iswhat macro, the code path for non-C locales with multibyte encodings
      contained a bogus pointer cast that would accidentally fail to malfunction
      if types wchar_t and wint_t have the same width.  Apparently that is true
      on most platforms, but not on recent Cygwin releases.  Remove the cast,
      as it seems completely unnecessary (I think it arose from a false analogy
      to the need to cast to unsigned char when dealing with the <ctype.h>
      functions).  Per bug #8970 from Marco Atzeri.
      
      In the same functions, the code path for C locale with a multibyte encoding
      simply ANDed each wide character with 0xFF before passing it to the
      corresponding <ctype.h> function.  This could result in false positive
      answers for some non-ASCII characters, so use a range test instead.
      Noted by me while investigating Marco's complaint.
      
      Also, remove some useless though not actually buggy maskings and casts
      in the hand-coded p_isalnum and p_isalpha functions, which evidently
      got tested a bit more carefully than the macro-generated functions.
      082c0dfa
    • Andrew Dunstan's avatar
      fix whitespace · c8158a2e
      Andrew Dunstan authored
      c8158a2e
    • Tom Lane's avatar
      Fix some more bugs in signal handlers and process shutdown logic. · 214c7a4f
      Tom Lane authored
      WalSndKill was doing things exactly backwards: it should first clear
      MyWalSnd (to stop signal handlers from touching MyWalSnd->latch),
      then disown the latch, and only then mark the WalSnd struct unused by
      clearing its pid field.
      
      Also, WalRcvSigUsr1Handler and worker_spi_sighup failed to preserve
      errno, which is surely a requirement for any signal handler.
      
      Per discussion of recent buildfarm failures.  Back-patch as far
      as the relevant code exists.
      214c7a4f
    • Andrew Dunstan's avatar
      Don't use deprecated dllwrap on Cygwin. · 7e1531a4
      Andrew Dunstan authored
      The preferred method is to use "cc -shared", and this allows binaries
      to be rebased if required, unlike dllwrap.
      
      Backpatch to 9.0 where we have buildfarm coverage.
      
      There are still some issues with Cygwin, especially modern Cygwin, but
      this helps us get closer to good support.
      
      Marco Atzeri.
      7e1531a4
    • Andrew Dunstan's avatar
      Copy the libpq DLL to the bin directory on Mingw and Cygwin. · d587298b
      Andrew Dunstan authored
      This has long been done by the MSVC build system, and has caused
      confusion in the past when programs like psql have failed to start
      because they can't find the DLL. If it's in the same directory as it now
      will be they will find it.
      
      Backpatch to all live branches.
      d587298b
    • Bruce Momjian's avatar
      arrays: tighten checks for multi-dimensional input · d0ee9379
      Bruce Momjian authored
      Previously an input array string that started with a single-element
      array dimension would then later accept a multi-dimensional segment.
      
      BACKWARD INCOMPATIBILITY
      d0ee9379
    • Robert Haas's avatar
      Introduce replication slots. · 858ec118
      Robert Haas authored
      Replication slots are a crash-safe data structure which can be created
      on either a master or a standby to prevent premature removal of
      write-ahead log segments needed by a standby, as well as (with
      hot_standby_feedback=on) pruning of tuples whose removal would cause
      replication conflicts.  Slots have some advantages over existing
      techniques, as explained in the documentation.
      
      In a few places, we refer to the type of replication slots introduced
      by this patch as "physical" slots, because forthcoming patches for
      logical decoding will also have slots, but with somewhat different
      properties.
      
      Andres Freund and Robert Haas
      858ec118
    • Bruce Momjian's avatar
      docs: mention 'g' is not in the regex embedded options table · 5bdef38b
      Bruce Momjian authored
      Mentioned in substring() and regexp_replace() sections.
      5bdef38b
    • Bruce Momjian's avatar
      pg_restore: make help output plural for multi-enabled options · 5168c769
      Bruce Momjian authored
      per report from Josh Kupershmidt
      5168c769
    • Robert Haas's avatar
      Clear MyProc and MyProcSignalState before they become invalid. · d1981719
      Robert Haas authored
      Evidence from buildfarm member crake suggests that the new test_shm_mq
      module is routinely crashing the server due to the arrival of a SIGUSR1
      after the shared memory segment has been unmapped.  Although processes
      using the new dynamic background worker facilities are more likely to
      receive a SIGUSR1 around this time, the problem is also possible on older
      branches, so I'm back-patching the parts of this change that apply to
      older branches as far as they apply.
      
      It's already generally the case that code checks whether these pointers
      are NULL before deferencing them, so the important thing is mostly to
      make sure that they do get set to NULL before they become invalid.  But
      in master, there's one case in procsignal_sigusr1_handler that lacks a
      NULL guard, so add that.
      
      Patch by me; review by Tom Lane.
      d1981719
    • Bruce Momjian's avatar
      doc: mention statistics reset during crash recovery · 637fab6e
      Bruce Momjian authored
      Takayuki Tsunakawa
      637fab6e
    • Bruce Momjian's avatar
      chkpass: check for NULL return value from crypt() · 6afe200c
      Bruce Momjian authored
      Report from Jozef Mlich using Coverity
      6afe200c
    • Bruce Momjian's avatar
      doc: mention data page checksums in WAL section · 85317e88
      Bruce Momjian authored
      Backpatch to 9.3
      
      Adjusted patch from Ian Lawrence Barwick
      85317e88
  3. 31 Jan, 2014 14 commits
  4. 30 Jan, 2014 8 commits
    • Tom Lane's avatar
      Fix potential coredump on bad locale value in pg_upgrade. · 41e364ec
      Tom Lane authored
      Thinko in error report (and a typo in the message text, too).  We're
      failing anyway, but it would be good to print something useful first.
      Noted while reviewing a patch to make pg_upgrade's locale code laxer.
      41e364ec
    • Robert Haas's avatar
      Add convenience functions pg_sleep_for and pg_sleep_until. · 760c770f
      Robert Haas authored
      Vik Fearing, reviewed by Pavel Stehule and myself
      760c770f
    • Tom Lane's avatar
      Fix bogus handling of "postponed" lateral quals. · 043f6ff0
      Tom Lane authored
      When pulling a "postponed" qual from a LATERAL subquery up into the quals
      of an outer join, we must make sure that the postponed qual is included
      in those seen by make_outerjoininfo().  Otherwise we might compute a
      too-small min_lefthand or min_righthand for the outer join, leading to
      "JOIN qualification cannot refer to other relations" failures from
      distribute_qual_to_rels.  Subtler errors in the created plan seem possible,
      too, if the extra qual would only affect join ordering constraints.
      
      Per bug #9041 from David Leverton.  Back-patch to 9.3.
      043f6ff0
    • Bruce Momjian's avatar
    • Bruce Momjian's avatar
    • Bruce Momjian's avatar
      docs: add mention of index swapping · b1cbd2b5
      Bruce Momjian authored
      Backpatch to 9.3
      
      Greg Smith
      b1cbd2b5
    • Bruce Momjian's avatar
      Add checks for interval overflow/underflow · 146604ec
      Bruce Momjian authored
      New checks include input, month/day/time internal adjustments, addition,
      subtraction, multiplication, and negation.  Also adjust docs to
      correctly specify interval size in bytes.
      
      Report from Rok Kralj
      146604ec
    • Tom Lane's avatar
      Fix unsafe references to errno within error messaging logic. · 571addd7
      Tom Lane authored
      Various places were supposing that errno could be expected to hold still
      within an ereport() nest or similar contexts.  This isn't true necessarily,
      though in some cases it accidentally failed to fail depending on how the
      compiler chanced to order the subexpressions.  This class of thinko
      explains recent reports of odd failures on clang-built versions, typically
      missing or inappropriate HINT fields in messages.
      
      Problem identified by Christian Kruse, who also submitted the patch this
      commit is based on.  (I fixed a few issues in his patch and found a couple
      of additional places with the same disease.)
      
      Back-patch as appropriate to all supported branches.
      571addd7