1. 22 Sep, 2017 5 commits
    • Tom Lane's avatar
      Assume wcstombs(), towlower(), and sibling functions are always present. · 85feb77a
      Tom Lane authored
      These functions are required by SUS v2, which is our minimum baseline
      for Unix platforms, and are present on all interesting Windows versions
      as well.  Even our oldest buildfarm members have them.  Thus, we were not
      testing the "!USE_WIDE_UPPER_LOWER" code paths, which explains why the bug
      fixed in commit e6023ee7 escaped detection.  Per discussion, there seems
      to be no more real-world value in maintaining this option.  Hence, remove
      the configure-time tests for wcstombs() and towlower(), remove the
      USE_WIDE_UPPER_LOWER symbol, and remove all the !USE_WIDE_UPPER_LOWER code.
      There's not actually all that much of the latter, but simplifying the #if
      nests is a win in itself.
      
      Discussion: https://postgr.es/m/20170921052928.GA188913@rfd.leadboat.com
      85feb77a
    • Peter Eisentraut's avatar
      Fix build with !USE_WIDE_UPPER_LOWER · e6023ee7
      Peter Eisentraut authored
      The placement of the ifdef blocks in formatting.c was pretty bogus, so
      the code failed to compile if USE_WIDE_UPPER_LOWER was not defined.
      Reported-by: default avatarPeter Geoghegan <pg@bowt.ie>
      Reported-by: default avatarNoah Misch <noah@leadboat.com>
      e6023ee7
    • Alvaro Herrera's avatar
      Document further existing locks as wait events · 885cab58
      Alvaro Herrera authored
      Reported-by: Jeremy Schneider
      Author: Michael Paquier
      Discussion: https://postgr.es/m/CA+fnDAZaPCwfY8Lp-pfLnUGFAXRu1VfLyRgdup-L-kwcBj8MqQ@mail.gmail.com
      885cab58
    • Tom Lane's avatar
      Sync our copy of the timezone library with IANA tzcode master. · 47f849a3
      Tom Lane authored
      This patch absorbs a few unreleased fixes in the IANA code.
      It corresponds to commit 2d8b944c1cec0808ac4f7a9ee1a463c28f9cd00a
      in https://github.com/eggert/tz.  Non-cosmetic changes include:
      
      TZDEFRULESTRING is updated to match current US DST practice,
      rather than what it was over ten years ago.  This only matters
      for interpretation of POSIX-style zone names (e.g., "EST5EDT"),
      and only if the timezone database doesn't include either an exact
      match for the zone name or a "posixrules" entry.  The latter
      should not be true in any current Postgres installation, but
      this could possibly matter when using --with-system-tzdata.
      
      Get rid of a nonportable use of "++var" on a bool var.
      This is part of a larger fix that eliminates some vestigial
      support for consecutive leap seconds, and adds checks to
      the "zic" compiler that the data files do not specify that.
      
      Remove a couple of ancient compatibility hacks.  The IANA
      crew think these are obsolete, and I tend to agree.  But
      perhaps our buildfarm will think different.
      
      Back-patch to all supported branches, in line with our policy
      that all branches should be using current IANA code.  Before v10,
      this includes application of current pgindent rules, to avoid
      whitespace problems in future back-patches.
      
      Discussion: https://postgr.es/m/E1dsWhf-0000pT-F9@gemulon.postgresql.org
      47f849a3
    • Tom Lane's avatar
      Revert "Fix bool/int type confusion" · a890432a
      Tom Lane authored
      This reverts commit 0ec2e908.
      We'll use the upstream (IANA) fix instead.
      a890432a
  2. 21 Sep, 2017 4 commits
  3. 20 Sep, 2017 13 commits
  4. 19 Sep, 2017 14 commits
  5. 18 Sep, 2017 4 commits
    • Tom Lane's avatar
      Minor code-cleanliness improvements for btree. · eb5c404b
      Tom Lane authored
      Make the btree page-flags test macros (P_ISLEAF and friends) return clean
      boolean values, rather than values that might not fit in a bool.  Use them
      in a few places that were randomly referencing the flag bits directly.
      
      In passing, change access/nbtree/'s only direct use of BUFFER_LOCK_SHARE to
      BT_READ.  (Some think we should go the other way, but as long as we have
      BT_READ/BT_WRITE, let's use them consistently.)
      
      Masahiko Sawada, reviewed by Doug Doole
      
      Discussion: https://postgr.es/m/CAD21AoBmWPeN=WBB5Jvyz_Nt3rmW1ebUyAnk3ZbJP3RMXALJog@mail.gmail.com
      eb5c404b
    • Tom Lane's avatar
      Make ExplainOpenGroup and ExplainCloseGroup public. · 66917bfa
      Tom Lane authored
      Extensions with custom plan nodes might like to use these in their
      EXPLAIN output.
      
      Hadi Moshayedi
      
      Discussion: https://postgr.es/m/CA+_kT_dU-rHCN0u6pjA6bN5CZniMfD=-wVqPY4QLrKUY_uJq5w@mail.gmail.com
      66917bfa
    • Tom Lane's avatar
      Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent. · 4bd19946
      Tom Lane authored
      By project convention, these names should include "P" when dealing with a
      pointer type; that is, if the result of a GETARG macro is of type FOO *,
      it should be called PG_GETARG_FOO_P not just PG_GETARG_FOO.  Some newer
      types such as JSONB and ranges had not followed the convention, and a
      number of contrib modules hadn't gotten that memo either.  Rename the
      offending macros to improve consistency.
      
      In passing, fix a few places that thought PG_DETOAST_DATUM() returns
      a Datum; it does not, it returns "struct varlena *".  Applying
      DatumGetPointer to that happens not to cause any bad effects today,
      but it's formally wrong.  Also, adjust an ltree macro that was designed
      without any thought for what pgindent would do with it.
      
      This is all cosmetic and shouldn't have any impact on generated code.
      
      Mark Dilger, some further tweaks by me
      
      Discussion: https://postgr.es/m/EA5676F4-766F-4F38-8348-ECC7DB427C6A@gmail.com
      4bd19946
    • Tom Lane's avatar
      Fix, or at least ameliorate, bugs in logicalrep_worker_launch(). · 3e1683d3
      Tom Lane authored
      If we failed to get a background worker slot, the code just walked
      away from the logicalrep-worker slot it already had, leaving that
      looking like the worker is still starting up.  This led to an indefinite
      hang in subscription startup, as reported by Thomas Munro.  We must
      release the slot on failure.
      
      Also fix a thinko: we must capture the worker slot's generation before
      releasing LogicalRepWorkerLock the first time, else testing to see if
      it's changed is pretty meaningless.
      
      BTW, the CHECK_FOR_INTERRUPTS() in WaitForReplicationWorkerAttach is a
      ticking time bomb, even without considering the possibility of elog(ERROR)
      in one of the other functions it calls.  Really, this entire business needs
      a redesign with some actual thought about error recovery.  But for now
      I'm just band-aiding the case observed in testing.
      
      Back-patch to v10 where this code was added.
      
      Discussion: https://postgr.es/m/CAEepm=2bP3TBMFBArP6o20AZaRduWjMnjCjt22hSdnA-EvrtCw@mail.gmail.com
      3e1683d3