1. 25 Sep, 2017 3 commits
    • Tom Lane's avatar
      Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. · 899bd785
      Tom Lane authored
      On Linux, shared memory segments created with shm_open() are backed by
      swap files created in tmpfs.  If the swap file needs to be extended,
      but there's no tmpfs space left, you get a very unfriendly SIGBUS trap.
      To avoid this, force allocation of the full request size when we create
      the segment.  This adds a few cycles, but none that we wouldn't expend
      later anyway, assuming the request isn't hugely bigger than the actual
      need.
      
      Make this code #ifdef __linux__, because (a) there's not currently a
      reason to think the same problem exists on other platforms, and (b)
      applying posix_fallocate() to an FD created by shm_open() isn't very
      portable anyway.
      
      Back-patch to 9.4 where the DSM code came in.
      
      Thomas Munro, per a bug report from Amul Sul
      
      Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com
      899bd785
    • Tom Lane's avatar
      Make construct_[md_]array return a valid empty array for zero-size input. · 716ea626
      Tom Lane authored
      If construct_array() or construct_md_array() were given a dimension of
      zero, they'd produce an array that contains no elements but has positive
      dimension.  This violates a general expectation that empty arrays should
      have ndims = 0; in particular, while arrays like this print as empty,
      they don't compare equal to other empty arrays.
      
      Up to now we've expected callers to avoid making such calls and instead
      be careful to call construct_empty_array() if there would be no elements.
      But this has always been an easily missed case, and we've repeatedly had to
      fix callers to do it right.  In bug #14826, Erwin Brandstetter pointed out
      yet another such oversight, in ts_lexize(); and a bit of examination of
      other call sites found at least two more with similar issues.  So let's
      fix the problem centrally and permanently by changing these two functions
      to construct a proper zero-D empty array whenever the array would be empty.
      
      This renders a few explicit calls of construct_empty_array() redundant,
      but the only such place I found that really seemed worth changing was in
      ExecEvalArrayExpr().
      
      Although this fixes some very old bugs, no back-patch: the problem is
      pretty minor and the risk of changing behavior seems to outweigh the
      benefit in stable branches.
      
      Discussion: https://postgr.es/m/20170923125723.1448.39412@wrigleys.postgresql.org
      Discussion: https://postgr.es/m/20570.1506198383@sss.pgh.pa.us
      716ea626
    • Andrew Dunstan's avatar
      Support building with Visual Studio 2017 · f2ab3898
      Andrew Dunstan authored
      Haribabu Kommi, reviewed by Takeshi Ideriha and Christian Ullrich
      
      Backpatch to 9.6
      f2ab3898
  2. 24 Sep, 2017 4 commits
    • Tom Lane's avatar
      Fix assorted infelicities in new SetWALSegSize() function. · 8485a25a
      Tom Lane authored
      * Failure to check for malloc failure (ok, pretty unlikely here, but
      that's not an excuse).
      
      * Leakage of open fd on read error, and of malloc'd buffer always.
      
      * Incorrect assumption that a short read would set errno to zero.
      
      * Failure to adhere to message style conventions (in particular,
      not reporting errno where relevant; using "couldn't open" rather than
      "could not open" is not really in line with project style either).
      
      * Missing newlines on some messages.
      
      Coverity spotted the leak problems; I noticed the rest while
      fixing the leaks.
      8485a25a
    • Peter Eisentraut's avatar
      Allow ICU to use SortSupport on Windows with UTF-8 · 6dda0998
      Peter Eisentraut authored
      There is no reason to ever prevent the use of SortSupport on Windows
      when ICU locales are used.  We previously avoided SortSupport on Windows
      with UTF-8 server encoding and a non C-locale due to restrictions in
      Windows' libc functionality.
      
      This is now considered to be a restriction in one platform's libc
      collation provider, and not a more general platform restriction.
      Reported-by: default avatarPeter Geoghegan <pg@bowt.ie>
      6dda0998
    • Peter Eisentraut's avatar
      doc: Expand user documentation on SCRAM · 9b31c72a
      Peter Eisentraut authored
      Explain more about how the different password authentication methods and
      the password_encryption settings relate to each other, give some
      upgrading advice, and set a better link from the release notes.
      Reviewed-by: default avatarJeff Janes <jeff.janes@gmail.com>
      9b31c72a
    • Peter Eisentraut's avatar
      Fix pg_basebackup test to original intent · 74ca8f9b
      Peter Eisentraut authored
      One test case was meant to check that pg_basebackup does not succeed
      when a slot is specified with -S but WAL streaming is not selected,
      which used to require specifying -X stream.  Since -X stream is the
      default in PostgreSQL 10, this test case no longer covers that meaning,
      but the pg_basebackup invocation happened to fail anyway for the
      unrelated reason that the specified replication slot does not exist.  To
      fix, move the test case to later in the file where the slot does exist,
      and add -X none to the invocation so that it covers the originally meant
      behavior.
      
      extracted from a patch by Michael Banck <michael.banck@credativ.de>
      74ca8f9b
  3. 23 Sep, 2017 7 commits
  4. 22 Sep, 2017 16 commits
  5. 21 Sep, 2017 4 commits
  6. 20 Sep, 2017 6 commits