Skip to content
Snippets Groups Projects
  1. Jan 05, 2018
  2. Jan 03, 2018
    • Peter Eisentraut's avatar
      Allow ldaps when using ldap authentication · 35c0754f
      Peter Eisentraut authored
      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
    • Bruce Momjian's avatar
      Update copyright for 2018 · 9d4649ca
      Bruce Momjian authored
      Backpatch-through: certain files through 9.3
      9d4649ca
  3. Dec 13, 2017
  4. Nov 23, 2017
    • Peter Eisentraut's avatar
      Convert documentation to DocBook XML · 3c49c6fa
      Peter Eisentraut authored
      Since some preparation work had already been done, the only source
      changes left were changing empty-element tags like <xref linkend="foo">
      to <xref linkend="foo"/>, and changing the DOCTYPE.
      
      The source files are still named *.sgml, but they are actually XML files
      now.  Renaming could be considered later.
      
      In the build system, the intermediate step to convert from SGML to XML
      is removed.  Everything is build straight from the source files again.
      The OpenSP (or the old SP) package is no longer needed.
      
      The documentation toolchain instructions are updated and are much
      simpler now.
      
      Peter Eisentraut, Alexander Lakhin, Jürgen Purtz
      3c49c6fa
  5. Nov 14, 2017
    • 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
  6. Nov 09, 2017
  7. Nov 08, 2017
  8. Nov 07, 2017
    • Tom Lane's avatar
      Fix version numbering foulups exposed by 10.1. · d0c80c17
      Tom Lane authored
      configure computed PG_VERSION_NUM incorrectly.  (Coulda sworn I tested
      that logic back when, but it had an obvious thinko.)
      
      pg_upgrade had not been taught about the new dispensation with just
      one part in the major version number.
      
      Both things accidentally failed to fail with 10.0, but with 10.1 we
      got the wrong results.
      
      Per buildfarm.
      d0c80c17
  9. Oct 13, 2017
  10. Oct 12, 2017
  11. Oct 10, 2017
  12. Sep 30, 2017
    • Andres Freund's avatar
      Extend & revamp pg_bswap.h infrastructure. · 510b8cbf
      Andres Freund authored
      Upcoming patches are going to address performance issues that involve
      slow system provided ntohs/htons etc. To address that expand
      pg_bswap.h to provide pg_ntoh{16,32,64}, pg_hton{16,32,64} and
      optimize their respective implementations by using compiler intrinsics
      for gcc compatible compilers and msvc. Fall back to manual
      implementations using shifts etc otherwise.
      
      Additionally remove multiple evaluation hazards from the existing
      BSWAP32/64 macros, by replacing them with inline functions when
      necessary. In the course of that the naming scheme is changed to
      pg_bswap16/32/64.
      
      Author: Andres Freund
      Discussion: https://postgr.es/m/20170927172019.gheidqy6xvlxb325@alap3.anarazel.de
      510b8cbf
  13. Sep 25, 2017
    • Tom Lane's avatar
      Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. · 899bd785
      Tom Lane authored
      On Linux, shared memory segments created with shm_open() are backed by
      swap files created in tmpfs.  If the swap file needs to be extended,
      but there's no tmpfs space left, you get a very unfriendly SIGBUS trap.
      To avoid this, force allocation of the full request size when we create
      the segment.  This adds a few cycles, but none that we wouldn't expend
      later anyway, assuming the request isn't hugely bigger than the actual
      need.
      
      Make this code #ifdef __linux__, because (a) there's not currently a
      reason to think the same problem exists on other platforms, and (b)
      applying posix_fallocate() to an FD created by shm_open() isn't very
      portable anyway.
      
      Back-patch to 9.4 where the DSM code came in.
      
      Thomas Munro, per a bug report from Amul Sul
      
      Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com
      899bd785
  14. Sep 22, 2017
    • Tom Lane's avatar
      Assume wcstombs(), towlower(), and sibling functions are always present. · 85feb77a
      Tom Lane authored
      These functions are required by SUS v2, which is our minimum baseline
      for Unix platforms, and are present on all interesting Windows versions
      as well.  Even our oldest buildfarm members have them.  Thus, we were not
      testing the "!USE_WIDE_UPPER_LOWER" code paths, which explains why the bug
      fixed in commit e6023ee7 escaped detection.  Per discussion, there seems
      to be no more real-world value in maintaining this option.  Hence, remove
      the configure-time tests for wcstombs() and towlower(), remove the
      USE_WIDE_UPPER_LOWER symbol, and remove all the !USE_WIDE_UPPER_LOWER code.
      There's not actually all that much of the latter, but simplifying the #if
      nests is a win in itself.
      
      Discussion: https://postgr.es/m/20170921052928.GA188913@rfd.leadboat.com
      85feb77a
  15. Sep 20, 2017
    • Andres Freund's avatar
      Make WAL segment size configurable at initdb time. · fc49e24f
      Andres Freund authored
      For performance reasons a larger segment size than the default 16MB
      can be useful. A larger segment size has two main benefits: Firstly,
      in setups using archiving, it makes it easier to write scripts that
      can keep up with higher amounts of WAL, secondly, the WAL has to be
      written and synced to disk less frequently.
      
      But at the same time large segment size are disadvantageous for
      smaller databases. So far the segment size had to be configured at
      compile time, often making it unrealistic to choose one fitting to a
      particularly load. Therefore change it to a initdb time setting.
      
      This includes a breaking changes to the xlogreader.h API, which now
      requires the current segment size to be configured.  For that and
      similar reasons a number of binaries had to be taught how to recognize
      the current segment size.
      
      Author: Beena Emerson, editorialized by Andres Freund
      Reviewed-By: Andres Freund, David Steele, Kuntal Ghosh, Michael
          Paquier, Peter Eisentraut, Robert Hass, Tushar Ahuja
      Discussion: https://postgr.es/m/CAOG9ApEAcQ--1ieKbhFzXSQPw_YLmepaa4hNdnY5+ZULpt81Mw@mail.gmail.com
      fc49e24f
  16. Sep 01, 2017
    • Tom Lane's avatar
      Make [U]INT64CONST safe for use in #if conditions. · 9d6b160d
      Tom Lane authored
      Instead of using a cast to force the constant to be the right width,
      assume we can plaster on an L, UL, LL, or ULL suffix as appropriate.
      The old approach to this is very hoary, dating from before we were
      willing to require compilers to have working int64 types.
      
      This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX
      constants safe to use in preprocessor conditions, where a cast
      doesn't work.  Other symbolic constants that might be defined using
      [U]INT64CONST are likewise safer than before.
      
      Also fix the SIZE_MAX macro to be similarly safe, if we are forced
      to provide a definition for that.  The test added in commit 2e70d6b5
      happens to do what we want even with the hack "(size_t) -1" definition,
      but we could easily get burnt on other tests in future.
      
      Back-patch to all supported branches, like the previous commits.
      
      Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us
      9d6b160d
  17. Aug 15, 2017
    • Tom Lane's avatar
      Stamp HEAD as 11devel. · 9f14dc39
      Tom Lane authored
      Note that we no longer require any manual adjustments to shared-library
      minor version numbers, cf commit a3bce17e.  So this should be everything.
      9f14dc39
  18. Aug 11, 2017
  19. Aug 07, 2017
  20. Aug 05, 2017
    • Tom Lane's avatar
      Improve configure's check for ICU presence. · f4f41baf
      Tom Lane authored
      Without ICU's header files, "configure --with-icu" would succeed anyway,
      at least when using the non-pkgconfig-based setup.  Then you got a bunch of
      ugly failures at build.  Add an explicit header check to tighten that up.
      f4f41baf
  21. Aug 01, 2017
    • Tom Lane's avatar
      Further improve consistency of configure's program searching. · b21c569c
      Tom Lane authored
      Peter Eisentraut noted that commit 40b9f192 had broken a configure
      behavior that some people might rely on: AC_CHECK_PROGS(FOO,...) will
      allow the search to be overridden by specifying a value for FOO on
      configure's command line or in its environment, but AC_PATH_PROGS(FOO,...)
      accepts such an override only if it's an absolute path.  We had worked
      around that behavior for some, but not all, of the pre-existing uses
      of AC_PATH_PROGS by just skipping the macro altogether when FOO is
      already set.  Let's standardize on that workaround for all uses of
      AC_PATH_PROGS, new and pre-existing, by wrapping AC_PATH_PROGS in a
      new macro PGAC_PATH_PROGS.  While at it, fix a deficiency of the old
      workaround code by making sure we report the setting to configure's log.
      
      Eventually I'd like to improve PGAC_PATH_PROGS so that it converts
      non-absolute override inputs to absolute form, eg "PYTHON=python3"
      becomes, say, PYTHON = /usr/bin/python3.  But that will take some
      nontrivial coding so it doesn't seem like a thing to do in late beta.
      
      Discussion: https://postgr.es/m/90a92a7d-938e-507a-3bd7-ecd2b4004689@2ndquadrant.com
      b21c569c
  22. Jul 31, 2017
    • Tom Lane's avatar
      Record full paths of programs sought by "configure". · 40b9f192
      Tom Lane authored
      Previously we had a mix of uses of AC_CHECK_PROG[S] and AC_PATH_PROG[S].
      The only difference between those macros is that the latter emits the
      full path to the program it finds, eg "/usr/bin/prove", whereas the
      former emits just "prove".  Let's standardize on always emitting the
      full path; this is better for documentation of the build, and it might
      prevent some types of failures if later build steps are done with
      a different PATH setting.
      
      I did not touch the AC_CHECK_PROG[S] calls in ax_pthread.m4 and
      ax_prog_perl_modules.m4.  There seems no need to make those diverge from
      upstream, since we do not record the programs sought by the former, while
      the latter's call to AC_CHECK_PROG(PERL,...) will never be reached.
      
      Discussion: https://postgr.es/m/25937.1501433410@sss.pgh.pa.us
      40b9f192
  23. Jul 28, 2017
    • Tom Lane's avatar
      PL/Perl portability fix: absorb relevant -D switches from Perl. · 3c163a7f
      Tom Lane authored
      The Perl documentation is very clear that stuff calling libperl should
      be built with the compiler switches shown by Perl's $Config{ccflags}.
      We'd been ignoring that up to now, and mostly getting away with it,
      but recent Perl versions contain ABI compatibility cross-checks that
      fail on some builds because of this omission.  In particular the
      sizeof(PerlInterpreter) can come out different due to some fields being
      added or removed; which means we have a live ABI hazard that we'd better
      fix rather than continuing to sweep it under the rug.
      
      However, it still seems like a bad idea to just absorb $Config{ccflags}
      verbatim.  In some environments Perl was built with a different compiler
      that doesn't even use the same switch syntax.  -D switch syntax is pretty
      universal though, and absorbing Perl's -D switches really ought to be
      enough to fix the problem.
      
      Furthermore, Perl likes to inject stuff like -D_LARGEFILE_SOURCE and
      -D_FILE_OFFSET_BITS=64 into $Config{ccflags}, which affect libc ABIs on
      platforms where they're relevant.  Adopting those seems dangerous too.
      It's unclear whether a build wherein Perl and Postgres have different ideas
      of sizeof(off_t) etc would work, or whether anyone would care about making
      it work.  But it's dead certain that having different stdio ABIs in
      core Postgres and PL/Perl will not work; we've seen that movie before.
      Therefore, let's also ignore -D switches for symbols beginning with
      underscore.  The symbols that we actually need to import should be the ones
      mentioned in perl.h's PL_bincompat_options stanza, and none of those start
      with underscore, so this seems likely to work.  (If it turns out not to
      work everywhere, we could consider intersecting the symbols mentioned in
      PL_bincompat_options with the -D switches.  But that will be much more
      complicated, so let's try this way first.)
      
      This will need to be back-patched, but first let's see what the
      buildfarm makes of it.
      
      Ashutosh Sharma, some adjustments by me
      
      Discussion: https://postgr.es/m/CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com
      3c163a7f
  24. Jul 10, 2017
  25. Jun 15, 2017
  26. May 15, 2017
  27. Apr 25, 2017
  28. Apr 24, 2017
    • Tom Lane's avatar
      Use pselect(2) not select(2), if available, to wait in postmaster's loop. · 81069a9e
      Tom Lane authored
      Traditionally we've unblocked signals, called select(2), and then blocked
      signals again.  The code expects that the select() will be cancelled with
      EINTR if an interrupt occurs; but there's a race condition, which is that
      an already-pending signal will be delivered as soon as we unblock, and then
      when we reach select() there will be nothing preventing it from waiting.
      This can result in a long delay before we perform any action that
      ServerLoop was supposed to have taken in response to the signal.  As with
      the somewhat-similar symptoms fixed by commit 89390208, the main practical
      problem is slow launching of parallel workers.  The window for trouble is
      usually pretty short, corresponding to one iteration of ServerLoop; but
      it's not negligible.
      
      To fix, use pselect(2) in place of select(2) where available, as that's
      designed to solve exactly this problem.  Where not available, we continue
      to use the old way, and are no worse off than before.
      
      pselect(2) has been required by POSIX since about 2001, so most modern
      platforms should have it.  A bigger portability issue is that some
      implementations are said to be non-atomic, ie pselect() isn't really
      any different from unblock/select/reblock.  Still, we're no worse off
      than before on such a platform.
      
      There is talk of rewriting the postmaster to use a WaitEventSet and
      not do signal response work in signal handlers, at which point this
      could be reverted, since we'd be using a self-pipe to solve the race
      condition.  But that's not happening before v11 at the earliest.
      
      Back-patch to 9.6.  The problem exists much further back, but the
      worst symptom arises only in connection with parallel query, so it
      does not seem worth taking any portability risks in older branches.
      
      Discussion: https://postgr.es/m/9205.1492833041@sss.pgh.pa.us
      81069a9e
    • Andres Freund's avatar
      Don't include sys/poll.h anymore. · b182a4ae
      Andres Freund authored
      poll.h is mandated by Single Unix Spec v2, the usual baseline for
      postgres on unix.  None of the unixoid buildfarms animals has
      sys/poll.h but not poll.h.  Therefore there's not much point to test
      for sys/poll.h's existence and include it optionally.
      
      Author: Andres Freund, per suggestion from Tom Lane
      Discussion: https://postgr.es/m/20505.1492723662@sss.pgh.pa.us
      b182a4ae
  29. Apr 07, 2017
    • Peter Eisentraut's avatar
      Remove use of Jade and DSSSL · 510074f9
      Peter Eisentraut authored
      All documentation is now built using XSLT.  Remove all references to
      Jade, DSSSL, also JadeTex and some other outdated tooling.
      
      For chunked HTML builds, this changes nothing, but removes the
      transitional "oldhtml" target.  The single-page HTML build is ported
      over to XSLT.  For PDF builds, this removes the JadeTex builds and moves
      the FOP builds in their place.
      510074f9
  30. Apr 05, 2017
  31. Mar 29, 2017
    • Peter Eisentraut's avatar
      Cast result of copyObject() to correct type · 4cb82469
      Peter Eisentraut authored
      
      copyObject() is declared to return void *, which allows easily assigning
      the result independent of the input, but it loses all type checking.
      
      If the compiler supports typeof or something similar, cast the result to
      the input type.  This creates a greater amount of type safety.  In some
      cases, where the result is assigned to a generic type such as Node * or
      Expr *, new casts are now necessary, but in general casts are now
      unnecessary in the normal case and indicate that something unusual is
      happening.
      
      Reviewed-by: default avatarMark Dilger <hornschnorter@gmail.com>
      4cb82469
  32. Mar 23, 2017
    • Peter Eisentraut's avatar
      ICU support · eccfef81
      Peter Eisentraut authored
      
      Add a column collprovider to pg_collation that determines which library
      provides the collation data.  The existing choices are default and libc,
      and this adds an icu choice, which uses the ICU4C library.
      
      The pg_locale_t type is changed to a union that contains the
      provider-specific locale handles.  Users of locale information are
      changed to look into that struct for the appropriate handle to use.
      
      Also add a collversion column that records the version of the collation
      when it is created, and check at run time whether it is still the same.
      This detects potentially incompatible library upgrades that can corrupt
      indexes and other structures.  This is currently only supported by
      ICU-provided collations.
      
      initdb initializes the default collation set as before from the `locale
      -a` output but also adds all available ICU locales with a "-x-icu"
      appended.
      
      Currently, ICU-provided collations can only be explicitly named
      collations.  The global database locales are still always libc-provided.
      
      ICU support is enabled by configure --with-icu.
      
      Reviewed-by: default avatarThomas Munro <thomas.munro@enterprisedb.com>
      Reviewed-by: default avatarAndreas Karlsson <andreas@proxel.se>
      eccfef81
  33. Mar 20, 2017
  34. Feb 26, 2017
    • Tom Lane's avatar
      Remove some configure header-file checks that we weren't really using. · 2bd7f857
      Tom Lane authored
      We had some AC_CHECK_HEADER tests that were really wastes of cycles,
      because the code proceeded to #include those headers unconditionally
      anyway, in all or a large majority of cases.  The lack of complaints
      shows that those headers are available on every platform of interest,
      so we might as well let configure run a bit faster by not probing
      those headers at all.
      
      I suspect that some of the tests I left alone are equally useless, but
      since all the existing #includes of the remaining headers are properly
      guarded, I didn't touch them.
      2bd7f857
  35. Feb 23, 2017
    • Tom Lane's avatar
      De-support floating-point timestamps. · b6aa17e0
      Tom Lane authored
      Per discussion, the time has come to do this.  The handwriting has been
      on the wall at least since 9.0 that this would happen someday, whenever
      it got to be too much of a burden to support the float-timestamp option.
      The triggering factor now is the discovery that there are multiple bugs
      in the code that attempts to implement use of integer timestamps in the
      replication protocol even when the server is built for float timestamps.
      The internal float timestamps leak into the protocol fields in places.
      While we could fix the identified bugs, there's a very high risk of
      introducing more.  Trying to build a wall that would positively prevent
      mixing integer and float timestamps is more complexity than we want to
      undertake to maintain a long-deprecated option.  The fact that these
      bugs weren't found through testing also indicates a lack of interest
      in float timestamps.
      
      This commit disables configure's --disable-integer-datetimes switch
      (it'll still accept --enable-integer-datetimes, though), removes direct
      references to USE_INTEGER_DATETIMES, and removes discussion of float
      timestamps from the user documentation.  A considerable amount of code is
      rendered dead by this, but removing that will occur as separate mop-up.
      
      Discussion: https://postgr.es/m/26788.1487455319@sss.pgh.pa.us
      b6aa17e0
Loading