1. 28 Mar, 2020 1 commit
    • Peter Eisentraut's avatar
      Enable Unix-domain sockets support on Windows · 8f3ec75d
      Peter Eisentraut authored
      As of Windows 10 version 1803, Unix-domain sockets are supported on
      Windows.  But it's not automatically detected by configure because it
      looks for struct sockaddr_un and Windows doesn't define that.  So we
      just make our own definition on Windows and override the configure
      result.
      
      Set DEFAULT_PGSOCKET_DIR to empty on Windows so by default no
      Unix-domain socket is used, because there is no good standard
      location.
      
      In pg_upgrade, we have to do some extra tweaking to preserve the
      existing behavior of not using Unix-domain sockets on Windows.  Adding
      support would be desirable, but it needs further work, in particular a
      way to select whether to use Unix-domain sockets from the command-line
      or with a run-time test.
      
      The pg_upgrade test script needs a fix.  The previous code passed
      "localhost" to postgres -k, which only happened to work because
      Windows used to ignore the -k argument value altogether.  We instead
      need to pass an empty string to get the desired effect.
      
      The test suites will continue to not use Unix-domain sockets on
      Windows.  This requires a small tweak in pg_regress.c.  The TAP tests
      don't need to be changed because they decide by the operating system
      rather than HAVE_UNIX_SOCKETS.
      Reviewed-by: default avatarAndrew Dunstan <andrew.dunstan@2ndquadrant.com>
      Discussion: https://www.postgresql.org/message-id/flat/54bde68c-d134-4eb8-5bd3-8af33b72a010@2ndquadrant.com
      8f3ec75d
  2. 07 Oct, 2019 1 commit
  3. 26 Sep, 2018 2 commits
    • Tom Lane's avatar
      Try another way to detect the result type of strerror_r(). · 751f532b
      Tom Lane authored
      The method we've traditionally used, of redeclaring strerror_r() to
      see if the compiler complains of inconsistent declarations, turns out
      not to work reliably because some compilers only report a warning,
      not an error.  Amazingly, this has gone undetected for years, even
      though it certainly breaks our detection of whether strerror_r
      succeeded.
      
      Let's instead test whether the compiler will take the result of
      strerror_r() as a switch() argument.  It's possible this won't
      work universally either, but it's the best idea I could come up with
      on the spur of the moment.
      
      We should probably back-patch this once the dust settles, but
      first let's see what the buildfarm thinks of it.
      
      Discussion: https://postgr.es/m/10877.1537993279@sss.pgh.pa.us
      751f532b
    • Tom Lane's avatar
      Always use our own versions of *printf(). · 96bf88d5
      Tom Lane authored
      We've spent an awful lot of effort over the years in coping with
      platform-specific vagaries of the *printf family of functions.  Let's just
      forget all that mess and standardize on always using src/port/snprintf.c.
      This gets rid of a lot of configure logic, and it will allow a saner
      approach to dealing with %m (though actually changing that is left for
      a follow-on patch).
      
      Preliminary performance testing suggests that as it stands, snprintf.c is
      faster than the native printf functions for some tasks on some platforms,
      and slower for other cases.  A pending patch will improve that, though
      cases with floating-point conversions will doubtless remain slower unless
      we want to put a *lot* of effort into that.  Still, we've not observed
      that *printf is really a performance bottleneck for most workloads, so
      I doubt this matters much.
      
      Patch by me, reviewed by Michael Paquier
      
      Discussion: https://postgr.es/m/2975.1526862605@sss.pgh.pa.us
      96bf88d5
  4. 17 Aug, 2018 1 commit
    • Tom Lane's avatar
      Fix configure's snprintf test so it exposes HP-UX bug. · 9bed827b
      Tom Lane authored
      Since commit e1d19c90, buildfarm member gharial has been failing with
      symptoms indicating that snprintf sometimes returns -1 for buffer
      overrun, even though it passes the added configure check.  Some
      google research suggests that this happens only in limited cases,
      such as when the overrun happens partway through a %d item.  Adjust
      the configure check to exercise it that way.  Since I'm now feeling
      more paranoid than I was before, also make the test explicitly verify
      that the buffer doesn't get physically overrun.
      9bed827b
  5. 16 Aug, 2018 1 commit
    • Tom Lane's avatar
      Require a C99-compliant snprintf(), and remove related workarounds. · e1d19c90
      Tom Lane authored
      Since our substitute snprintf now returns a C99-compliant result,
      there's no need anymore to have complicated code to cope with pre-C99
      behavior.  We can just make configure substitute snprintf.c if it finds
      that the system snprintf() is pre-C99.  (Note: I do not believe that
      there are any platforms where this test will trigger that weren't
      already being rejected due to our other C99-ish feature requirements for
      snprintf.  But let's add the check for paranoia's sake.)  Then, simplify
      the call sites that had logic to cope with the pre-C99 definition.
      
      I also dropped some stuff that was being paranoid about the possibility
      of snprintf overrunning the given buffer.  The only reports we've ever
      heard of that being a problem were for Solaris 7, which is long dead,
      and we've sure not heard any reports of these assertions triggering in
      a long time.  So let's drop that complexity too.
      
      Likewise, drop some code that wasn't trusting snprintf to set errno
      when it returns -1.  That would be not-per-spec, and again there's
      no real reason to believe it is a live issue, especially not for
      snprintfs that pass all of configure's feature checks.
      
      Discussion: https://postgr.es/m/17245.1534289329@sss.pgh.pa.us
      e1d19c90
  6. 23 May, 2018 1 commit
    • Tom Lane's avatar
      Remove configure's check for nonstandard "long long" printf modifiers. · b929614f
      Tom Lane authored
      We used to claim to support platforms using 'q' or 'I64' as the printf
      length modifier for long long int, by dint of replacing snprintf with
      our own code which uses the C99 standard 'll' modifier.  But that is
      only adequate if we use INT64_MODIFIER only in snprintf-based calls,
      not directly with the platform's native printf or fprintf.  Which
      hasn't been the case for years.  We had not noticed, partially because
      of inadequate test coverage, and partially because the buildfarm is
      almost completely bare of machines that won't take 'll'.  The last
      one seems to have been frogmouth, which was adjusted recently so that
      it will take 'll'.  We might as well just give up on the pretense
      that anything else works, and save ourselves some configure cycles.
      
      Discussion: https://postgr.es/m/13103.1526749980@sss.pgh.pa.us
      Discussion: https://postgr.es/m/24769.1526772680@sss.pgh.pa.us
      b929614f
  7. 29 Mar, 2018 1 commit
  8. 25 Feb, 2017 1 commit
    • 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
  9. 30 Sep, 2016 2 commits
  10. 25 Sep, 2016 1 commit
    • Tom Lane's avatar
      Refer to OS X as "macOS", except for the port name which is still "darwin". · da6c4f6c
      Tom Lane authored
      We weren't terribly consistent about whether to call Apple's OS "OS X"
      or "Mac OS X", and the former is probably confusing to people who aren't
      Apple users.  Now that Apple has rebranded it "macOS", follow their lead
      to establish a consistent naming pattern.  Also, avoid the use of the
      ancient project name "Darwin", except as the port code name which does not
      seem desirable to change.  (In short, this patch touches documentation and
      comments, but no actual code.)
      
      I didn't touch contrib/start-scripts/osx/, either.  I suspect those are
      obsolete and due for a rewrite, anyway.
      
      I dithered about whether to apply this edit to old release notes, but
      those were responsible for quite a lot of the inconsistencies, so I ended
      up changing them too.  Anyway, Apple's being ahistorical about this,
      so why shouldn't we be?
      da6c4f6c
  11. 15 Mar, 2016 1 commit
    • Tom Lane's avatar
      Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. · 0e9b8998
      Tom Lane authored
      Previously, we included <xlocale.h> only if necessary to get the definition
      of type locale_t.  According to notes in PGAC_TYPE_LOCALE_T, this is
      important because on some versions of glibc that file supplies an
      incompatible declaration of locale_t.  (This info may be obsolete, because
      on my RHEL6 box that seems to be the *only* definition of locale_t; but
      there may still be glibc's in the wild for which it's a live concern.)
      
      It turns out though that on FreeBSD and maybe other BSDen, you can get
      locale_t from stdlib.h or locale.h but mbstowcs_l() and friends only from
      <xlocale.h>.  This was leaving us compiling calls to mbstowcs_l() and
      friends with no visible prototype, which causes a warning and could
      possibly cause actual trouble, since it's not declared to return int.
      
      Hence, adjust the configure checks so that we'll include <xlocale.h>
      either if it's necessary to get type locale_t or if it's necessary to
      get a declaration of mbstowcs_l().
      
      Report and patch by Aleksander Alekseev, somewhat whacked around by me.
      Back-patch to all supported branches, since we have been using
      mbstowcs_l() since 9.1.
      0e9b8998
  12. 31 Aug, 2015 1 commit
    • Tom Lane's avatar
      Remove support for Unix systems without the POSIX signal APIs. · a65e0864
      Tom Lane authored
      Remove configure's checks for HAVE_POSIX_SIGNALS, HAVE_SIGPROCMASK, and
      HAVE_SIGSETJMP.  These APIs are required by the Single Unix Spec v2
      (POSIX 1997), which we generally consider to define our minimum required
      set of Unix APIs.  Moreover, no buildfarm member has reported not having
      them since 2012 or before, which means that even if the code is still live
      somewhere, it's untested --- and we've made plenty of signal-handling
      changes of late.  So just take these APIs as given and save the cycles for
      configure probes for them.
      
      However, we can't remove as much C code as I'd hoped, because the Windows
      port evidently still uses the non-POSIX code paths for signal masking.
      Since we're largely emulating these BSD-style APIs for Windows anyway, it
      might be a good thing to switch over to POSIX-like notation and thereby
      remove a few more #ifdefs.  But I'm not in a position to code or test that.
      In the meantime, we can at least make things a bit more transparent by
      testing for WIN32 explicitly in these places.
      a65e0864
  13. 02 Jul, 2015 1 commit
    • Heikki Linnakangas's avatar
      Replace obsolete autoconf macros with their modern replacements. · a2edb023
      Heikki Linnakangas authored
      AC_TRY_COMPILE(...) -> AC_COMPILE_IFELSE([AC_LANG_PROGRAM(...)])
      AC_TRY_LINK(...) -> AC_LINK_IFELSE([AC_LANG_PROGRAM(...)])
      AC_TRY_RUN(...) -> AC_RUN_IFELSE([AC_LANG_PROGRAM(...)])
      AC_LANG_SAVE/RESTORE -> AC_LANG_PUSH/POP
      AC_DECL_SYS_SIGLIST -> AC_CHECK_DECLS(...) (per snippet in autoconf manual)
      
      Also use AC_LANG_SOURCE instead of AC_LANG_PROGRAM, where the main()
      function is not needed.
      
      With these changes, autoconf -Wall doesn't complain anymore.
      
      Andreas Karlsson
      a2edb023
  14. 11 Jan, 2015 1 commit
    • Tom Lane's avatar
      Remove configure test for nonstandard variants of getpwuid_r(). · 8883bae3
      Tom Lane authored
      We had code that supposed that some platforms might offer a nonstandard
      version of getpwuid_r() with only four arguments.  However, the 5-argument
      definition has been standardized at least since the Single Unix Spec v2,
      which is our normal reference for what's portable across all Unix-oid
      platforms.  (What's more, this wasn't the only pre-standardization version
      of getpwuid_r(); my old HPUX 10.20 box has still another signature.)
      So let's just get rid of the now-useless configure step.
      8883bae3
  15. 18 Sep, 2014 1 commit
    • Andres Freund's avatar
      Fix configure check for %z printf support after INT64_MODIFIER changes. · 7e3f7283
      Andres Freund authored
      The PGAC_FUNC_SNPRINTF_SIZE_T_SUPPORT test was broken by
      ce486056. Among others it made the UINT64_FORMAT macro to be
      defined in c.h, instead of directly being defined by configure.
      
      This lead to the replacement printf being used on all platforms for a
      while. Which seems to work, because this was only used due to
      different profiles ;)
      
      Fix by relying on INT64_MODIFIER instead.
      7e3f7283
  16. 21 Aug, 2014 1 commit
  17. 23 Jan, 2014 1 commit
    • Tom Lane's avatar
      Allow use of "z" flag in our printf calls, and use it where appropriate. · ac4ef637
      Tom Lane authored
      Since C99, it's been standard for printf and friends to accept a "z" size
      modifier, meaning "whatever size size_t has".  Up to now we've generally
      dealt with printing size_t values by explicitly casting them to unsigned
      long and using the "l" modifier; but this is really the wrong thing on
      platforms where pointers are wider than longs (such as Win64).  So let's
      start using "z" instead.  To ensure we can do that on all platforms, teach
      src/port/snprintf.c to understand "z", and add a configure test to force
      use of that implementation when the platform's version doesn't handle "z".
      
      Having done that, modify a bunch of places that were using the
      unsigned-long hack to use "z" instead.  This patch doesn't pretend to have
      gotten everyplace that could benefit, but it catches many of them.  I made
      an effort in particular to ensure that all uses of the same error message
      text were updated together, so as not to increase the number of
      translatable strings.
      
      It's possible that this change will result in format-string warnings from
      pre-C99 compilers.  We might have to reconsider if there are any popular
      compilers that will warn about this; but let's start by seeing what the
      buildfarm thinks.
      
      Andres Freund, with a little additional work by me
      ac4ef637
  18. 15 Jun, 2013 1 commit
  19. 15 May, 2012 1 commit
    • Tom Lane's avatar
      Put back AC_REQUIRE([AC_STRUCT_TM]). · f667747b
      Tom Lane authored
      The BSD-ish members of the buildfarm all seem to think removing this
      was a bad idea.  It looks to me like it resulted in omitting the system
      header inclusion necessary to detect the fields of struct tm correctly.
      f667747b
  20. 14 May, 2012 1 commit
  21. 08 Feb, 2011 1 commit
    • Peter Eisentraut's avatar
      Per-column collation support · 414c5a2e
      Peter Eisentraut authored
      This adds collation support for columns and domains, a COLLATE clause
      to override it per expression, and B-tree index support.
      
      Peter Eisentraut
      reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
      414c5a2e
  22. 20 Sep, 2010 1 commit
  23. 02 Jul, 2009 1 commit
    • Peter Eisentraut's avatar
      Upgrade to Autoconf 2.63 · 7cc514ac
      Peter Eisentraut authored
      This upgrades the configure infrastructure to the latest Autoconf version.
      Some notable news are:
       - The workaround for the broken fseeko() test is gone.
       - Checking for unknown options is now provided by Autoconf itself.
       - Fixes for Mac OS X
      7cc514ac
  24. 21 Aug, 2008 1 commit
  25. 19 Feb, 2008 1 commit
  26. 24 Feb, 2005 1 commit
  27. 22 Feb, 2005 1 commit
    • Bruce Momjian's avatar
      Add support to port/snprintf.c for position parameter specification: · b4feafb6
      Bruce Momjian authored
      + # Determine if printf supports %1$ argument selection, e.g. %5$ selects
      + # the fifth argument after the printf print string.
      + # This is not in the C99 standard, but in the Single Unix Specification (SUS).
      + # It is used in our langauge translation strings.
      
      Nicolai Tufar with configure changes by Bruce.
      b4feafb6
  28. 16 Dec, 2004 1 commit
  29. 04 Oct, 2004 1 commit
  30. 08 Sep, 2004 1 commit
  31. 07 Jun, 2004 1 commit
  32. 20 Mar, 2004 1 commit
  33. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  34. 23 Jul, 2003 1 commit
    • Tom Lane's avatar
      Have a go at fixing various outstanding portability issues in code that · df63503d
      Tom Lane authored
      was modified for IPv6.  Use a robust definition of struct sockaddr_storage,
      do a proper configure test to see if ss_len exists, don't assume that
      getnameinfo() will handle AF_UNIX sockets, don't trust getaddrinfo to
      return the protocol we ask for, etc.  This incorporates several outstanding
      patches from Kurt Roeckx, but I'm to blame for anything that doesn't
      work ...
      df63503d
  35. 23 Jun, 2003 1 commit
  36. 12 Jun, 2003 2 commits
  37. 22 May, 2003 1 commit