1. 13 Mar, 2017 3 commits
  2. 12 Mar, 2017 8 commits
    • Noah Misch's avatar
      Use wrappers of PG_DETOAST_DATUM_PACKED() more. · 3a0d4731
      Noah Misch authored
      This makes almost all core code follow the policy introduced in the
      previous commit.  Specific decisions:
      
      - Text search support functions with char* and length arguments, such as
        prsstart and lexize, may receive unaligned strings.  I doubt
        maintainers of non-core text search code will notice.
      
      - Use plain VARDATA() on values detoasted or synthesized earlier in the
        same function.  Use VARDATA_ANY() on varlenas sourced outside the
        function, even if they happen to always have four-byte headers.  As an
        exception, retain the universal practice of using VARDATA() on return
        values of SendFunctionCall().
      
      - Retain PG_GETARG_BYTEA_P() in pageinspect.  (Page images are too large
        for a one-byte header, so this misses no optimization.)  Sites that do
        not call get_page_from_raw() typically need the four-byte alignment.
      
      - For now, do not change btree_gist.  Its use of four-byte headers in
        memory is partly entangled with storage of 4-byte headers inside
        GBT_VARKEY, on disk.
      
      - For now, do not change gtrgm_consistent() or gtrgm_distance().  They
        incorporate the varlena header into a cache, and there are multiple
        credible implementation strategies to consider.
      3a0d4731
    • Noah Misch's avatar
      Recommend wrappers of PG_DETOAST_DATUM_PACKED(). · 9d7726c2
      Noah Misch authored
      When commit 3e23b68d introduced
      single-byte varlena headers, its fmgr.h changes presented
      PG_GETARG_TEXT_PP() and PG_GETARG_TEXT_P() as equals.  Its postgres.h
      changes presented PG_DETOAST_DATUM_PACKED() and VARDATA_ANY() as the
      exceptional case.  Now, instead, firmly recommend PG_GETARG_TEXT_PP()
      over PG_GETARG_TEXT_P(); likewise for other ...PP() macros.  This shaves
      cycles and invites consistency of style.
      9d7726c2
    • Noah Misch's avatar
      Fix pg_file_write() error handling. · 944a026b
      Noah Misch authored
      Detect fclose() failures; given "ln -s /dev/full $PGDATA/devfull",
      "pg_file_write('devfull', 'x', true)" now fails as it should.  Don't
      leak a stream when fwrite() fails.  Remove a born-ineffective test that
      aimed to skip zero-length writes.  Back-patch to 9.2 (all supported
      versions).
      944a026b
    • Noah Misch's avatar
      Assume deconstruct_array() outputs are untoasted. · 2fd26b23
      Noah Misch authored
      In functions that issue a deconstruct_array() call, consistently use
      plain VARSIZE()/VARDATA() on the array elements.  Prior practice was
      divided between those and VARSIZE_ANY_EXHDR()/VARDATA_ANY().
      2fd26b23
    • Noah Misch's avatar
      Fix comment about length of text, bytea, etc. · 9e092646
      Noah Misch authored
      When commit 3e23b68d introduced
      single-byte varlena headers, it rendered this comment incomplete.
      9e092646
    • Tom Lane's avatar
      Add "break"s to make it clearer what will happen in a nested switch. · 766f7fd6
      Tom Lane authored
      This could only matter if the guessed_type variable had a value that wasn't
      a member of the PasswordType enum; but just in case, let's be sure that
      control falls out to reach the elog(ERROR) at the end of the function.
      Per gripe from Coverity.
      766f7fd6
    • Tom Lane's avatar
      Fix typo in initdb's SCRAM password processing. · 835cc113
      Tom Lane authored
      Noted by Coverity (a rather impressive catch).
      
      Michael Paquier
      835cc113
    • Tom Lane's avatar
      Remove dead code in nodeGatherMerge.c. · 5d3f7c57
      Tom Lane authored
      Coverity noted that the last line of gather_merge_getnext() was
      unreachable, since each arm of the preceding "if" ends in a "return".
      Drop it as an oversight.  In passing, improve some nearby comments.
      5d3f7c57
  3. 11 Mar, 2017 3 commits
  4. 10 Mar, 2017 23 commits
  5. 09 Mar, 2017 3 commits
    • Robert Haas's avatar
      Throw an error if a DATA() line contains wrong # of attributes. · 7666e73a
      Robert Haas authored
      David Christensen, reviewed by Dagfinn Ilmari Mannsåker
      
      Discussion: http://postgr.es/m/20170215154018.fs5vwtqhp5d2sifs@veeddeux.attlocal.net
      7666e73a
    • Robert Haas's avatar
      Use group updates when setting transaction status in clog. · ccce90b3
      Robert Haas authored
      Commit 0e141c0f introduced a mechanism
      to reduce contention on ProcArrayLock by having a single process clear
      XIDs in the procArray on behalf of multiple processes, reducing the
      need to hand the lock around.  Use a similar mechanism to reduce
      contention on CLogControlLock.  Testing shows that this very
      significantly reduces the amount of time waiting for CLogControlLock
      on high-concurrency pgbench tests run on a large multi-socket
      machines; whether that translates into a TPS improvement depends on
      how much of that contention is simply shifted to some other lock,
      particularly WALWriteLock.
      
      Amit Kapila, with some cosmetic changes by me.  Extensively reviewed,
      tested, and benchmarked over a period of about 15 months by Simon
      Riggs, Robert Haas, Andres Freund, Jesper Pedersen, and especially by
      Tomas Vondra and Dilip Kumar.
      
      Discussion: http://postgr.es/m/CAA4eK1L_snxM_JcrzEstNq9P66++F4kKFce=1r5+D1vzPofdtg@mail.gmail.com
      Discussion: http://postgr.es/m/CAA4eK1LyR2A+m=RBSZ6rcPEwJ=rVi1ADPSndXHZdjn56yqO6Vg@mail.gmail.com
      Discussion: http://postgr.es/m/91d57161-d3ea-0cc2-6066-80713e4f90d7@2ndquadrant.com
      ccce90b3
    • Tom Lane's avatar
      Fix timestamptz regression test to still work with latest IANA zone data. · f077e1b2
      Tom Lane authored
      The IANA timezone crew continues to chip away at their project of removing
      timezone abbreviations that have no real-world currency from their
      database.  The tzdata2017a update removes all such abbreviations for
      South American zones, as well as much of the Pacific.  This breaks some
      test cases in timestamptz.sql that were expecting America/Santiago and
      America/Caracas to have non-numeric abbreviations.
      
      The test cases involving America/Santiago seem to have selected that
      zone more or less at random, so just replace it with America/New_York,
      which is of similar longitude.  The cases involving America/Caracas are
      harder since they were chosen to test a time-varying zone abbreviation
      around a point where it changed meaning in the backwards direction.
      Fortunately, Europe/Moscow has a similar case in 2014, and the MSK/MSD
      abbreviations are well enough attested that IANA seems unlikely to
      decide to remove them from the database in future.
      
      With these changes, this regression test should pass when using any IANA
      zone database from 2015 or later.  One could wish that there were a few
      years more daylight on how out-of-date your zone database can be ... but
      really the --with-system-tzdata option is only meant for use on platforms
      where the zone database is kept up-to-date pretty faithfully, so I do not
      think this is a big objection.
      
      Discussion: https://postgr.es/m/6749.1489087470@sss.pgh.pa.us
      f077e1b2