Skip to content
Snippets Groups Projects
  1. Jan 06, 2015
  2. Aug 25, 2014
  3. Jul 14, 2014
  4. Jul 10, 2014
  5. May 29, 2014
    • Tom Lane's avatar
      When using the OSSP UUID library, cache its uuid_t state object. · c941aed9
      Tom Lane authored
      The original coding in contrib/uuid-ossp created and destroyed a uuid_t
      object (or, in some cases, even two of them) each time it was called.
      This is not the intended usage: you're supposed to keep the uuid_t object
      around so that the library can cache its state across uses.  (Other UUID
      libraries seem to keep equivalent state behind-the-scenes in static
      variables, but OSSP chose differently.)  Aside from being quite inefficient,
      creating a new uuid_t loses knowledge of the previously generated UUID,
      which in theory could result in duplicate V1-style UUIDs being created
      on sufficiently fast machines.
      
      On at least some platforms, creating a new uuid_t also draws some entropy
      from /dev/urandom, leaving less for the rest of the system.  This seems
      sufficiently unpleasant to justify back-patching this change.
      c941aed9
    • Tom Lane's avatar
      Fix uuid-ossp regression tests based on buildfarm feedback. · 25dd07e0
      Tom Lane authored
      The previous version of these tests expected uuid_generate_v1() to always
      emit MAC addresses with the local-admin and multicast address bits zero.
      However, several of the buildfarm critters are reporting values with the
      local-admin bit set.  (Perhaps they're running inside VMs or jails.)
      And a couple are reporting values with the multicast bit set, probably
      meaning that the UUID library couldn't read the system MAC address.
      
      Also, it emerges that if OSSP UUID can't read the system MAC address, it
      falls back to V1MC behavior wherein the whole node field gets randomized
      each time, breaking the test that expected the node field to remain stable
      in V1 output.  (It looks like e2fs doesn't behave that way, though.)
      
      It's not entirely clear why we can't get a system MAC address, since the
      buildfarm scripts would not work without internet access.  Nonetheless,
      the regression tests had better cope with the case, so adjust the tests
      to expect these behaviors.
      25dd07e0
  6. May 28, 2014
    • Tom Lane's avatar
      Improve regression tests for uuid-ossp. · c0f27628
      Tom Lane authored
      On reflection, the timestamp-advances test might fail if we're unlucky
      enough for the time_mid field to change between two calls, since uuid_cmp
      is just bytewise comparison and the field ordering has more significant
      fields later.  Build some field extraction functions so we can do a more
      honest test of that.  Also check that the version and reserved fields
      contain what they should.
      c0f27628
    • Tom Lane's avatar
      Fix stack clobber in new uuid-ossp code. · 2103218d
      Tom Lane authored
      The V5 (SHA1 hashing) code wrote 20 bytes into a 16-byte local variable.
      This had accidentally failed to fail in my testing and Matteo's, but
      buildfarm results exposed the problem.
      2103218d
    • Tom Lane's avatar
      Support BSD and e2fsprogs UUID libraries alongside OSSP UUID library. · b8cc8f94
      Tom Lane authored
      Allow the contrib/uuid-ossp extension to be built atop any one of these
      three popular UUID libraries.  (The extension's name is now arguably a
      misnomer, but we'll keep it the same so as not to cause unnecessary
      compatibility issues for users.)
      
      We would not normally consider a change like this post-beta1, but the issue
      has been forced by our upgrade to autoconf 2.69, whose more rigorous header
      checks are causing OSSP's header files to be rejected on some platforms.
      It's been foreseen for some time that we'd have to move away from depending
      on OSSP UUID due to lack of upstream maintenance, so this is a down payment
      on that problem.
      
      While at it, add some simple regression tests, in hopes of catching any
      major incompatibilities between the three implementations.
      
      Matteo Beccati, with some further hacking by me
      b8cc8f94
  7. Apr 18, 2014
    • Peter Eisentraut's avatar
      Create function prototype as part of PG_FUNCTION_INFO_V1 macro · e7128e8d
      Peter Eisentraut authored
      Because of gcc -Wmissing-prototypes, all functions in dynamically
      loadable modules must have a separate prototype declaration.  This is
      meant to detect global functions that are not declared in header files,
      but in cases where the function is called via dfmgr, this is redundant.
      Besides filling up space with boilerplate, this is a frequent source of
      compiler warnings in extension modules.
      
      We can fix that by creating the function prototype as part of the
      PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway.  That
      makes the code of modules cleaner, because there is one less place where
      the entry points have to be listed, and creates an additional check that
      functions have the right prototype.
      
      Remove now redundant prototypes from contrib and other modules.
      e7128e8d
  8. Jan 07, 2014
  9. Nov 22, 2013
  10. Jan 01, 2013
  11. Jan 02, 2012
  12. Oct 12, 2011
    • Tom Lane's avatar
      Throw a useful error message if an extension script file is fed to psql. · 458857cc
      Tom Lane authored
      We have seen one too many reports of people trying to use 9.1 extension
      files in the old-fashioned way of sourcing them in psql.  Not only does
      that usually not work (due to failure to substitute for MODULE_PATHNAME
      and/or @extschema@), but if it did work they'd get a collection of loose
      objects not an extension.  To prevent this, insert an \echo ... \quit
      line that prints a suitable error message into each extension script file,
      and teach commands/extension.c to ignore lines starting with \echo.
      That should not only prevent any adverse consequences of loading a script
      file the wrong way, but make it crystal clear to users that they need to
      do it differently now.
      
      Tom Lane, following an idea of Andrew Dunstan's.  Back-patch into 9.1
      ... there is not going to be much value in this if we wait till 9.2.
      458857cc
  13. Feb 14, 2011
    • Tom Lane's avatar
      Avoid use of CREATE OR REPLACE FUNCTION in extension installation files. · 029fac22
      Tom Lane authored
      It was never terribly consistent to use OR REPLACE (because of the lack of
      comparable functionality for data types, operators, etc), and
      experimentation shows that it's now positively pernicious in the extension
      world.  We really want a failure to occur if there are any conflicts, else
      it's unclear what the extension-ownership state of the conflicted object
      ought to be.  Most of the time, CREATE EXTENSION will fail anyway because
      of conflicts on other object types, but an extension defining only
      functions can succeed, with bad results.
      029fac22
    • Tom Lane's avatar
      Convert contrib modules to use the extension facility. · 629b3af2
      Tom Lane authored
      This isn't fully tested as yet, in particular I'm not sure that the
      "foo--unpackaged--1.0.sql" scripts are OK.  But it's time to get some
      buildfarm cycles on it.
      
      sepgsql is not converted to an extension, mainly because it seems to
      require a very nonstandard installation process.
      
      Dimitri Fontaine and Tom Lane
      629b3af2
  14. Jan 01, 2011
  15. Oct 26, 2010
  16. Sep 20, 2010
  17. Jan 02, 2010
  18. Jun 11, 2009
  19. Jan 01, 2009
  20. Mar 25, 2008
    • Tom Lane's avatar
      Simplify and standardize conversions between TEXT datums and ordinary C · 220db7cc
      Tom Lane authored
      strings.  This patch introduces four support functions cstring_to_text,
      cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and
      two macros CStringGetTextDatum and TextDatumGetCString.  A number of
      existing macros that provided variants on these themes were removed.
      
      Most of the places that need to make such conversions now require just one
      function or macro call, in place of the multiple notational layers that used
      to be needed.  There are no longer any direct calls of textout or textin,
      and we got most of the places that were using handmade conversions via
      memcpy (there may be a few still lurking, though).
      
      This commit doesn't make any serious effort to eliminate transient memory
      leaks caused by detoasting toasted text objects before they reach
      text_to_cstring.  We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few
      places where it was easy, but much more could be done.
      
      Brendan Jurd and Tom Lane
      220db7cc
  21. Jan 01, 2008
  22. Dec 31, 2007
  23. Nov 15, 2007
  24. Nov 13, 2007
  25. Nov 11, 2007
  26. Oct 23, 2007
  27. Jun 27, 2007
  28. May 15, 2007
  29. Apr 22, 2007
Loading