1. 20 Feb, 2012 1 commit
    • Tom Lane's avatar
      Add caching of ctype.h/wctype.h results in regc_locale.c. · e00f68e4
      Tom Lane authored
      While this doesn't save a huge amount of runtime, it still seems worth
      doing, especially since I realized that the data copying I did in my first
      draft was quite unnecessary.  In this version, once we have the results
      cached, getting them back for re-use is really very cheap.
      
      Also, remove the hard-wired limitation to not consider wctype.h results for
      character codes above 255.  It turns out that we can't push the limit as
      far up as I'd originally hoped, because the regex colormap code is not
      efficient enough to cope very well with character classes containing many
      thousand letters, which a Unicode locale is entirely capable of producing.
      Still, we can push it up to U+7FF (which I chose as the limit of 2-byte
      UTF8 characters), which will at least make Eastern Europeans happy pending
      a better solution.  Thus, this commit resolves the specific complaint in
      bug #6457, but not the more general issue that letters of non-western
      alphabets are mostly not recognized as matching [[:alpha:]].
      e00f68e4
  2. 19 Feb, 2012 3 commits
  3. 18 Feb, 2012 5 commits
  4. 17 Feb, 2012 1 commit
    • Tom Lane's avatar
      Fix longstanding error in contrib/intarray's int[] & int[] operator. · 06d9afa6
      Tom Lane authored
      The array intersection code would give wrong results if the first entry of
      the correct output array would be "1".  (I think only this value could be
      at risk, since the previous word would always be a lower-bound entry with
      that fixed value.)
      
      Problem spotted by Julien Rouhaud, initial patch by Guillaume Lelarge,
      cosmetic improvements by me.
      06d9afa6
  5. 16 Feb, 2012 5 commits
    • Tom Lane's avatar
      Improve statistics estimation to make some use of DISTINCT in sub-queries. · 4767bc8f
      Tom Lane authored
      Formerly, we just punted when trying to estimate stats for variables coming
      out of sub-queries using DISTINCT, on the grounds that whatever stats we
      might have for underlying table columns would be inapplicable.  But if the
      sub-query has only one DISTINCT column, we can consider its output variable
      as being unique, which is useful information all by itself.  The scope of
      this improvement is pretty narrow, but it costs nearly nothing, so we might
      as well do it.  Per discussion with Andres Freund.
      
      This patch differs from the draft I submitted yesterday in updating various
      comments about vardata.isunique (to reflect its extended meaning) and in
      tweaking the interaction with security_barrier views.  There does not seem
      to be a reason why we can't use this sort of knowledge even when the
      sub-query is such a view.
      4767bc8f
    • Robert Haas's avatar
      pg_dump: Miscellaneous tightening based on recent refactorings. · 1cc1b91d
      Robert Haas authored
      Use exit_horribly() and ExecuteSqlQueryForSingleRow() in various
      places where it's equivalent, or nearly equivalent, to the prior
      coding. Apart from being more compact, this also makes the error
      messages for the wrong-number-of-tuples case more consistent.
      1cc1b91d
    • Robert Haas's avatar
      pg_dump: Remove global connection pointer. · 689d0eb7
      Robert Haas authored
      Parallel pg_dump wants to have multiple ArchiveHandle objects, and
      therefore multiple PGconns, in play at the same time.  This should
      be just about the end of the refactoring that we need in order to
      make that workable.
      689d0eb7
    • Robert Haas's avatar
      Refactor pg_dump.c to avoid duplicating returns-one-row check. · 549e93c9
      Robert Haas authored
      Any patches apt to get broken have probably already been broken by the
      error-handling cleanups I just did, so we might as well clean this up
      at the same time.
      549e93c9
    • Robert Haas's avatar
      Invent on_exit_nicely for pg_dump. · e9a22259
      Robert Haas authored
      Per recent discussions on pgsql-hackers regarding parallel pg_dump.
      e9a22259
  6. 15 Feb, 2012 10 commits
  7. 14 Feb, 2012 9 commits
  8. 13 Feb, 2012 4 commits
  9. 11 Feb, 2012 1 commit
    • Tom Lane's avatar
      Fix I/O-conversion-related memory leaks in plpgsql. · 58a9596e
      Tom Lane authored
      Datatype I/O functions are allowed to leak memory in CurrentMemoryContext,
      since they are generally called in short-lived contexts.  However, plpgsql
      calls such functions for purposes of type conversion, and was calling them
      in its procedure context.  Therefore, any leaked memory would not be
      recovered until the end of the plpgsql function.  If such a conversion
      was done within a loop, quite a bit of memory could get consumed.  Fix by
      calling such functions in the transient "eval_econtext", and adjust other
      logic to match.  Back-patch to all supported versions.
      
      Andres Freund, Jan Urbański, Tom Lane
      58a9596e
  10. 10 Feb, 2012 1 commit