Skip to content
Snippets Groups Projects
  1. Aug 17, 2012
    • Tom Lane's avatar
      Check LIBXML_VERSION instead of testing in configure script. · 33f40976
      Tom Lane authored
      We had put a test for libxml2's xmlStructuredErrorContext variable in
      configure, but of course that doesn't work on Windows builds.  The next
      best alternative seems to be to test the LIBXML_VERSION symbol provided
      by xmlversion.h.
      
      Per report from Talha Bin Rizwan, though this fixes it in a different way
      than his proposed patch.
      33f40976
  2. May 15, 2012
    • 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
  3. May 14, 2012
  4. May 07, 2012
  5. Feb 23, 2012
  6. Feb 07, 2012
    • Robert Haas's avatar
      Support fls(). · 4f658dc8
      Robert Haas authored
      The immediate impetus for this is that Noah Misch's patch to elide
      unnecessary table and index rebuilds when changing typmod for temporal
      types uses it; and this is extracted from that patch, with some
      further commentary by me.  But it seems logically separate from the
      remainder of the patch, so I'm committing it separately; this is not
      the first time someone has wanted fls() in the backend and probably
      won't be the last.
      
      If we end up using this in more performance-critical spots it may be
      worthwhile to add some architecture-specific optimizations to our
      src/port version of fls() - e.g. any x86 platform can implement this
      using the assembly instruction BSRL.  But performance won't matter
      a bit for assessing typmod changes, so I'm not worried about that
      right now.
      4f658dc8
  7. Jan 07, 2012
    • Tom Lane's avatar
      Use __sync_lock_test_and_set() for spinlocks on ARM, if available. · 0a41e865
      Tom Lane authored
      Historically we've used the SWPB instruction for TAS() on ARM, but this
      is deprecated and not available on ARMv6 and later.  Instead, make use
      of a GCC builtin if available.  We'll still fall back to SWPB if not,
      so as not to break existing ports using older GCC versions.
      
      Eventually we might want to try using __sync_lock_test_and_set() on some
      other architectures too, but for now that seems to present only risk and
      not reward.
      
      Back-patch to all supported versions, since people might want to use any
      of them on more recent ARM chips.
      
      Martin Pitt
      0a41e865
  8. Jan 02, 2012
    • Tom Lane's avatar
      Use mutex hint bit in PPC LWARX instructions, where possible. · 5cfa8dd3
      Tom Lane authored
      The hint bit makes for a small but measurable performance improvement
      in access to contended spinlocks.
      
      On the other hand, some PPC chips give an illegal-instruction failure.
      There doesn't seem to be a completely bulletproof way to tell whether the
      hint bit will cause an illegal-instruction failure other than by trying
      it; but most if not all 64-bit PPC machines should accept it, so follow
      the Linux kernel's lead and assume it's okay to use it in 64-bit builds.
      Of course we must also check whether the assembler accepts the command,
      since even with a recent CPU the toolchain could be old.
      
      Patch by Manabu Ori, significantly modified by me.
      5cfa8dd3
  9. Dec 27, 2011
    • Peter Eisentraut's avatar
      Remove support for on_exit() · d383c23f
      Peter Eisentraut authored
      All supported platforms support the C89 standard function atexit()
      (SunOS 4 probably being the last one not to), and supporting both
      makes the code clumsy.
      d383c23f
  10. Dec 10, 2011
  11. Nov 18, 2011
  12. Aug 03, 2011
    • Robert Haas's avatar
      Make pgbench use erand48() rather than random(). · 4af43ee3
      Robert Haas authored
      glibc renders random() thread-safe by wrapping a futex lock around it;
      testing reveals that this limits the performance of pgbench on machines
      with many CPU cores.  Rather than switching to random_r(), which is
      only available on GNU systems and crashes unless you use undocumented
      alchemy to initialize the random state properly, switch to our built-in
      implementation of erand48(), which is both thread-safe and concurrent.
      
      Since the list of reasons not to use the operating system's erand48()
      is getting rather long, rename ours to pg_erand48() (and similarly
      for our implementations of lrand48() and srand48()) and just always
      use those.  We were already doing this on Cygwin anyway, and the
      glibc implementation is not quite thread-safe, so pgbench wouldn't
      be able to use that either.
      
      Per discussion with Tom Lane.
      4af43ee3
  13. Jul 20, 2011
    • Tom Lane's avatar
      Rewrite libxml error handling to be more robust. · cacd42d6
      Tom Lane authored
      libxml reports some errors (like invalid xmlns attributes) via the error
      handler hook, but still returns a success indicator to the library caller.
      This causes us to miss some errors that are important to report.  Since the
      "generic" error handler hook doesn't know whether the message it's getting
      is for an error, warning, or notice, stop using that and instead start
      using the "structured" error handler hook, which gets enough information
      to be useful.
      
      While at it, arrange to save and restore the error handler hook setting in
      each libxml-using function, rather than assuming we can set and forget the
      hook.  This should improve the odds of working nicely with third-party
      libraries that also use libxml.
      
      In passing, volatile-ize some local variables that get modified within
      PG_TRY blocks.  I noticed this while testing with an older gcc version
      than I'd previously tried to compile xml.c with.
      
      Florian Pflug and Tom Lane, with extensive review/testing by Noah Misch
      cacd42d6
  14. Jun 16, 2011
    • Peter Eisentraut's avatar
      Start using flexible array members · dbbba527
      Peter Eisentraut authored
      Flexible array members are a C99 feature that avoids "cheating" in the
      declaration of variable-length arrays at the end of structs.  With
      Autoconf support, this should be transparent for older compilers.
      
      We start with one use in gist.h because gcc 4.6 started to raise a
      warning there.  Over time, it can be expanded to other places in the
      source, but they will likely need some review of sizeof and offsetof
      usage.  The current change in gist.h appears to be safe in this
      regard.
      dbbba527
  15. May 31, 2011
    • Tom Lane's avatar
      Replace use of credential control messages with getsockopt(LOCAL_PEERCRED). · be4585b1
      Tom Lane authored
      It turns out the reason we hadn't found out about the portability issues
      with our credential-control-message code is that almost no modern platforms
      use that code at all; the ones that used to need it now offer getpeereid(),
      which we choose first.  The last holdout was NetBSD, and they added
      getpeereid() as of 5.0.  So far as I can tell, the only live platform on
      which that code was being exercised was Debian/kFreeBSD, ie, FreeBSD kernel
      with Linux userland --- since glibc doesn't provide getpeereid(), we fell
      back to the control message code.  However, the FreeBSD kernel provides a
      LOCAL_PEERCRED socket parameter that's functionally equivalent to Linux's
      SO_PEERCRED.  That is both much simpler to use than control messages, and
      superior because it doesn't require receiving a message from the other end
      at just the right time.
      
      Therefore, add code to use LOCAL_PEERCRED when necessary, and rip out all
      the credential-control-message code in the backend.  (libpq still has such
      code so that it can still talk to pre-9.1 servers ... but eventually we can
      get rid of it there too.)  Clean up related autoconf probes, too.
      
      This means that libpq's requirepeer parameter now works on exactly the same
      platforms where the backend supports peer authentication, so adjust the
      documentation accordingly.
      be4585b1
  16. Apr 23, 2011
    • Tom Lane's avatar
      Fix char2wchar/wchar2char to support collations properly. · 2ab0796d
      Tom Lane authored
      These functions should take a pg_locale_t, not a collation OID, and should
      call mbstowcs_l/wcstombs_l where available.  Where those functions are not
      available, temporarily select the correct locale with uselocale().
      
      This change removes the bogus assumption that all locales selectable in
      a given database have the same wide-character conversion method; in
      particular, the collate.linux.utf8 regression test now passes with
      LC_CTYPE=C, so long as the database encoding is UTF8.
      
      I decided to move the char2wchar/wchar2char functions out of mbutils.c and
      into pg_locale.c, because they work on wchar_t not pg_wchar_t and thus
      don't really belong with the mbutils.c functions.  Keeping them where they
      were would have required importing pg_locale_t into pg_wchar.h somehow,
      which did not seem like a good plan.
      2ab0796d
  17. Feb 08, 2011
    • 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
  18. Jan 27, 2011
    • Peter Eisentraut's avatar
      autoreconf · 6fe5e4e6
      Peter Eisentraut authored
      Synchronize pg_config.h.in with configure.in (someone must have
      forgotten to run autoheader or autoreconf), and clean up some spurious
      change in configure introduced by the last commit there.
      6fe5e4e6
  19. Dec 26, 2010
  20. May 25, 2010
  21. May 14, 2010
  22. Feb 13, 2010
    • Tom Lane's avatar
      Support inlining various small performance-critical functions on non-GCC · e08ab7c3
      Tom Lane authored
      compilers, by applying a configure check to see if the compiler will accept
      an unreferenced "static inline foo ..." function without warnings.  It is
      believed that such warnings are the only reason not to declare inlined
      functions in headers, if the compiler understands "inline" at all.
      
      Kurt Harriman
      e08ab7c3
  23. Jan 07, 2010
    • Tom Lane's avatar
      Alter the configure script to fail immediately if the C compiler does not · d15cb38d
      Tom Lane authored
      provide a working 64-bit integer datatype.  As recently noted, we've been
      broken on such platforms since early in the 8.4 development cycle.  Since
      it took nearly two years for anyone to even notice, it seems that the
      rationale for continuing to support such platforms has reached the point
      of non-existence.  Rather than thrashing around to try to make it work
      again, we'll just admit up front that this no longer works.
      
      Back-patch to 8.4 since that branch is also broken.
      
      We should go around to remove INT64_IS_BUSTED support, but just in HEAD,
      so that seems like material for a separate commit.
      d15cb38d
  24. Dec 31, 2009
  25. Oct 01, 2009
  26. Sep 14, 2009
    • Tom Lane's avatar
      Write psql's ~/.psql_history file using history_truncate_file() and · e97281c4
      Tom Lane authored
      append_history(), if libreadline is new enough to have those functions
      (they seem to be present at least since 4.2; but libedit may not have them).
      This gives significantly saner behavior when two or more sessions overlap in
      their use of the history file; although having two sessions exit at just the
      same time is still perilous to your history.  The behavior of \s remains
      unchanged, ie, overwrite whatever was there.
      Per bug #5052 from Marek Wójtowicz.
      e97281c4
  27. Jul 16, 2009
    • Tom Lane's avatar
      Add erand48() to the set of functions supported by our src/port/ library, · c43feefa
      Tom Lane authored
      and extend configure to test for it properly instead of hard-wiring
      an assumption that everybody but Windows has the rand48 functions.
      (We do cheat to the extent of assuming that probing for erand48 will do
      for the entire rand48 family.)
      
      erand48() is unused as of this commit, but a followon patch will cause
      GEQO to depend on it.
      
      Andres Freund, additional hacking by Tom
      c43feefa
  28. Jul 02, 2009
    • 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
  29. Apr 04, 2009
  30. Jan 11, 2009
  31. Jan 06, 2009
  32. Dec 11, 2008
  33. Dec 02, 2008
  34. Nov 24, 2008
  35. Nov 18, 2008
  36. May 02, 2008
  37. Apr 21, 2008
    • Tom Lane's avatar
      Allow float8, int8, and related datatypes to be passed by value on machines · 8472bf7a
      Tom Lane authored
      where Datum is 8 bytes wide.  Since this will break old-style C functions
      (those still using version 0 calling convention) that have arguments or
      results of these types, provide a configure option to disable it and retain
      the old pass-by-reference behavior.  Likewise, provide a configure option
      to disable the recently-committed float4 pass-by-value change.
      
      Zoltan Boszormenyi, plus configurability stuff by me.
      8472bf7a
Loading