Skip to content
Snippets Groups Projects
  1. Jan 20, 2014
  2. Jan 18, 2014
  3. Jan 17, 2014
    • Tom Lane's avatar
      Add gen_random_uuid() to contrib/pgcrypto. · e6170126
      Tom Lane authored
      This function provides a way of generating version 4 (pseudorandom) UUIDs
      based on pgcrypto's PRNG.  The main reason for doing this is that the
      OSSP UUID library depended on by contrib/uuid-ossp is becoming more and
      more of a porting headache, so we need an alternative for people who can't
      install that.  A nice side benefit though is that this implementation is
      noticeably faster than uuid-ossp's uuid_generate_v4() function.
      
      Oskari Saarenmaa, reviewed by Emre Hasegeli
      e6170126
    • Heikki Linnakangas's avatar
      Prevent integer overflow with --progress >= 2148 · 27727998
      Heikki Linnakangas authored
      If --progress=2148 or higher was given, the calculation of the next time
      to report overflowed, and pgbench would print a progress report very
      frequently.
      
      Kingter Wang
      27727998
  4. Jan 16, 2014
  5. Jan 15, 2014
  6. Jan 14, 2014
    • Robert Haas's avatar
      Test code for shared memory message queue facility. · 4db3744f
      Robert Haas authored
      This code is intended as a demonstration of how the dynamic shared
      memory and dynamic background worker facilities can be used to establish
      a group of coooperating processes which can coordinate their activities
      using the shared memory message queue facility.  By itself, the code
      does nothing particularly interesting: it simply allows messages to
      be passed through a loop of workers and back to the original process.
      But it's a useful unit test, in addition to its demonstration value.
      4db3744f
  7. Jan 13, 2014
    • Tom Lane's avatar
      Fix possible buffer overrun in contrib/pg_trgm. · c3ccc9ee
      Tom Lane authored
      Allow for the possibility that folding a string to lower case makes it
      longer (due to replacing a character with a longer multibyte character).
      This doesn't change the number of trigrams that will be extracted, but
      it does affect the required size of an intermediate buffer in
      generate_trgm().  Per bug #8821 from Ufuk Kayserilioglu.
      
      Also install some checks that the input string length is not so large
      as to cause overflow in the calculations of palloc request sizes.
      
      Back-patch to all supported versions.
      c3ccc9ee
    • Heikki Linnakangas's avatar
      Fix calculation of ISMN check digit. · 866a1f09
      Heikki Linnakangas authored
      This has always been broken, so back-patch to all supported versions.
      
      Fabien COELHO
      866a1f09
  8. Jan 11, 2014
  9. Jan 09, 2014
    • Peter Eisentraut's avatar
      pgcrypto: Make header files stand alone · 10a3b165
      Peter Eisentraut authored
      pgp.h used to require including mbuf.h and px.h first.  Include those in
      pgp.h, so that it can be used without prerequisites.  Remove mbuf.h
      inclusions in .c files where mbuf.h features are not used
      directly.  (px.h was always used.)
      10a3b165
  10. Jan 08, 2014
  11. Jan 07, 2014
  12. Jan 04, 2014
    • Tom Lane's avatar
      Fix typo in comment. · 99299756
      Tom Lane authored
      classifyClauses was renamed to classifyConditions somewhere along the
      line, but this comment didn't get the memo.
      
      Ian Barwick
      99299756
  13. Jan 02, 2014
  14. Dec 23, 2013
    • Tom Lane's avatar
      Support ordered-set (WITHIN GROUP) aggregates. · 8d65da1f
      Tom Lane authored
      This patch introduces generic support for ordered-set and hypothetical-set
      aggregate functions, as well as implementations of the instances defined in
      SQL:2008 (percentile_cont(), percentile_disc(), rank(), dense_rank(),
      percent_rank(), cume_dist()).  We also added mode() though it is not in the
      spec, as well as versions of percentile_cont() and percentile_disc() that
      can compute multiple percentile values in one pass over the data.
      
      Unlike the original submission, this patch puts full control of the sorting
      process in the hands of the aggregate's support functions.  To allow the
      support functions to find out how they're supposed to sort, a new API
      function AggGetAggref() is added to nodeAgg.c.  This allows retrieval of
      the aggregate call's Aggref node, which may have other uses beyond the
      immediate need.  There is also support for ordered-set aggregates to
      install cleanup callback functions, so that they can be sure that
      infrastructure such as tuplesort objects gets cleaned up.
      
      In passing, make some fixes in the recently-added support for variadic
      aggregates, and make some editorial adjustments in the recent FILTER
      additions for aggregates.  Also, simplify use of IsBinaryCoercible() by
      allowing it to succeed whenever the target type is ANY or ANYELEMENT.
      It was inconsistent that it dealt with other polymorphic target types
      but not these.
      
      Atri Sharma and Andrew Gierth; reviewed by Pavel Stehule and Vik Fearing,
      and rather heavily editorialized upon by Tom Lane
      8d65da1f
  15. Dec 22, 2013
    • Robert Haas's avatar
      Change the way we mark tuples as frozen. · 37484ad2
      Robert Haas authored
      Instead of changing the tuple xmin to FrozenTransactionId, the combination
      of HEAP_XMIN_COMMITTED and HEAP_XMIN_INVALID, which were previously never
      set together, is now defined as HEAP_XMIN_FROZEN.  A variety of previous
      proposals to freeze tuples opportunistically before vacuum_freeze_min_age
      is reached have foundered on the objection that replacing xmin by
      FrozenTransactionId might hinder debugging efforts when things in this
      area go awry; this patch is intended to solve that problem by keeping
      the XID around (but largely ignoring the value to which it is set).
      
      Third-party code that checks for HEAP_XMIN_INVALID on tuples where
      HEAP_XMIN_COMMITTED might be set will be broken by this change.  To fix,
      use the new accessor macros in htup_details.h rather than consulting the
      bits directly.  HeapTupleHeaderGetXmin has been modified to return
      FrozenTransactionId when the infomask bits indicate that the tuple is
      frozen; use HeapTupleHeaderGetRawXmin when you already know that the
      tuple isn't marked commited or frozen, or want the raw value anyway.
      We currently do this in routines that display the xmin for user consumption,
      in tqual.c where it's known to be safe and important for the avoidance of
      extra cycles, and in the function-caching code for various procedural
      languages, which shouldn't invalidate the cache just because the tuple
      gets frozen.
      
      Robert Haas and Andres Freund
      37484ad2
  16. Dec 20, 2013
  17. Dec 19, 2013
  18. Dec 18, 2013
    • Robert Haas's avatar
      Fix compiler warning. · 6bb9d301
      Robert Haas authored
      get_user_name returns const char *, but we were assigning the result
      to a char * variable.
      6bb9d301
    • Bruce Momjian's avatar
      Fix incorrect error message reported for non-existent users · 613c6d26
      Bruce Momjian authored
      Previously, lookups of non-existent user names could return "Success";
      it will now return "User does not exist" by resetting errno.  This also
      centralizes the user name lookup code in libpgport.
      
      Report and analysis by Nicolas Marchildon;  patch by me
      613c6d26
  19. Dec 12, 2013
  20. Dec 08, 2013
  21. Dec 07, 2013
    • Fujii Masao's avatar
      Expose qurey ID in pg_stat_statements view. · 91484409
      Fujii Masao authored
      The query ID is the internal hash identifier of the statement,
      and was not available in pg_stat_statements view so far.
      
      Daniel Farina, Sameer Thakur and Peter Geoghegan, reviewed by me.
      91484409
  22. Dec 04, 2013
  23. Dec 03, 2013
  24. Nov 30, 2013
  25. Nov 24, 2013
    • Tom Lane's avatar
      Defend against bad trigger definitions in contrib/lo's lo_manage() trigger. · 64d15e42
      Tom Lane authored
      This function formerly crashed if called as a statement-level trigger,
      or if a column-name argument wasn't given.
      
      In passing, add the trigger name to all error messages from the function.
      (None of them are expected cases, so this shouldn't pose any compatibility
      risk.)
      
      Marc Cousin, reviewed by Sawada Masahiko
      64d15e42
  26. Nov 22, 2013
    • Tom Lane's avatar
      Fix quoting in help messages in uuid-ossp extension scripts. · f29baf92
      Tom Lane authored
      The command we're telling people to type needs to include double-quoting
      around the unfortunately-chosen extension name.  Twiddle the textual
      quoting so that it looks somewhat sane.  Per gripe from roadrunner6.
      f29baf92
    • Tom Lane's avatar
      Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. · 784e762e
      Tom Lane authored
      This patch adds the ability to write TABLE( function1(), function2(), ...)
      as a single FROM-clause entry.  The result is the concatenation of the
      first row from each function, followed by the second row from each
      function, etc; with NULLs inserted if any function produces fewer rows than
      others.  This is believed to be a much more useful behavior than what
      Postgres currently does with multiple SRFs in a SELECT list.
      
      This syntax also provides a reasonable way to combine use of column
      definition lists with WITH ORDINALITY: put the column definition list
      inside TABLE(), where it's clear that it doesn't control the ordinality
      column as well.
      
      Also implement SQL-compliant multiple-argument UNNEST(), by turning
      UNNEST(a,b,c) into TABLE(unnest(a), unnest(b), unnest(c)).
      
      The SQL standard specifies TABLE() with only a single function, not
      multiple functions, and it seems to require an implicit UNNEST() which is
      not what this patch does.  There may be something wrong with that reading
      of the spec, though, because if it's right then the spec's TABLE() is just
      a pointless alternative spelling of UNNEST().  After further review of
      that, we might choose to adopt a different syntax for what this patch does,
      but in any case this functionality seems clearly worthwhile.
      
      Andrew Gierth, reviewed by Zoltán Böszörményi and Heikki Linnakangas, and
      significantly revised by me
      784e762e
  27. Nov 19, 2013
    • Bruce Momjian's avatar
      pg_upgrade: avoid ALTER COLUMN TYPE on inherited columns · dbd786bc
      Bruce Momjian authored
      This only affects upgrades from 8.3 currently, and is harmless as the
      child just generates an error in the script, but we should get it right
      in case we ever need this for more complex uses.
      
      Per report from Peter Eisentraut
      dbd786bc
    • Peter Eisentraut's avatar
      pg_upgrade: Report full disk better · bd5a9a50
      Peter Eisentraut authored
      Previously, pg_upgrade would abort copy_file() on a short write without
      setting errno, which the caller would report as an error with the
      message "Success".  We assume ENOSPC in that case, as we do elsewhere in
      the code.  Also set errno in some other error cases in copy_file() to
      avoid bogus "Success" error messages.
      
      This was broken in 6b711cf3, so 9.2 and
      before are OK.
      bd5a9a50
  28. Nov 18, 2013
Loading