1. 26 Oct, 2016 4 commits
    • Heikki Linnakangas's avatar
      Fix typos in comments. · 56f39009
      Heikki Linnakangas authored
      Vinayak Pokale
      56f39009
    • Heikki Linnakangas's avatar
      Fix typo in comment. · 8a2f08fb
      Heikki Linnakangas authored
      Daniel Gustafsson
      8a2f08fb
    • Heikki Linnakangas's avatar
      Give a hint, when [] is incorrectly used for a composite type in array. · 510e1b8e
      Heikki Linnakangas authored
      That used to be accepted, so let's try to give a hint to users on why
      their PL/python functions no longer work.
      
      Reviewed by Pavel Stehule.
      
      Discussion: <CAH38_tmbqwaUyKs9yagyRra=SMaT45FPBxk1pmTYcM0TyXGG7Q@mail.gmail.com>
      510e1b8e
    • Heikki Linnakangas's avatar
      Support multi-dimensional arrays in PL/python. · 94aceed3
      Heikki Linnakangas authored
      Multi-dimensional arrays can now be used as arguments to a PL/python function
      (used to throw an error), and they can be returned as nested Python lists.
      
      This makes a backwards-incompatible change to the handling of composite
      types in arrays. Previously, you could return an array of composite types
      as "[[col1, col2], [col1, col2]]", but now that is interpreted as a two-
      dimensional array. Composite types in arrays must now be returned as
      Python tuples, not lists, to resolve the ambiguity. I.e. "[(col1, col2),
      (col1, col2)]".
      
      To avoid breaking backwards-compatibility, when not necessary, () is still
      accepted for arrays at the top-level, but it is always treated as a
      single-dimensional array. Likewise, [] is still accepted for composite types,
      when they are not in an array. Update the documentation to recommend using []
      for arrays, and () for composite types, with a mention that those other things
      are also accepted in some contexts.
      
      This needs to be mentioned in the release notes.
      
      Alexey Grishchenko, Dave Cramer and me. Reviewed by Pavel Stehule.
      
      Discussion: <CAH38_tmbqwaUyKs9yagyRra=SMaT45FPBxk1pmTYcM0TyXGG7Q@mail.gmail.com>
      94aceed3
  2. 25 Oct, 2016 5 commits
  3. 24 Oct, 2016 4 commits
  4. 23 Oct, 2016 8 commits
    • Tom Lane's avatar
      Avoid testing tuple visibility without buffer lock. · 8f1fb7d6
      Tom Lane authored
      INSERT ... ON CONFLICT (specifically ExecCheckHeapTupleVisible) contains
      another example of this unsafe coding practice.  It is much harder to get
      a failure out of it than the case fixed in commit 6292c233, because in
      most scenarios any hint bits that could be set would have already been set
      earlier in the command.  However, Konstantin Knizhnik reported a failure
      with a custom transaction manager, and it's clearly possible to get a
      failure via a race condition in async-commit mode.
      
      For lack of a reproducible example, no regression test case in this
      commit.
      
      I did some testing with Asserts added to tqual.c's functions, and can say
      that running "make check-world" exposed these two bugs and no others.
      The Asserts are messy enough that I've not added them to the code for now.
      
      Report: <57EE93C8.8080504@postgrespro.ru>
      Related-Discussion: <CAO3NbwOycQjt2Oqy2VW-eLTq2M5uGMyHnGm=RNga4mjqcYD7gQ@mail.gmail.com>
      8f1fb7d6
    • Tom Lane's avatar
      Don't throw serialization errors for self-conflicts in INSERT ON CONFLICT. · a6c0a5b6
      Tom Lane authored
      A transaction that conflicts against itself, for example
      	INSERT INTO t(pk) VALUES (1),(1) ON CONFLICT DO NOTHING;
      should behave the same regardless of isolation level.  It certainly
      shouldn't throw a serialization error, as retrying will not help.
      We got this wrong due to the ON CONFLICT logic not considering the case,
      as reported by Jason Dusek.
      
      Core of this patch is by Peter Geoghegan (based on an earlier patch by
      Thomas Munro), though I didn't take his proposed code refactoring for fear
      that it might have unexpected side-effects.  Test cases by Thomas Munro
      and myself.
      
      Report: <CAO3NbwOycQjt2Oqy2VW-eLTq2M5uGMyHnGm=RNga4mjqcYD7gQ@mail.gmail.com>
      Related-Discussion: <57EE93C8.8080504@postgrespro.ru>
      a6c0a5b6
    • Tom Lane's avatar
      Avoid testing tuple visibility without buffer lock in RI_FKey_check(). · 6292c233
      Tom Lane authored
      Despite the argumentation I wrote in commit 7a2fe85b, it's unsafe to do
      this, because in corner cases it's possible for HeapTupleSatisfiesSelf
      to try to set hint bits on the target tuple; and at least since 8.2 we
      have required the buffer content lock to be held while setting hint bits.
      
      The added regression test exercises one such corner case.  Unpatched, it
      causes an assertion failure in assert-enabled builds, or otherwise would
      cause a hint bit change in a buffer we don't hold lock on, which given
      the right race condition could result in checksum failures or other data
      consistency problems.  The odds of a problem in the field are probably
      pretty small, but nonetheless back-patch to all supported branches.
      
      Report: <19391.1477244876@sss.pgh.pa.us>
      6292c233
    • Magnus Hagander's avatar
      Rename walmethod fsync method to sync · eade082b
      Magnus Hagander authored
      Using the name fsync clashed with the #define we have on Windows that
      redefines it to _commit. Naming it sync should remove that conflict.
      
      Per all the Windows buildfarm members
      eade082b
    • Magnus Hagander's avatar
      a5c17c1d
    • Magnus Hagander's avatar
      Fix walmethods.c build without libz · 9ae6713c
      Magnus Hagander authored
      Per numerous buildfarm manuals
      9ae6713c
    • Magnus Hagander's avatar
      Remove extra comma at end of enum list · d97a59a4
      Magnus Hagander authored
      C99-specific feature, and wasn't intentional in the first place.
      
      Per buildfarm member mylodon
      d97a59a4
    • Magnus Hagander's avatar
      Allow pg_basebackup to stream transaction log in tar mode · 56c7d8d4
      Magnus Hagander authored
      This will write the received transaction log into a file called
      pg_wal.tar(.gz) next to the other tarfiles instead of writing it to
      base.tar. When using fetch mode, the transaction log is still written to
      base.tar like before, and when used against a pre-10 server, the file
      is named pg_xlog.tar.
      
      To do this, implement a new concept of a "walmethod", which is
      responsible for writing the WAL. Two implementations exist, one that
      writes to a plain directory (which is also used by pg_receivexlog) and
      one that writes to a tar file with optional compression.
      
      Reviewed by Michael Paquier
      56c7d8d4
  5. 22 Oct, 2016 1 commit
    • Tom Lane's avatar
      Improve documentation about use of Linux huge pages. · 1885c884
      Tom Lane authored
      Show how to get the system's huge page size, rather than misleadingly
      referring to PAGE_SIZE (which is usually understood to be the regular
      page size).  Show how to confirm whether huge pages have been allocated.
      Minor wordsmithing.  Back-patch to 9.4 where this section appeared.
      1885c884
  6. 21 Oct, 2016 5 commits
    • Tom Lane's avatar
      First-draft release notes for 9.6.1. · eacaf6e2
      Tom Lane authored
      As usual, the release notes for other branches will be made by cutting
      these down, but put them up for community review first.
      eacaf6e2
    • Robert Haas's avatar
      Fix comment formatting. · 919c811c
      Robert Haas authored
      919c811c
    • Robert Haas's avatar
      postgres_fdw: Attempt to stabilize regression results. · ad13a09d
      Robert Haas authored
      Set enable_hashagg to false for tests involving least_agg(), so that
      we get the same plan regardless of local costing variances.  Also,
      remove a test involving sqrt(); it's there to test deparsing of
      HAVING clauses containing expressions, but that's tested elsewhere
      anyway, and sqrt(2) deparses with different amounts of precision on
      different machines.
      
      Per buildfarm.
      ad13a09d
    • Tom Lane's avatar
      Doc: wording tweak for PERL, PYTHON, TCLSH configuration variables. · 7aa2c10a
      Tom Lane authored
      Replace "Full path to ..." with "Full path name of ...".  At least one
      user has misinterpreted the existing wording as meaning "Directory
      containing ...".
      7aa2c10a
    • Robert Haas's avatar
      postgres_fdw: Push down aggregates to remote servers. · 7012b132
      Robert Haas authored
      Now that the upper planner uses paths, and now that we have proper hooks
      to inject paths into the upper planning process, it's possible for
      foreign data wrappers to arrange to push aggregates to the remote side
      instead of fetching all of the rows and aggregating them locally.  This
      figures to be a massive win for performance, so teach postgres_fdw to
      do it.
      
      Jeevan Chalke and Ashutosh Bapat.  Reviewed by Ashutosh Bapat with
      additional testing by Prabhat Sahu.  Various mostly cosmetic changes
      by me.
      7012b132
  7. 20 Oct, 2016 6 commits
    • Tom Lane's avatar
      Fix EXPLAIN so that it doesn't emit invalid XML in corner cases. · 709e461b
      Tom Lane authored
      With track_io_timing = on, EXPLAIN (ANALYZE, BUFFERS) will emit fields
      named like "I/O Read Time".  The slash makes that invalid as an XML
      element name, so that adding FORMAT XML would produce invalid XML.
      
      We already have code in there to translate spaces to dashes, so let's
      generalize that to convert anything that isn't a valid XML name character,
      viz letters, digits, hyphens, underscores, and periods.  We could just
      reject slashes, which would run a bit faster.  But the fact that this went
      unnoticed for so long doesn't give me a warm feeling that we'd notice the
      next creative violation, so let's make it a permanent fix.
      
      Reported by Markus Winand, though this isn't his initial patch proposal.
      
      Back-patch to 9.2 where track_io_timing was added.  The problem is only
      latent in 9.1, so I don't feel a need to fix it there.
      
      Discussion: <E0BF6A45-68E8-45E6-918F-741FB332C6BB@winand.at>
      709e461b
    • Tom Lane's avatar
      Sync our copy of the timezone library with IANA release tzcode2016h. · 5e21b681
      Tom Lane authored
      This absorbs a fix for a symlink-manipulation bug in zic that was
      introduced in 2016g.  It probably isn't interesting for our use-case,
      but I'm not quite sure, so let's update while we're at it.
      5e21b681
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016h. · d8fc45bd
      Tom Lane authored
      (Didn't I just do this?  Oh well.)
      
      DST law changes in Palestine.  Historical corrections for Turkey.
      Switch to numeric abbreviations for Asia/Colombo.
      d8fc45bd
    • Robert Haas's avatar
      Rename "pg_xlog" directory to "pg_wal". · f82ec32a
      Robert Haas authored
      "xlog" is not a particularly clear abbreviation for "write-ahead log",
      and it sometimes confuses users into believe that the contents of the
      "pg_xlog" directory are not critical data, leading to unpleasant
      consequences.  So, rename the directory to "pg_wal".
      
      This patch modifies pg_upgrade and pg_basebackup to understand both
      the old and new directory layouts; the former is necessary given the
      purpose of the tool, while the latter merely avoids an unnecessary
      backward-compatibility break.
      
      We may wish to consider renaming other programs, switches, and
      functions which still use the old "xlog" naming to also refer to
      "wal".  However, that's still under discussion, so let's do just this
      much for now.
      
      Discussion: CAB7nPqTeC-8+zux8_-4ZD46V7YPwooeFxgndfsq5Rg8ibLVm1A@mail.gmail.com
      
      Michael Paquier
      f82ec32a
    • Robert Haas's avatar
      Remove a comment which is now incorrect. · ec7db2b4
      Robert Haas authored
      Before 5d305d86, this comment was
      correct, but now it says we do something which we don't actually do.
      Accordingly, remove the comment.
      ec7db2b4
    • Tom Lane's avatar
      Another portability fix for tzcode2016g update. · 23ed2ba8
      Tom Lane authored
      clang points out that SIZE_MAX wouldn't fit into an int, which means
      this comparison is pretty useless.  Per report from Thomas Munro.
      23ed2ba8
  8. 19 Oct, 2016 7 commits
    • Tom Lane's avatar
      Windows portability fix. · ad90ac4d
      Tom Lane authored
      Per buildfarm.
      ad90ac4d
    • Tom Lane's avatar
      Sync our copy of the timezone library with IANA release tzcode2016g. · f3094920
      Tom Lane authored
      This is mostly to absorb some corner-case fixes in zic for year-2037
      timestamps.  The other changes that have been made are unlikely to affect
      our usage, but nonetheless we may as well take 'em.
      f3094920
    • Tom Lane's avatar
      Suppress "Factory" zone in pg_timezone_names view for tzdata >= 2016g. · a3215431
      Tom Lane authored
      IANA got rid of the really silly "abbreviation" and replaced it with one
      that's only moderately silly.  But it's still pointless, so keep on not
      showing it.
      a3215431
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016g. · ecbac3e6
      Tom Lane authored
      DST law changes in Turkey.  Historical corrections for America/Los_Angeles,
      Europe/Kirov, Europe/Moscow, Europe/Samara, and Europe/Ulyanovsk.
      Rename Asia/Rangoon to Asia/Yangon, with a backward compatibility link.
      
      The IANA crew continue their campaign to replace invented time zone
      abbrevations with numeric GMT offsets.  This update changes numerous zones
      in Antarctica and the former Soviet Union, for instance Antarctica/Casey
      now reports "+08" not "AWST" in the pg_timezone_names view.  I kept these
      abbreviations in the tznames/ data files, however, so that we will still
      accept them for input.  (We may want to start trimming those files someday,
      but today is not that day.)
      
      An exception is that since IANA no longer claims that "AMT" is in use
      in Armenia for GMT+4, I replaced it in the Default file with GMT-4,
      corresponding to Amazon Time which is in use in South America.  It may be
      that that meaning is also invented and IANA will drop it in a future
      update; but for now, it seems silly to give pride of place to a meaning
      not traceable to IANA over one that is.
      ecbac3e6
    • Peter Eisentraut's avatar
    • Peter Eisentraut's avatar
      Use pg_ctl promote -w in TAP tests · e5a9bcb5
      Peter Eisentraut authored
      Switch TAP tests to use the new wait mode of pg_ctl promote.  This
      allows avoiding extra logic with poll_query_until() to be sure that a
      promoted standby is ready for read-write queries.
      
      From: Michael Paquier <michael.paquier@gmail.com>
      e5a9bcb5
    • Peter Eisentraut's avatar
      initdb pg_basebackup: Rename --noxxx options to --no-xxx · 5d58c07a
      Peter Eisentraut authored
      --noclean and --nosync were the only options spelled without a hyphen,
      so change this for consistency with other options.  The options in
      pg_basebackup have not been in a release, so we just rename them.  For
      initdb, we retain the old variants.
      
      Vik Fearing and me
      5d58c07a