1. 04 1月, 2018 11 次提交
  2. 03 1月, 2018 7 次提交
    • P
      Allow ldaps when using ldap authentication · 35c0754f
      Peter Eisentraut 提交于
      While ldaptls=1 provides an RFC 4513 conforming way to do LDAP
      authentication with TLS encryption, there was an earlier de facto
      standard way to do LDAP over SSL called LDAPS.  Even though it's not
      enshrined in a standard, it's still widely used and sometimes required
      by organizations' network policies.  There seems to be no reason not to
      support it when available in the client library.  Therefore, add support
      when using OpenLDAP 2.4+ or Windows.  It can be configured with
      ldapscheme=ldaps or ldapurl=ldaps://...
      
      Add tests for both ways of requesting LDAPS and a test for the
      pre-existing ldaptls=1.  Modify the 001_auth.pl test for "diagnostic
      messages", which was previously relying on the server rejecting
      ldaptls=1.
      
      Author: Thomas Munro
      Reviewed-By: Peter Eisentraut
      Discussion: https://postgr.es/m/CAEepm=1s+pA-LZUjQ-9GQz0Z4rX_eK=DFXAF1nBQ+ROPimuOYQ@mail.gmail.com
      35c0754f
    • A
      Fix isolation test to be less timing-dependent · 2268e6af
      Alvaro Herrera 提交于
      I did this by adding another locking process, which makes the other two
      wait.  This way the output should be stable enough.
      
      Per buildfarm and Andres Freund
      Discussion: https://postgr.es/m/20180103034445.t3utrtrnrevfsghm@alap3.anarazel.de
      2268e6af
    • B
      Update copyright for 2018 · 9d4649ca
      Bruce Momjian 提交于
      Backpatch-through: certain files through 9.3
      9d4649ca
    • A
      Simplify representation of aggregate transition values a bit. · f9ccf92e
      Andres Freund 提交于
      Previously aggregate transition values for hash and other forms of
      aggregation (i.e. sort and no group by) were represented
      differently. Hash based aggregation used a grouping set indexed array
      pointing to an array of transition values, whereas other forms of
      aggregation used one flattened array with the index being computed out
      of grouping set and transition offsets.
      
      That made upcoming changes hard, so represent both as grouping set
      indexed array of per-group data.
      
      As a nice side-effect this also makes aggregation slightly faster,
      because computing offsets with `transno + (setno * numTrans)` turns
      out not to be that cheap (too big for x86 lea for example).
      
      Author: Andres Freund
      Discussion: https://postgr.es/m/20171128003121.nmxbm2ounxzb6n2t@alap3.anarazel.de
      f9ccf92e
    • T
      Ensure proper alignment of tuples in HashMemoryChunkData buffers. · 5dc692f7
      Tom Lane 提交于
      The previous coding relied (without any documentation) on the data[]
      member of HashMemoryChunkData being at a MAXALIGN'ed offset.  If it
      was not, the tuples would not be maxaligned either, leading to failures
      on alignment-picky machines.  While there seems to be no live bug on any
      platform we support, this is clearly pretty fragile: any addition to or
      rearrangement of the fields in HashMemoryChunkData could break it.
      Let's remove the hazard by getting rid of the data[] member and instead
      using pointer arithmetic with an explicitly maxalign'ed offset.
      
      Discussion: https://postgr.es/m/14483.1514938129@sss.pgh.pa.us
      5dc692f7
    • A
      Fix deadlock hazard in CREATE INDEX CONCURRENTLY · 54eff531
      Alvaro Herrera 提交于
      Multiple sessions doing CREATE INDEX CONCURRENTLY simultaneously are
      supposed to be able to work in parallel, as evidenced by fixes in commit
      c3d09b3b specifically to support this case.  In reality, one of the
      sessions would be aborted by a misterious "deadlock detected" error.
      
      Jeff Janes diagnosed that this is because of leftover snapshots used for
      system catalog scans -- this was broken by 8aa3e47510b9 keeping track of
      (registering) the catalog snapshot.  To fix the deadlocks, it's enough
      to de-register that snapshot prior to waiting.
      
      Backpatch to 9.4, which introduced MVCC catalog scans.
      
      Include an isolationtester spec that 8 out of 10 times reproduces the
      deadlock with the unpatched code for me (Álvaro).
      
      Author: Jeff Janes
      Diagnosed-by: Jeff Janes
      Reported-by: Jeremy Finzel
      Discussion: https://postgr.es/m/CAMa1XUhHjCv8Qkx0WOr1Mpm_R4qxN26EibwCrj0Oor2YBUFUTg%40mail.gmail.com
      54eff531
    • P
      Don't cast between GinNullCategory and bool · 43803626
      Peter Eisentraut 提交于
      The original idea was that we could use an isNull-style bool array
      directly as a GinNullCategory array.  However, the existing code already
      acknowledges that that doesn't really work, because of the possibility
      that bool as currently defined can have arbitrary bit patterns for true
      values.  So it has to loop through the nullFlags array to set each bool
      value to an acceptable value.  But if we are looping through the whole
      array anyway, we might as well build a proper GinNullCategory array
      instead and abandon the type casting.  That makes the code much safer in
      case bool is ever changed to something else.
      Reviewed-by: NMichael Paquier <michael.paquier@gmail.com>
      43803626
  3. 02 1月, 2018 1 次提交
    • A
      Fix EXPLAIN ANALYZE output for Parallel Hash. · 93ea78b1
      Andres Freund 提交于
      In a race case, EXPLAIN ANALYZE could fail to display correct nbatch
      and size information.  Refactor so that participants report only on
      batches they worked on rather than trying to report on all of them,
      and teach explain.c to consider the HashInstrumentation object from
      all participants instead of picking the first one it can find.  This
      should fix an occasional build farm failure in the "join" regression
      test.
      
      Author: Thomas Munro
      Reviewed-By: Andres Freund
      Discussion: https://postgr.es/m/30219.1514428346%40sss.pgh.pa.us
      93ea78b1
  4. 01 1月, 2018 3 次提交
    • N
      In tests, await an LSN no later than the recovery target. · 6078770c
      Noah Misch 提交于
      Otherwise, the test fails with "Timed out while waiting for standby to
      catch up".  This happened rarely, perhaps only when autovacuum wrote WAL
      between our choosing the recovery target and choosing the LSN to await.
      Commit b26f7fa6 fixed one case of this.
      Fix two more.  Back-patch to 9.6, which introduced the affected test.
      
      Discussion: https://postgr.es/m/20180101055227.GA2952815@rfd.leadboat.com
      6078770c
    • T
      Merge coding of return/exit/continue cases in plpgsql's loop statements. · 3e724aac
      Tom Lane 提交于
      plpgsql's five different loop control statements contained three distinct
      implementations of the same (or what ought to be the same, at least)
      logic for handling return/exit/continue result codes from their child
      statements.  At best, that's trouble waiting to happen, and there seems
      no very good reason for the coding to be so different.  Refactor so that
      all the common logic is expressed in a single macro.
      
      Discussion: https://postgr.es/m/26314.1514670401@sss.pgh.pa.us
      3e724aac
    • T
      Improve regression tests' code coverage for plpgsql control structures. · dd2243f2
      Tom Lane 提交于
      I noticed that our code coverage report showed considerable deficiency
      in test coverage for PL/pgSQL control statements.  Notably, both
      exec_stmt_block and most of the loop control statements had very poor
      coverage of handling of return/exit/continue result codes from their
      child statements; and exec_stmt_fori was seriously lacking in feature
      coverage, having no test that exercised its BY or REVERSE features,
      nor verification that its overflow defenses work.
      
      Now that we have some infrastructure for plpgsql-specific test scripts,
      the natural thing to do is make a new script rather than further extend
      plpgsql.sql.  So I created a new script plpgsql_control.sql with the
      charter to test plpgsql control structures, and moved a few existing
      tests there because they fell entirely under that charter.  I then
      added new test cases that exercise the bits of code complained of above.
      
      Of the five kinds of loop statements, only exec_stmt_while's result code
      handling is fully exercised by these tests.  That would be a deficiency
      as things stand, but a follow-on commit will merge the loop statements'
      result code handling into one implementation.  So testing each usage of
      that implementation separately seems redundant.
      
      In passing, also add a couple test cases to plpgsql.sql to more fully
      exercise plpgsql's code related to expanded arrays --- I had thought
      that area was sufficiently covered already, but the coverage report
      showed a couple of un-executed code paths.
      
      Discussion: https://postgr.es/m/26314.1514670401@sss.pgh.pa.us
      dd2243f2
  5. 30 12月, 2017 3 次提交
  6. 29 12月, 2017 4 次提交
    • M
      Properly set base backup backends to active in pg_stat_activity · d02974e3
      Magnus Hagander 提交于
      When walsenders were included in pg_stat_activity, only the ones
      actually streaming WAL were listed as active when they were active. In
      particular, the connections sending base backups were listed as being
      idle. Which means that a regular pg_basebackup would show up with one
      active and one idle connection, when both were active.
      
      This patch updates to set all walsenders to active when they are
      (including those doing very fast things like IDENTIFY_SYSTEM), and then
      back to idle. Details about exactly what they are doing is available in
      pg_stat_replication.
      
      Patch by me, review by Michael Paquier and David Steele.
      d02974e3
    • S
      Fix race condition when changing synchronous_standby_names · 48c9f492
      Simon Riggs 提交于
      A momentary window exists when synchronous_standby_names
      changes that allows commands issued after the change to
      continue to act as async until the change becomes visible.
      Remove the race by using more appropriate test in syncrep.c
      
      Author: Asim Rama Praveen and Ashwin Agrawal
      Reported-by: Xin Zhang, Ashwin Agrawal, and Asim Rama Praveen
      Reviewed-by: Michael Paquier, Masahiko Sawada
      48c9f492
    • S
      Extend near-wraparound hints to include replication slots · 2958a672
      Simon Riggs 提交于
      Author: Feike Steenbergen
      Reviewed-by: Michael Paquier
      2958a672
    • A
      Allow leading zero on exponents in pgbench test results · 0aa1d489
      Andrew Dunstan 提交于
      Following commit 7a727c18 this is found to be necessary on at least some
      Windows platforms.
      
      per buildfarm.
      0aa1d489
  7. 28 12月, 2017 5 次提交
  8. 27 12月, 2017 1 次提交
  9. 26 12月, 2017 2 次提交
  10. 25 12月, 2017 1 次提交
    • T
      Add polygon opclass for SP-GiST · ff963b39
      Teodor Sigaev 提交于
      Polygon opclass uses compress method feature of SP-GiST added earlier. For now
      it's a single operator class which uses this feature. SP-GiST actually indexes
      a bounding boxes of input polygons, so part of supported operations are lossy.
      Opclass uses most methods of corresponding opclass over boxes of SP-GiST and
      treats bounding boxes as point in 4D-space.
      
      Bump catalog version.
      
      Authors: Nikita Glukhov, Alexander Korotkov with minor editorization by me
      Reviewed-By: all authors + Darafei Praliaskouski
      Discussion: https://www.postgresql.org/message-id/flat/54907069.1030506@sigaev.ru
      ff963b39
  11. 24 12月, 2017 1 次提交
  12. 23 12月, 2017 1 次提交
    • T
      Fix UNION/INTERSECT/EXCEPT over no columns. · c4c2885c
      Tom Lane 提交于
      Since 9.4, we've allowed the syntax "select union select" and variants
      of that.  However, the planner wasn't expecting a no-column set operation
      and ended up treating the set operation as if it were UNION ALL.
      
      Turns out it's trivial to fix in v10 and later; we just need to be careful
      about not generating a Sort node with no sort keys.  However, since a weird
      corner case like this is never going to be exercised by developers, we'd
      better have thorough regression tests if we want to consider it supported.
      
      Per report from Victor Yegorov.
      
      Discussion: https://postgr.es/m/CAGnEbojGJrRSOgJwNGM7JSJZpVAf8xXcVPbVrGdhbVEHZ-BUMw@mail.gmail.com
      c4c2885c