1. 15 Nov, 2017 2 commits
  2. 14 Nov, 2017 4 commits
    • Tom Lane's avatar
      Prevent int128 from requiring more than MAXALIGN alignment. · 75180499
      Tom Lane authored
      Our initial work with int128 neglected alignment considerations, an
      oversight that came back to bite us in bug #14897 from Vincent Lachenal.
      It is unsurprising that int128 might have a 16-byte alignment requirement;
      what's slightly more surprising is that even notoriously lax Intel chips
      sometimes enforce that.
      
      Raising MAXALIGN seems out of the question: the costs in wasted disk and
      memory space would be significant, and there would also be an on-disk
      compatibility break.  Nor does it seem very practical to try to allow some
      data structures to have more-than-MAXALIGN alignment requirement, as we'd
      have to push knowledge of that throughout various code that copies data
      structures around.
      
      The only way out of the box is to make type int128 conform to the system's
      alignment assumptions.  Fortunately, gcc supports that via its
      __attribute__(aligned()) pragma; and since we don't currently support
      int128 on non-gcc-workalike compilers, we shouldn't be losing any platform
      support this way.
      
      Although we could have just done pg_attribute_aligned(MAXIMUM_ALIGNOF) and
      called it a day, I did a little bit of extra work to make the code more
      portable than that: it will also support int128 on compilers without
      __attribute__(aligned()), if the native alignment of their 128-bit-int
      type is no more than that of int64.
      
      Add a regression test case that exercises the one known instance of the
      problem, in parallel aggregation over a bigint column.
      
      This will need to be back-patched, along with the preparatory commit
      91aec93e.  But let's see what the buildfarm makes of it first.
      
      Discussion: https://postgr.es/m/20171110185747.31519.28038@wrigleys.postgresql.org
      75180499
    • Tom Lane's avatar
      Rearrange c.h to create a "compiler characteristics" section. · 91aec93e
      Tom Lane authored
      Generalize section 1 to handle stuff that is principally about the
      compiler (not libraries), such as attributes, and collect stuff there
      that had been dropped into various other parts of c.h.  Also, push
      all the gettext macros into section 8, so that section 0 is really
      just inclusions rather than inclusions and random other stuff.
      
      The primary goal here is to get pg_attribute_aligned() defined before
      section 3, so that we can use it with int128.  But this seems like good
      cleanup anyway.
      
      This patch just moves macro definitions around, and shouldn't result
      in any changes in generated code.  But I'll push it out separately
      to see if the buildfarm agrees.
      
      Discussion: https://postgr.es/m/20171110185747.31519.28038@wrigleys.postgresql.org
      91aec93e
    • Tom Lane's avatar
      Document changes in large-object privilege checking. · 6d776522
      Tom Lane authored
      Commit 5ecc0d73 removed the hard-wired superuser checks in lo_import
      and lo_export in favor of protecting them with SQL permissions, but
      failed to adjust the documentation to match.  Fix that, and add a
      <caution> paragraph pointing out the nontrivial security hazards
      involved with actually granting such permissions.  (It's still better
      than ALLOW_DANGEROUS_LO_FUNCTIONS, though.)
      
      Also, commit ae20b23a caused large object read/write privilege to
      be checked during lo_open() rather than in the actual read or write
      calls.  Document that.
      
      Discussion: https://postgr.es/m/CAB7nPqRHmNOYbETnc_2EjsuzSM00Z+BWKv9sy6tnvSd5gWT_JA@mail.gmail.com
      6d776522
    • Alvaro Herrera's avatar
      Simplify index_[constraint_]create API · a61f5ab9
      Alvaro Herrera authored
      Instead of passing large swaths of boolean arguments, define some flags
      that can be used in a bitmask.  This makes it easier not only to figure
      out what each call site is doing, but also to add some new flags.
      
      The flags are split in two -- one set for index_create directly and
      another for constraints.  index_create() itself receives both, and then
      passes down the latter to index_constraint_create(), which can also be
      called standalone.
      
      Discussion: https://postgr.es/m/20171023151251.j75uoe27gajdjmlm@alvherre.pgsql
      Reviewed-by: Simon Riggs
      a61f5ab9
  3. 13 Nov, 2017 6 commits
  4. 12 Nov, 2017 2 commits
  5. 11 Nov, 2017 4 commits
  6. 10 Nov, 2017 6 commits
  7. 09 Nov, 2017 7 commits
  8. 08 Nov, 2017 6 commits
    • Tom Lane's avatar
      Allow --with-bonjour to work with non-macOS implementations of Bonjour. · 9b9cb3c4
      Tom Lane authored
      On macOS the relevant functions require no special library, but elsewhere
      we need to pull in libdns_sd.
      
      Back-patch to supported branches.  No docs change since the docs do not
      suggest that this is a Mac-only feature.
      
      Luke Lonergan
      
      Discussion: https://postgr.es/m/2D8331C5-D64F-44C1-8717-63EDC6EAF7EB@brightforge.com
      9b9cb3c4
    • Tom Lane's avatar
      Doc: fix erroneous example. · bd65e0c6
      Tom Lane authored
      The grammar requires these options to appear the other way 'round.
      
      jotpe@posteo.de
      
      Discussion: https://postgr.es/m/78933bd0-45ce-690e-b832-a328dd1a5567@posteo.de
      bd65e0c6
    • Tom Lane's avatar
      Fix two violations of the ResourceOwnerEnlarge/Remember protocol. · c5269472
      Tom Lane authored
      The point of having separate ResourceOwnerEnlargeFoo and
      ResourceOwnerRememberFoo functions is so that resource allocation
      can happen in between.  Doing it in some other order is just wrong.
      
      OpenTemporaryFile() did open(), enlarge, remember, which would leak the
      open file if the enlarge step ran out of memory.  Because fd.c has its own
      layer of resource-remembering, the consequences look like they'd be limited
      to an intratransaction FD leak, but it's still not good.
      
      IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow
      up if the incr-refcount step ever failed.  It was safe enough when written,
      but since the introduction of PrivateRefCountHash, I think the assumption
      that no error could happen there is pretty shaky.
      
      The odds of real problems from either bug are probably small, but still,
      back-patch to supported branches.
      
      Thomas Munro and Tom Lane, per a comment from Andres Freund
      c5269472
    • Peter Eisentraut's avatar
      Change TRUE/FALSE to true/false · 2eb4a831
      Peter Eisentraut authored
      The lower case spellings are C and C++ standard and are used in most
      parts of the PostgreSQL sources.  The upper case spellings are only used
      in some files/modules.  So standardize on the standard spellings.
      
      The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so
      those are left as is when using those APIs.
      
      In code comments, we use the lower-case spelling for the C concepts and
      keep the upper-case spelling for the SQL concepts.
      Reviewed-by: default avatarMichael Paquier <michael.paquier@gmail.com>
      2eb4a831
    • Peter Eisentraut's avatar
      Put markup in the right place · 4497f2f3
      Peter Eisentraut authored
      4497f2f3
    • Peter Eisentraut's avatar
      Expand empty end tag · 6e1e4c0d
      Peter Eisentraut authored
      6e1e4c0d
  9. 07 Nov, 2017 3 commits