Skip to content
Snippets Groups Projects
  1. Aug 30, 2009
  2. Aug 27, 2009
  3. Aug 18, 2009
  4. Aug 10, 2009
  5. Aug 04, 2009
    • Tom Lane's avatar
      Support hex-string input and output for type BYTEA. · a2a8c7a6
      Tom Lane authored
      Both hex format and the traditional "escape" format are automatically
      handled on input.  The output format is selected by the new GUC variable
      bytea_output.
      
      As committed, bytea_output defaults to HEX, which is an *incompatible
      change*.  We will keep it this way for awhile for testing purposes, but
      should consider whether to switch to the more backwards-compatible
      default of ESCAPE before 8.5 is released.
      
      Peter Eisentraut
      a2a8c7a6
  6. Aug 03, 2009
    • Joe Conway's avatar
      Implement has_sequence_privilege() · be6bca23
      Joe Conway authored
      Add family of functions that did not exist earlier,
      mainly due to historical omission. Original patch by
      Abhijit Menon-Sen, with review and modifications by
      Joe Conway. catversion.h bumped.
      be6bca23
  7. Aug 01, 2009
  8. Jul 30, 2009
    • Tom Lane's avatar
      Fix time_part and timetz_part (ie, EXTRACT() for those datatypes) to · 78aef14c
      Tom Lane authored
      include a fractional part in the output for MILLISECOND and SECOND cases,
      rather than truncating the source value.  This is what the float-timestamp
      code has always done, and it was clearly the code author's intent to do
      the same for integer timestamps, but he forgot about integer division in C.
      The other datatypes supported by EXTRACT() already do this correctly.
      
      Backpatch to 8.4, so that the default (integer) behavior of that branch will
      match the default (float) behavior of older branches.  Arguably we should
      patch further back, but it's possible that applications are expecting the
      broken behavior in older branches.  8.4 is new enough that expectations
      shouldn't be too settled.
      
      Per report from Greg Stark.
      78aef14c
  9. Jul 29, 2009
    • Tom Lane's avatar
      Support deferrable uniqueness constraints. · 25d9bf2e
      Tom Lane authored
      The current implementation fires an AFTER ROW trigger for each tuple that
      looks like it might be non-unique according to the index contents at the
      time of insertion.  This works well as long as there aren't many conflicts,
      but won't scale to massive unique-key reassignments.  Improving that case
      is a TODO item.
      
      Dean Rasheed
      25d9bf2e
  10. Jul 28, 2009
  11. Jul 24, 2009
    • Tom Lane's avatar
      Assorted minor refactoring in EXPLAIN. · 8af12bca
      Tom Lane authored
      This is believed to not change the output at all, with one known exception:
      "Subquery Scan foo" becomes "Subquery Scan on foo".  (We can fix that if
      anyone complains, but it would be a wart, because the old code was clearly
      inconsistent.)  The main intention is to remove duplicate coding and
      provide a cleaner base for subsequent EXPLAIN patching.
      
      Robert Haas
      8af12bca
  12. Jul 23, 2009
    • Tom Lane's avatar
      In a non-hashed Agg node, reset the "aggcontext" at group boundaries, instead · 6a0865e4
      Tom Lane authored
      of individually pfree'ing pass-by-reference transition values.  This should
      be at least as fast as the prior coding, and it has the major advantage of
      clearing out any working data an aggregate function may have stored in or
      underneath the aggcontext.  This avoids memory leakage when an aggregate
      such as array_agg() is used in GROUP BY mode.  Per report from Chris Spotts.
      
      Back-patch to 8.4.  In principle the problem could arise in prior versions,
      but since they didn't have array_agg the issue seems not critical.
      6a0865e4
  13. Jul 16, 2009
    • Peter Eisentraut's avatar
      Make backend header files C++ safe · de160e2c
      Peter Eisentraut authored
      This alters various incidental uses of C++ key words to use other similar
      identifiers, so that a C++ compiler won't choke outright.  You still
      (probably) need extern "C" { }; around the inclusion of backend headers.
      
      based on a patch by Kurt Harriman <harriman@acm.org>
      
      Also add a script cpluspluscheck to check for C++ compatibility in the
      future.  As of right now, this passes without error for me.
      de160e2c
  14. Jul 14, 2009
    • Tom Lane's avatar
      Tweak the core scanner so that it can be used by plpgsql too. · 1aa58d3a
      Tom Lane authored
      Changes:
      
      Pass in the keyword lookup array instead of having it be hardwired.
      (This incidentally allows elimination of some duplicate coding in ecpg.)
      
      Re-order the token declarations in gram.y so that non-keyword tokens have
      numbers that won't change when keywords are added or removed.
      
      Add ".." and ":=" to the set of tokens recognized by scan.l.  (Since these
      combinations are nowhere legal in core SQL, this does not change anything
      except the precise wording of the error you get when you write this.)
      1aa58d3a
  15. Jul 12, 2009
    • Tom Lane's avatar
      Move some declarations in the raw-parser header files to create a clearer · 6566e37e
      Tom Lane authored
      distinction between the external API (parser.h) and declarations that only
      need to be visible within the raw parser code (gramparse.h, which now is only
      included by parser.c, gram.y, scan.l, and keywords.c).  This is in preparation
      for the upcoming change to a reentrant lexer, which will require referencing
      YYSTYPE in the declarations of base_yylex and filtered_base_yylex, hence
      gram.h will have to be included by gramparse.h.  We don't want any more files
      than absolutely necessary to depend on gram.h, so some cleanup is called for.
      6566e37e
  16. Jul 11, 2009
  17. Jul 06, 2009
  18. Jun 23, 2009
    • Tom Lane's avatar
      Fix an ancient error in dist_ps (distance from point to line segment), which · b087b018
      Tom Lane authored
      a number of other geometric operators also depend on.  It miscalculated the
      slope of the perpendicular to the given line segment anytime that slope was
      other than 0, infinite, or +/-1.  In some cases the error would be masked
      because the true closest point on the line segment was one of its endpoints
      rather than the intersection point, but in other cases it could give an
      arbitrarily bad answer.  Per bug #4872 from Nick Roosevelt.
      
      Bug goes clear back to Berkeley days, so patch all supported branches.
      Make a couple of cosmetic adjustments while at it.
      b087b018
  19. Jun 22, 2009
  20. Jun 21, 2009
  21. Jun 20, 2009
  22. Jun 11, 2009
  23. Jun 10, 2009
    • Tom Lane's avatar
      Fix cash_in() to behave properly in locales where frac_digits is zero, · 2ef8c1ac
      Tom Lane authored
      eg Japan.  Report and fix by Itagaki Takahiro.  Also fix CASHDEBUG printout
      format for branches with 64-bit money type, and some minor comment cleanup.
      
      Back-patch to 7.4, because it's broken all the way back.
      2ef8c1ac
    • Tom Lane's avatar
      Make handling of INTERVAL DAY TO MINUTE and INTERVAL DAY TO SECOND input · 5cca35a6
      Tom Lane authored
      more consistent with other cases, by having an unlabeled integer field
      be treated as a number of minutes or seconds respectively.  These cases
      are outside the spec (which insists on full "dd hh:mm" or "dd hh:mm:ss"
      input respectively), so it's not much help to us in deciding what to do.
      But with this change, it's uniformly the case that an unlabeled integer
      will be considered as being a number of the interval's rightmost field.
      The change also takes us back to the 8.3 behavior of throwing error
      for certain ambiguous inputs such as INTERVAL '1 2' DAY TO MINUTE.
      Per recent discussion.
      5cca35a6
    • Tom Lane's avatar
      Ensure xmlFree(NULL) is a no-op instead of a core dump. Per report from · 0dcc73fe
      Tom Lane authored
      Sergey Burladyan, there are at least some dank corners of libxml2 that
      assume this behavior, even though their published documentation suggests
      they shouldn't.
      
      This is only really a live problem in 8.3, but the code is still there
      for possible debugging use in HEAD, so patch both branches.
      0dcc73fe
    • Peter Eisentraut's avatar
      Fix xmlattribute escaping XML special characters twice (bug #4822). · 9b7304bc
      Peter Eisentraut authored
      Author: Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>
      9b7304bc
  24. Jun 09, 2009
  25. Jun 08, 2009
  26. Jun 02, 2009
    • Tom Lane's avatar
      Change AdjustIntervalForTypmod to not discard higher-order field values on the · bac2ad38
      Tom Lane authored
      grounds that they don't fit into the specified interval qualifier (typmod).
      This behavior, while of long standing, is clearly wrong per spec --- for
      example the value INTERVAL '999' SECOND means 999 seconds and should not be
      reduced to less than 60 seconds.
      
      In some cases there could be grounds to raise an error if higher-order field
      values are not given as zero; for example '1 year 1 month'::INTERVAL MONTH
      should arguably be taken as an error rather than equivalent to 13 months.
      However our internal representation doesn't allow us to do that in a fashion
      that would consistently reject all and only the cases that a strict reading
      of the spec would suggest.  Also, seeing that for example INTERVAL '13' MONTH
      will print out as '1 year 1 mon', we have to be careful not to create a
      situation where valid data will fail to dump and reload.  The present patch
      therefore takes the attitude of not throwing an error in any such case.
      We might want to revisit that in future but it would take more redesign
      than seems prudent in late beta.
      
      Per a complaint from Sebastien Flaesch and subsequent discussion.  While
      at other times we might have just postponed such an issue to the next
      development cycle, 8.4 already has changed the parsing of interval literals
      quite a bit in an effort to accept all spec-compliant cases correctly.
      This seems like a change that should be part of that rather than coming
      along later.
      bac2ad38
  27. Jun 01, 2009
    • Tom Lane's avatar
      Fix DecodeInterval to report an error for multiple occurrences of DAY, WEEK, · b3b89fd1
      Tom Lane authored
      YEAR, DECADE, CENTURY, or MILLENIUM fields, just as it always has done for
      other types of fields.  The previous behavior seems to have been a hack to
      avoid defining bit-positions for all these field types in DTK_M() masks,
      rather than something that was really considered to be desired behavior.
      But there is room in the masks for these, and we really need to tighten up
      at least the behavior of DAY and YEAR fields to avoid unexpected behavior
      associated with the 8.4 changes to interpret ambiguous fields based on the
      interval qualifier (typmod) value.  Per my example and proposed patch.
      b3b89fd1
  28. May 27, 2009
  29. May 26, 2009
Loading