Skip to content
Snippets Groups Projects
  1. Apr 05, 2010
  2. Apr 02, 2010
  3. Mar 25, 2010
    • Tom Lane's avatar
      Fix ginint4_queryextract() to actually do what it was intended to do for an · 5ceb13c8
      Tom Lane authored
      unsatisfiable query, such as indexcol && empty_array.  It should return -1
      to tell GIN no scan is required; but silly typo disabled the logic for that,
      resulting in unnecessary "GIN indexes do not support whole-index scans" error.
      Per bug report from Jeff Trout.
      
      Back-patch to 8.3 where the logic was introduced.
      5ceb13c8
  4. Mar 23, 2010
  5. Mar 03, 2010
    • Tom Lane's avatar
      Make contrib/xml2 use core xml.c's error handler, when available (that is, · 5e47403b
      Tom Lane authored
      in versions >= 8.3).  The core code is more robust and efficient than what
      was there before, and this also reduces risks involved in swapping different
      libxml error handler settings.
      
      Before 8.3, there is still some risk of problems if add-on modules such as
      Perl invoke libxml without setting their own error handler.  Given the lack
      of reports I'm not sure there's a risk in practice, so I didn't take the
      step of actually duplicating the core code into older contrib/xml2 branches.
      Instead I just tweaked the existing code to ensure it didn't leave a dangling
      pointer to short-lived memory when throwing an error.
      5e47403b
  6. Mar 01, 2010
    • Tom Lane's avatar
      Fix contrib/xml2 so regression test still works when it's built without libxslt. · d6a6f8c6
      Tom Lane authored
      This involves modifying the module to have a stable ABI, that is, the
      xslt_process() function still exists even without libxslt.  It throws a
      runtime error if called, but doesn't prevent executing the CREATE FUNCTION
      call.  This is a good thing anyway to simplify cross-version upgrades.
      d6a6f8c6
    • Tom Lane's avatar
      Remove xmlCleanupParser calls from contrib/xml2. · a1020909
      Tom Lane authored
      These are unnecessary and probably dangerous.  I don't see any immediate
      risk situations in the core XML support or contrib/xml2 itself, but there
      could be issues with external uses of libxml2, and in any case it's an
      accident waiting to happen.
      a1020909
  7. Feb 28, 2010
    • Tom Lane's avatar
      Fix up memory management problems in contrib/xml2. · 936c4af1
      Tom Lane authored
      Get rid of the code that attempted to funnel libxml2's memory allocations
      into palloc.   We already knew from experience with the core xml datatype
      that trying to do this is simply not reliable.  Unlike the core code, I
      did not bother adding a lot of PG_TRY/PG_CATCH logic to try to ensure that
      everything is cleaned up on error exit.  Hence, we might leak some memory
      if one of these functions fails partway through.  Given the deprecated
      status of this contrib module and the fact that errors partway through
      the functions shouldn't be too common, it doesn't seem worth worrying about.
      
      Also fix a separate bug in xpath_table, that it did the wrong things
      if given a result tuple descriptor with less than 2 columns.  While
      such a case isn't very useful in practice, we shouldn't fail or stomp
      memory when it occurs.
      
      Add some simple regression tests based on all the reported crash cases
      that I have on hand.
      
      This should be back-patched, but let's see if the buildfarm likes it first.
      936c4af1
    • Tom Lane's avatar
      Assorted code cleanup for contrib/xml2. No change in functionality, · a12333ee
      Tom Lane authored
      just make it a bit less ugly in places.
      a12333ee
  8. Feb 26, 2010
  9. Feb 24, 2010
    • Tom Lane's avatar
      Allow zero-dimensional (ie, empty) arrays in contrib/ltree operations. · 29d2f86a
      Tom Lane authored
      The main motivation for changing this is bug #4921, in which it's pointed out
      that it's no longer safe to apply ltree operations to the result of
      ARRAY(SELECT ...) if the sub-select might return no rows.  Before 8.3,
      the ARRAY() construct would return NULL, which might or might not be helpful
      but at least it wouldn't result in an error.  Now it returns an empty array
      which results in a failure for no good reason, since the ltree operations
      are all perfectly capable of dealing with zero-element arrays.
      
      As far as I can find, these ltree functions are the only places where zero
      array dimensionality is rejected unnecessarily.
      
      Back-patch to 8.3 to prevent behavioral regression of queries that worked
      in older releases.
      29d2f86a
    • Itagaki Takahiro's avatar
  10. Feb 23, 2010
  11. Feb 17, 2010
  12. Feb 16, 2010
  13. Feb 14, 2010
    • Robert Haas's avatar
      Wrap calls to SearchSysCache and related functions using macros. · e26c539e
      Robert Haas authored
      The purpose of this change is to eliminate the need for every caller
      of SearchSysCache, SearchSysCacheCopy, SearchSysCacheExists,
      GetSysCacheOid, and SearchSysCacheList to know the maximum number
      of allowable keys for a syscache entry (currently 4).  This will
      make it far easier to increase the maximum number of keys in a
      future release should we choose to do so, and it makes the code
      shorter, too.
      
      Design and review by Tom Lane.
      e26c539e
  14. Feb 08, 2010
    • Tom Lane's avatar
      Create an official API function for C functions to use to check if they are · d5768dce
      Tom Lane authored
      being called as aggregates, and to get the aggregate transition state memory
      context if needed.  Use it instead of poking directly into AggState and
      WindowAggState in places that shouldn't know so much.
      
      We should have done this in 8.4, probably, but better late than never.
      
      Revised version of a patch by Hitoshi Harada.
      d5768dce
  15. Feb 07, 2010
    • Tom Lane's avatar
      Create a "relation mapping" infrastructure to support changing the relfilenodes · b9b8831a
      Tom Lane authored
      of shared or nailed system catalogs.  This has two key benefits:
      
      * The new CLUSTER-based VACUUM FULL can be applied safely to all catalogs.
      
      * We no longer have to use an unsafe reindex-in-place approach for reindexing
        shared catalogs.
      
      CLUSTER on nailed catalogs now works too, although I left it disabled on
      shared catalogs because the resulting pg_index.indisclustered update would
      only be visible in one database.
      
      Since reindexing shared system catalogs is now fully transactional and
      crash-safe, the former special cases in REINDEX behavior have been removed;
      shared catalogs are treated the same as non-shared.
      
      This commit does not do anything about the recently-discussed problem of
      deadlocks between VACUUM FULL/CLUSTER on a system catalog and other
      concurrent queries; will address that in a separate patch.  As a stopgap,
      parallel_schedule has been tweaked to run vacuum.sql by itself, to avoid
      such failures during the regression tests.
      b9b8831a
  16. Feb 05, 2010
  17. Feb 04, 2010
  18. Jan 24, 2010
  19. Jan 17, 2010
  20. Jan 11, 2010
  21. Jan 08, 2010
    • Itagaki Takahiro's avatar
      Add buffer access counters to pg_stat_statements. · 8964dbd5
      Itagaki Takahiro authored
      This uses the same infrastructure with EXPLAIN BUFFERS to support
      {shared|local}_blks_{hit|read|written} andtemp_blks_{read|written}
      columns in the pg_stat_statements view. The dumped file format
      also updated.
      
      Thanks to Robert Haas for the review.
      8964dbd5
  22. Jan 07, 2010
  23. Jan 06, 2010
  24. Jan 02, 2010
  25. Dec 29, 2009
    • Heikki Linnakangas's avatar
      Previous fix for temporary file management broke returning a set from · 84d723b6
      Heikki Linnakangas authored
      PL/pgSQL function within an exception handler. Make sure we use the right
      resource owner when we create the tuplestore to hold returned tuples.
      
      Simplify tuplestore API so that the caller doesn't need to be in the right
      memory context when calling tuplestore_put* functions. tuplestore.c
      automatically switches to the memory context used when the tuplestore was
      created. Tuplesort was already modified like this earlier. This patch also
      removes the now useless MemoryContextSwitch calls from callers.
      
      Report by Aleksei on pgsql-bugs on Dec 22 2009. Backpatch to 8.1, like
      the previous patch that broke this.
      84d723b6
  26. Dec 15, 2009
  27. Dec 14, 2009
  28. Dec 12, 2009
    • Robert Haas's avatar
      Export ExplainBeginOutput() and ExplainEndOutput() for auto_explain. · 02490d46
      Robert Haas authored
      Without these functions, anyone outside of explain.c can't actually use
      ExplainPrintPlan, because the ExplainState won't be initialized properly.
      The user-visible result of this was a crash when using auto_explain with
      the JSON output format.
      
      Report by Euler Taveira de Oliveira.  Analysis by Tom Lane.  Patch by me.
      02490d46
  29. Dec 11, 2009
    • Tom Lane's avatar
      Arrange to generate different random sequences in the different child · 6b45e3b7
      Tom Lane authored
      processes of a pgbench run, when we are using -j > 1 and are emulating
      threads via fork().  Otherwise the children all inherit the same random
      sequence state and produce the same random-number sequence.
      
      In the threaded case the different threads will share one RNG state, so
      they will produce different subsets of one sequence, which is maybe more
      correlated than a purist would like but will not be "the same".  So we
      leave that case alone.
      
      First noticed by Takahiro Itagaki, and is also part of the explanation
      for the pgbench misbehavior recently reported by Jaime Casanova.
      6b45e3b7
Loading