1. 14 Mar, 2017 13 commits
  2. 13 Mar, 2017 14 commits
  3. 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
  4. 11 Mar, 2017 3 commits
  5. 10 Mar, 2017 2 commits
    • Tom Lane's avatar
      Improve postmaster's logging of listen socket creation. · f9dfa5c9
      Tom Lane authored
      When one of the kernel calls in the socket()/bind()/listen() sequence
      fails, include the specific address we're trying to bind to in the log
      message.  This greatly eases debugging of network misconfigurations.
      
      Also, after successfully setting up a listen socket, report its address
      in the log, to ease verification that the expected addresses were bound.
      There was some debate about whether to print this message at LOG level or
      only DEBUG1, but the majority of votes were for the former.
      
      Discussion: https://postgr.es/m/9564.1489091245@sss.pgh.pa.us
      f9dfa5c9
    • Peter Eisentraut's avatar
      pg_dump: Fix dumping of publications · de752816
      Peter Eisentraut authored
      Dumping a publication with more than one table crashed pg_dump.
      
      patch by Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, test by me
      de752816