1. 11 Jun, 2018 8 commits
    • Alvaro Herrera's avatar
      Don't needlessly check the partition contraint twice · 5b0c7e2f
      Alvaro Herrera authored
      Starting with commit f0e44751, ExecConstraints was in charge of
      running the partition constraint; commit 19c47e7c modified that so
      that caller could request to skip that checking depending on some
      conditions, but that commit and 15ce775f together introduced a small
      bug there which caused ExecInsert to request skipping the constraint
      check but have this not be honored -- in effect doing the check twice.
      This could have been fixed in a very small patch, but on further
      analysis of the involved function and its callsites, it turns out to be
      simpler to give the responsibility of checking the partition constraint
      fully to the caller, and return ExecConstraints to its original
      (pre-partitioning) shape where it only checked tuple descriptor-related
      constraints.  Each caller must do partition constraint checking on its
      own schedule, which is more convenient after commit 2f178441 anyway.
      
      Reported-by: David Rowley
      Author: David Rowley, Álvaro Herrera
      Reviewed-by: Amit Langote, Amit Khandekar, Simon Riggs
      Discussion: https://postgr.es/m/CAKJS1f8w8+awsxgea8wt7_UX8qzOQ=Tm1LD+U1fHqBAkXxkW2w@mail.gmail.com
      5b0c7e2f
    • Andrew Dunstan's avatar
      85dd744a
    • Andrew Dunstan's avatar
      Add a script to detect perl compile time errors and warnings · af616ce4
      Andrew Dunstan authored
      Also add a function that centralizes the logic for locating all our perl
      files and use it in pgperlcritic and pgperltidy as well as the new
      pgperlcheck.
      af616ce4
    • Tom Lane's avatar
      Fix run-time partition pruning code to handle NULL values properly. · be3d9002
      Tom Lane authored
      The previous coding just ignored pruning constraints that compare a
      partition key to a null-valued expression.  This is silly, since really
      what we can do there is conclude that all partitions are rejected: the
      pruning operator is known strict so the comparison must always fail.
      
      This also fixes the logic to not ignore constisnull for a Const comparison
      value.  That's probably an unreachable case, since the planner would
      normally have simplified away a strict operator with a constant-null input.
      But this code has no business assuming that.
      
      David Rowley, per a gripe from me
      
      Discussion: https://postgr.es/m/26279.1528670981@sss.pgh.pa.us
      be3d9002
    • Peter Eisentraut's avatar
    • Peter Eisentraut's avatar
      Update config.guess and config.sub · bfbb1326
      Peter Eisentraut authored
      bfbb1326
    • Michael Paquier's avatar
      Fix grammar in documentation related to checkpoint_flush_after · d61bfdda
      Michael Paquier authored
      Reported-by: Christopher Jones
      d61bfdda
    • Michael Paquier's avatar
      Fix a couple of bugs with replication slot advancing feature · f731cfa9
      Michael Paquier authored
      A review of the code has showed up a couple of issues fixed by this
      commit:
      - Physical slots have been using the confirmed LSN position as a start
      comparison point which is always 0/0, instead use the restart LSN
      position (logical slots need to use the confirmed LSN position, which
      was correct).
      - The actual slot update was incorrect for both physical and logical
      slots.  Physical slots need to use their restart_lsn as base comparison
      point (confirmed_flush was used because of previous point), and logical
      slots need to begin reading WAL from restart_lsn (confirmed_flush was
      used as well), while confirmed_flush is compiled depending on the
      decoding context and record read, and is the LSN position returned back
      to the caller.
      - Never return 0/0 if a slot cannot be advanced.  This way, if a slot is
      advanced while the activity is idle, then the same position is returned
      to the caller over and over without raising an error.  Instead return
      the LSN the slot has been advanced to.  With repetitive calls, the same
      position is returned hence caller can directly monitor the difference in
      progress in bytes by doing simply LSN difference calculations, which
      should be monotonic.
      
      Note that as the slot is owned by the backend advancing it, then the
      read of those fields is fine lock-less, while updates need to happen
      while the slot mutex is held, so fix that on the way as well.  Other
      locks for in-memory data of replication slots have been already fixed
      previously.
      
      Some of those issues have been pointed out by Petr and Simon during the
      patch, while I noticed some of them after looking at the code.  This
      also visibly takes of a recently-discovered bug causing assertion
      failures which can be triggered by a two-step slot forwarding which
      first advanced the slot to a WAL page boundary and secondly advanced it
      to the latest position, say 'FF/FFFFFFF' to make sure that the newest
      LSN is used as forward point.  It would have been nice to drop a test
      for that, but the set of operators working on pg_lsn limits it, so this
      is left for a future exercise.
      
      Author: Michael Paquier
      Reviewed-by: Petr Jelinek, Simon Riggs
      Discussion: https://postgr.es/m/CANP8+jLyS=X-CAk59BJnsxKQfjwrmKicHQykyn52Qj-Q=9GLCw@mail.gmail.com
      Discussion: https://www.postgresql.org/message-id/2840048a-1184-417a-9da8-3299d207a1d7%40postgrespro.ru
      f731cfa9
  2. 10 Jun, 2018 6 commits
  3. 09 Jun, 2018 1 commit
  4. 08 Jun, 2018 5 commits
  5. 07 Jun, 2018 3 commits
  6. 06 Jun, 2018 1 commit
    • Alvaro Herrera's avatar
      Fix function code in error report · eee381ef
      Alvaro Herrera authored
      This bug causes a lseek() failure to be reported as a "could not open"
      failure in the error message, muddling bug reports.  I introduced this
      copy-and-pasteo in commit 78e12201.
      
      Noticed while reviewing code for bug report #15221, from lily liang.  In
      version 10 the affected function is only used by multixact.c and
      commit_ts, and only in corner-case circumstances, neither of which are
      involved in the reported bug (a pg_subtrans failure.)
      
      Author: Álvaro Herrera
      eee381ef
  7. 04 Jun, 2018 3 commits
  8. 01 Jun, 2018 1 commit
  9. 31 May, 2018 2 commits
    • Noah Misch's avatar
      Reconcile nodes/*funcs.c with PostgreSQL 11 work. · ef310950
      Noah Misch authored
      This covers new fields in two outfuncs.c functions having no readfuncs.c
      counterpart.  Thus, this changes only debugging output.
      ef310950
    • Andrew Dunstan's avatar
      Fix compile-time warnings on all perl code · 0039049f
      Andrew Dunstan authored
      This patch does two things. First, it silences a number of compile-time
      warnings in the msvc tools files, mainly those due to the fact that in
      some cases we have more than one package per file. Second it supplies a
      dummy Perl library with just enough of the Windows API referred to in
      our code to let it run these checks cleanly, even on Unix machines where
      the code is never supposed to run. The dummy library should only be used
      for that purpose, as its README notes.
      0039049f
  10. 30 May, 2018 2 commits
  11. 29 May, 2018 1 commit
    • Peter Eisentraut's avatar
      Initialize new jsonb iterator to zero · 3c9cf069
      Peter Eisentraut authored
      Use palloc0() instead of palloc() to create a new JsonbIterator.
      Otherwise, the isScalar field is sometimes not initialized.  There is
      probably no impact in practice, but it's cleaner this way and it avoids
      future problems.
      3c9cf069
  12. 28 May, 2018 3 commits
  13. 27 May, 2018 3 commits
  14. 26 May, 2018 1 commit