1. 28 Oct, 2016 2 commits
  2. 27 Oct, 2016 7 commits
    • Peter Eisentraut's avatar
      Remove invitation to report a bug about unknown encoding · ce4dc970
      Peter Eisentraut authored
      The error message when we couldn't determine the encoding from a locale
      said to report a bug about that.  That might have been appropriate when
      this code was first added, but by now this works pretty solidly and any
      encodings we don't recognize we probably just don't support.  We still
      print the warning, but no longer invite the bug report.
      ce4dc970
    • Peter Eisentraut's avatar
      Add function name to PyArg_ParseTuple() · eaed88ce
      Peter Eisentraut authored
      This causes the supplied function name to appear in any error message,
      making the error message friendlier and relieving us from having to
      provide our own in some cases.
      eaed88ce
    • Peter Eisentraut's avatar
      Format PL/Python module contents test vertically · 84d457ed
      Peter Eisentraut authored
      It makes it readable again and makes merges more manageable.
      84d457ed
    • Robert Haas's avatar
      If the stats collector dies during Hot Standby, restart it. · 4f714b2f
      Robert Haas authored
      This bug exists as far back as 9.0, when Hot Standby was introduced,
      so back-patch to all supported branches.
      
      Report and patch by Takayuki Tsunakawa, reviewed by Michael Paquier
      and Kuntal Ghosh.
      4f714b2f
    • Robert Haas's avatar
      Fix possible pg_basebackup failure on standby with "include WAL". · f267c1c2
      Robert Haas authored
      If a restartpoint flushed no dirty buffers, it could fail to update
      the minimum recovery point, leading to a minimum recovery point prior
      to the starting REDO location.  perform_base_backup() would interpret
      that as meaning that no WAL files at all needed to be included in the
      backup, failing an internal sanity check.  To fix, have restartpoints
      always update the minimum recovery point to just after the checkpoint
      record itself, so that the file (or files) containing the checkpoint
      record will always be included in the backup.
      
      Code by Amit Kapila, per a design suggestion by me, with some
      additional work on the code comment by me.  Test case by Michael
      Paquier.  Report by Kyotaro Horiguchi.
      f267c1c2
    • Peter Eisentraut's avatar
      Avoid using a C++ keyword in header file · c32fe432
      Peter Eisentraut authored
      per cpluspluscheck
      c32fe432
    • Bruce Momjian's avatar
      Properly indent postgresql.conf comments to align · 586a46c2
      Bruce Momjian authored
      A few comments were misaligned.
      586a46c2
  3. 26 Oct, 2016 12 commits
    • Tom Lane's avatar
      Fix incorrect trigger-property updating in ALTER CONSTRAINT. · a522fc3d
      Tom Lane authored
      The code to change the deferrability properties of a foreign-key constraint
      updated all the associated triggers to match; but a moment's examination of
      the code that creates those triggers in the first place shows that only
      some of them should track the constraint's deferrability properties.  This
      leads to odd failures in subsequent exercise of the foreign key, as the
      triggers are fired at the wrong times.  Fix that, and add a regression test
      comparing the trigger properties produced by ALTER CONSTRAINT with those
      you get by creating the constraint as-intended to begin with.
      
      Per report from James Parks.  Back-patch to 9.4 where this ALTER
      functionality was introduced.
      
      Report: <CAJ3Xv+jzJ8iNNUcp4RKW8b6Qp1xVAxHwSXVpjBNygjKxcVuE9w@mail.gmail.com>
      a522fc3d
    • Tom Lane's avatar
      Fix not-HAVE_SYMLINK code in zic.c. · 19b2094d
      Tom Lane authored
      I broke this in commit f3094920.  Apparently it's dead code anyway,
      at least as far as our buildfarm is concerned (and the upstream IANA
      code doesn't worry at all about symlink() not being present).
      But as long as the rest of our code is willing to guard against not
      having symlink(), this should too.  Noted while investigating a
      tangentially-related complaint from Sandeep Thakkar.
      
      Back-patch to keep branches in sync.
      19b2094d
    • Tom Lane's avatar
      Doc: improve documentation about inheritance. · 162477a6
      Tom Lane authored
      Clarify documentation about inheritance of check constraints, in
      particular mentioning the NO INHERIT option, which didn't exist when
      this text was written.
      
      Document that in an inherited query, the applicable row security policies
      are those of the explicitly-named table, not its children.  This is the
      intended behavior (per off-list discussion with Stephen Frost), and there
      are regression tests for it, but it wasn't documented anywhere user-facing
      as far as I could find.
      
      Do a bit of wordsmithing on the description of inherited access-privilege
      checks.
      
      Back-patch to 9.5 where RLS was added.
      162477a6
    • Tom Lane's avatar
      Suppress unused-variable warning in non-assert builds. · 8529686c
      Tom Lane authored
      Introduced in commit 7012b132.
      
      Kyotaro Horiguchi
      8529686c
    • Heikki Linnakangas's avatar
      Remove platform-dependent PL/python test case. · 8eb6337f
      Heikki Linnakangas authored
      Turns out that the output format of Python Decimal isn't totally platform-
      independent either. There are other tests for multi-dimensional arrays,
      so rather than try to fix this test case, just remove it.
      
      Per buildfarm member prairiedog.
      8eb6337f
    • Heikki Linnakangas's avatar
      Only treat Python Lists as array dimensions. · cfd9c87a
      Heikki Linnakangas authored
      Instead of treating all python sequence types as array dimensions, except
      for tuples and various kinds of strings, only treat Python lists as
      dimensions. The PyBytes_Check() function used previously is only available
      on Python 2.6 and newer, and it was a bit fiddly anyway. The list of
      exceptions would require adjustment if Python got a new kind of a sequence
      similar to bytes/unicodes/strings, so only checking for Lists seems more
      future-proof. The documentation only mentioned using Lists, so this is
      closer to what was documented, anyway.
      
      This should fix the buildfarm failures on systems building with Python 2.5,
      although I don't have Python 2.5 installed myself to test with.
      cfd9c87a
    • Heikki Linnakangas's avatar
      Avoid using platform-dependent floats in test case. · 73c8e850
      Heikki Linnakangas authored
      The number of decimals printed for floats varied in this test case, as
      noted by several buildfarm members. There's nothing special about floats
      and arrays in the code being tested, so replace the floats with numerics to
      make the output platform-independent.
      73c8e850
    • Heikki Linnakangas's avatar
      Fix regression test to also work with Python 2. · e131ba4f
      Heikki Linnakangas authored
      Per buildfarm.
      e131ba4f
    • 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
  4. 25 Oct, 2016 5 commits
  5. 24 Oct, 2016 4 commits
  6. 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
  7. 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
  8. 21 Oct, 2016 1 commit