1. 23 Feb, 2010 2 commits
  2. 16 Feb, 2010 1 commit
  3. 02 Jan, 2010 1 commit
  4. 10 Aug, 2009 2 commits
  5. 06 Jul, 2009 1 commit
  6. 22 Jun, 2009 1 commit
    • Tom Lane's avatar
      Make to_timestamp and friends skip leading spaces before an integer field, · 3f1e529e
      Tom Lane authored
      even when not in FM mode.  This improves compatibility with Oracle and with
      our pre-8.4 behavior, as per bug #4862.
      
      Brendan Jurd
      
      Add a couple of regression test cases for this.  In passing, get rid of the
      labeling of the individual test cases; doesn't seem to be good for anything
      except causing extra work when inserting a test...
      
      Tom Lane
      3f1e529e
  7. 11 Jun, 2009 1 commit
  8. 15 Mar, 2009 1 commit
    • Tom Lane's avatar
      Clean up the code for to_timestamp's conversion of year plus ISO day number · 7a52a8f8
      Tom Lane authored
      to date, as per bug #4702 and subsequent discussion.  In particular, make it
      work for years specified using AD/BC or CC fields, and fix the test for "no
      year specified" so that it doesn't trigger inappropriately for 1 BC (which it
      was doing even in code paths that had nothing to do with to_timestamp).  I
      also did some minor code beautification in the non-ISO-day-number code path.
      
      This area has been busted all along, but because the code has been rewritten
      repeatedly, it would be considerable trouble to back-patch.  It's such a
      corner case that it doesn't seem worth the effort.
      7a52a8f8
  9. 12 Mar, 2009 1 commit
    • Tom Lane's avatar
      Fix core dump due to null-pointer dereference in to_char() when datetime · 2cdec8b3
      Tom Lane authored
      format codes are misapplied to a numeric argument.  (The code still produces
      a pretty bogus error message in such cases, but I'll settle for stopping the
      crash for now.)  Per bug #4700 from Sergey Burladyan.
      
      Problem exists in all supported branches, so patch all the way back.
      In HEAD, also clean up some ugly coding in the nearby cache management
      code.
      2cdec8b3
  10. 07 Feb, 2009 1 commit
  11. 01 Jan, 2009 1 commit
  12. 15 Dec, 2008 1 commit
    • Tom Lane's avatar
      Remove our dependencies on MB_CUR_MAX in favor of believing that · b4d64a6d
      Tom Lane authored
      pg_database_encoding_max_length() predicts the maximum character length
      returned by wchar2char().  Per Hiroshi Inoue, MB_CUR_MAX isn't usable on
      Windows because we allow encoding = UTF8 when the locale says differently;
      and getting rid of it seems a good idea on general principles because it
      narrows our dependence on libc's locale API just a little bit more.
      
      Also install a check for overflow of the buffer size computation.
      b4d64a6d
  13. 01 Dec, 2008 1 commit
  14. 10 Nov, 2008 1 commit
  15. 06 Oct, 2008 1 commit
  16. 26 Sep, 2008 1 commit
  17. 11 Sep, 2008 1 commit
  18. 22 Aug, 2008 1 commit
    • Bruce Momjian's avatar
      Minor patch on pgbench · 6152de97
      Bruce Momjian authored
      1. -i option should run vacuum analyze only on pgbench tables, not *all*
      tables in database.
      
      2. pre-run cleanup step was DELETE FROM HISTORY then VACUUM HISTORY.
      This is just a slow version of TRUNCATE HISTORY.
      
      Simon Riggs
      6152de97
  19. 12 Jul, 2008 1 commit
    • Tom Lane's avatar
      Const-ify the arguments of str_tolower() and friends to suppress compile · 960af47e
      Tom Lane authored
      warnings.  Clean up various unneeded cruft that was left behind after
      creating those routines.  Introduce some convenience functions str_tolower_z
      etc to eliminate tedious and error-prone double arguments in formatting.c.
      (Currently there seems no need to export the latter, but maybe reconsider
      this later.)
      960af47e
  20. 26 Jun, 2008 1 commit
  21. 23 Jun, 2008 1 commit
  22. 17 Jun, 2008 1 commit
  23. 20 May, 2008 1 commit
  24. 19 May, 2008 1 commit
  25. 25 Mar, 2008 1 commit
    • 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
  26. 22 Mar, 2008 1 commit
  27. 01 Jan, 2008 1 commit
  28. 22 Nov, 2007 2 commits
  29. 21 Nov, 2007 2 commits
  30. 15 Nov, 2007 1 commit
  31. 04 Aug, 2007 1 commit
    • Tom Lane's avatar
      Switch over to using the src/timezone functions for formatting timestamps · bdd6b622
      Tom Lane authored
      displayed in the postmaster log.  This avoids Windows-specific problems with
      localized time zone names that are in the wrong encoding, and generally seems
      like a good idea to forestall other potential platform-dependent issues.
      To preserve the existing behavior that all backends will log in the same time
      zone, create a new GUC variable log_timezone that can only be changed on a
      system-wide basis, and reference log-related calculations to that zone instead
      of the TimeZone variable.
      
      This fixes the issue reported by Hiroshi Saito that timestamps printed by
      xlog.c startup could be improperly localized on Windows.  We still need a
      simpler patch for that problem in the back branches, however.
      bdd6b622
  32. 29 Jun, 2007 1 commit
    • Tom Lane's avatar
      Fix a passel of ancient bugs in to_char(), including two distinct buffer · 6faf7956
      Tom Lane authored
      overruns (neither of which seem likely to be exploitable as security holes,
      fortunately, since the provoker can't control the data written).  One of
      these is due to choosing to stomp on the output of a called function, which
      is bad news in any case; make it treat the called functions' results as
      read-only.  Avoid some unnecessary palloc/pfree traffic too; it's not
      really helpful to free small temporary objects, and again this is presuming
      more than it ought to about the nature of the results of called functions.
      Per report from Patrick Welche and additional code-reading by Imad.
      6faf7956
  33. 27 Feb, 2007 1 commit
    • Tom Lane's avatar
      Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). · 234a02b2
      Tom Lane authored
      Get rid of VARATT_SIZE and VARATT_DATA, which were simply redundant with
      VARSIZE and VARDATA, and as a consequence almost no code was using the
      longer names.  Rename the length fields of struct varlena and various
      derived structures to catch anyplace that was accessing them directly;
      and clean up various places so caught.  In itself this patch doesn't
      change any behavior at all, but it is necessary infrastructure if we hope
      to play any games with the representation of varlena headers.
      Greg Stark and Tom Lane
      234a02b2
  34. 17 Feb, 2007 2 commits
  35. 16 Feb, 2007 1 commit