Skip to content
Snippets Groups Projects
  1. Apr 01, 2015
  2. Dec 18, 2014
    • Tom Lane's avatar
      Improve documentation about CASE and constant subexpressions. · 3dd740b3
      Tom Lane authored
      The possibility that constant subexpressions of a CASE might be evaluated
      at planning time was touched on in 9.17.1 (CASE expressions), but it really
      ought to be explained in 4.2.14 (Expression Evaluation Rules) which is the
      primary discussion of such topics.  Add text and an example there, and
      revise the <note> under CASE to link there.
      
      Back-patch to all supported branches, since it's acted like this for a
      long time (though 9.2+ is probably worse because of its more aggressive
      use of constant-folding via replanning of nominally-prepared statements).
      Pre-9.4, also back-patch text added in commit 0ce627d4 about CASE versus
      aggregate functions.
      
      Tom Lane and David Johnston, per discussion of bug #12273.
      3dd740b3
  3. Nov 06, 2013
    • Tom Lane's avatar
      Support default arguments and named-argument notation for window functions. · 74aea2af
      Tom Lane authored
      These things didn't work because the planner omitted to do the necessary
      preprocessing of a WindowFunc's argument list.  Add the few dozen lines
      of code needed to handle that.
      
      Although this sounds like a feature addition, it's really a bug fix because
      the default-argument case was likely to crash previously, due to lack of
      checking of the number of supplied arguments in the built-in window
      functions.  It's not a security issue because there's no way for a
      non-superuser to create a window function definition with defaults that
      refers to a built-in C function, but nonetheless people might be annoyed
      that it crashes rather than producing a useful error message.  So
      back-patch as far as the patch applies easily, which turns out to be 9.2.
      I'll put a band-aid in earlier versions as a separate patch.
      
      (Note that these features still don't work for aggregates, and fixing that
      case will be harder since we represent aggregate arg lists as target lists
      not bare expression lists.  There's no crash risk though because CREATE
      AGGREGATE doesn't accept defaults, and we reject named-argument notation
      when parsing an aggregate call.)
      74aea2af
    • Tom Lane's avatar
      Improve the error message given for modifying a window with frame clause. · 599942cf
      Tom Lane authored
      For rather inscrutable reasons, SQL:2008 disallows copying-and-modifying a
      window definition that has any explicit framing clause.  The error message
      we gave for this only made sense if the referencing window definition
      itself contains an explicit framing clause, which it might well not.
      Moreover, in the context of an OVER clause it's not exactly obvious that
      "OVER (windowname)" implies copy-and-modify while "OVER windowname" does
      not.  This has led to multiple complaints, eg bug #5199 from Iliya
      Krapchatov.  Change to a hopefully more intelligible error message, and
      in the case where we have just "OVER (windowname)", add a HINT suggesting
      that omitting the parentheses will fix it.  Also improve the related
      documentation.  Back-patch to all supported branches.
      599942cf
  4. Aug 28, 2012
    • Tom Lane's avatar
      Add section IDs to subsections of syntax.sgml that lacked them. · 60888e23
      Tom Lane authored
      This is so that these sections will have stable HTML tags that one can
      link to, rather than things like "AEN1902".  Perhaps we should mount a
      campaign to do this everywhere, but I've found myself pointing at
      syntax.sgml subsections often enough to be sure it's useful here.
      60888e23
  5. Oct 01, 2011
    • Tom Lane's avatar
      Improve generated column names for cases involving sub-SELECTs. · 5ec6b7f1
      Tom Lane authored
      We'll now use "exists" for EXISTS(SELECT ...), "array" for ARRAY(SELECT
      ...), or the sub-select's own result column name for a simple expression
      sub-select.  Previously, you usually got "?column?" in such cases.
      
      Marti Raudsepp, reviewed by Kyotaro Horiugchi
      5ec6b7f1
  6. Jul 14, 2011
  7. May 04, 2011
  8. Apr 08, 2011
    • Tom Lane's avatar
      Avoid extra whitespace in the arguments of <indexterm>. · dca30da3
      Tom Lane authored
      As noted by Thom Brown, this confuses the DocBook index processor; it
      fails to merge entries that differ only in whitespace, and sorts them
      unexpectedly as well.  Seems like a toolchain bug, but I'm not going to
      hold my breath waiting for a fix.
      
      Note: easiest way to find these is to look for double spaces in HTML.index.
      dca30da3
  9. Mar 20, 2011
  10. Mar 09, 2011
  11. Feb 20, 2011
  12. Feb 08, 2011
    • Peter Eisentraut's avatar
      Per-column collation support · 414c5a2e
      Peter Eisentraut authored
      This adds collation support for columns and domains, a COLLATE clause
      to override it per expression, and B-tree index support.
      
      Peter Eisentraut
      reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
      414c5a2e
  13. Feb 01, 2011
  14. Jan 29, 2011
  15. Nov 07, 2010
    • Tom Lane's avatar
      Prevent invoking I/O conversion casts via functional/attribute notation. · 543d22fc
      Tom Lane authored
      PG 8.4 added a built-in feature for casting pretty much any data type to
      string types (text, varchar, etc).  We allowed this to work in any of the
      historically-allowed syntaxes: CAST(x AS text), x::text, text(x), or
      x.text.  However, multiple complaints have shown that it's too easy to
      invoke such casts unintentionally in the latter two styles, particularly
      field selection.  To cure the problem with the narrowest possible change
      of behavior, disallow use of I/O conversion casts from composite types to
      string types via functional/attribute syntax.  The new functionality is
      still available via cast syntax.
      
      In passing, document the equivalence of functional and attribute syntax
      in a more visible place.
      543d22fc
  16. Oct 14, 2010
  17. Sep 20, 2010
  18. Sep 07, 2010
  19. Sep 01, 2010
  20. Aug 13, 2010
  21. Aug 12, 2010
  22. Aug 11, 2010
  23. Aug 05, 2010
    • Tom Lane's avatar
      Remove the single-argument form of string_agg(). It added nothing much in · b0c451e1
      Tom Lane authored
      functionality, while creating an ambiguity in usage with ORDER BY that at
      least two people have already gotten seriously confused by.  Also, add an
      opr_sanity test to check that we don't in future violate the newly minted
      policy of not having built-in aggregates with the same name and different
      numbers of parameters.  Per discussion of a complaint from Thom Brown.
      b0c451e1
  24. Aug 04, 2010
  25. Jul 20, 2010
  26. Jul 03, 2010
  27. Jun 09, 2010
  28. May 30, 2010
    • Tom Lane's avatar
      Change the notation for calling functions with named parameters from · b12b7a90
      Tom Lane authored
      "val AS name" to "name := val", as per recent discussion.
      
      This patch catches everything in the original named-parameters patch,
      but I'm not certain that no other dependencies snuck in later (grepping
      the source tree for all uses of AS soon proved unworkable).
      
      In passing I note that we've dropped the ball at least once on keeping
      ecpg's lexer (as opposed to parser) in sync with the backend.  It would
      be a good idea to go through all of pgc.l and see if it's in sync now.
      I didn't attempt that at the moment.
      b12b7a90
  29. May 27, 2010
  30. Apr 03, 2010
    • Peter Eisentraut's avatar
      Remove unnecessary xref endterm attributes and title ids · 6dcce398
      Peter Eisentraut authored
      The endterm attribute is mainly useful when the toolchain does not support
      automatic link target text generation for a particular situation.  In  the
      past, this was required by the man page tools for all reference page links,
      but that is no longer the case, and it now actually gets in the way of
      proper automatic link text generation.  The only remaining use cases are
      currently xrefs to refsects.
      6dcce398
  31. Feb 12, 2010
    • Tom Lane's avatar
      Extend the set of frame options supported for window functions. · ec4be2ee
      Tom Lane authored
      This patch allows the frame to start from CURRENT ROW (in either RANGE or
      ROWS mode), and it also adds support for ROWS n PRECEDING and ROWS n FOLLOWING
      start and end points.  (RANGE value PRECEDING/FOLLOWING isn't there yet ---
      the grammar works, but that's all.)
      
      Hitoshi Harada, reviewed by Pavel Stehule
      ec4be2ee
  32. Feb 04, 2010
  33. Feb 03, 2010
  34. Dec 15, 2009
    • Tom Lane's avatar
      Support ORDER BY within aggregate function calls, at long last providing a · 34d26872
      Tom Lane authored
      non-kluge method for controlling the order in which values are fed to an
      aggregate function.  At the same time eliminate the old implementation
      restriction that DISTINCT was only supported for single-argument aggregates.
      
      Possibly release-notable behavioral change: formerly, agg(DISTINCT x)
      dropped null values of x unconditionally.  Now, it does so only if the
      agg transition function is strict; otherwise nulls are treated as DISTINCT
      normally would, ie, you get one copy.
      
      Andrew Gierth, reviewed by Hitoshi Harada
      34d26872
  35. Nov 06, 2009
  36. Oct 08, 2009
  37. Sep 23, 2009
  38. Sep 22, 2009
  39. Aug 27, 2009
    • Tom Lane's avatar
      Modify the definition of window-function PARTITION BY and ORDER BY clauses · bb16dc49
      Tom Lane authored
      so that their elements are always taken as simple expressions over the
      query's input columns.  It originally seemed like a good idea to make them
      act exactly like GROUP BY and ORDER BY, right down to the SQL92-era behavior
      of accepting output column names or numbers.  However, that was not such a
      great idea, for two reasons:
      
      1. It permits circular references, as exhibited in bug #5018: the output
      column could be the one containing the window function itself.  (We actually
      had a regression test case illustrating this, but nobody thought twice about
      how confusing that would be.)
      
      2. It doesn't seem like a good idea for, eg, "lead(foo) OVER (ORDER BY foo)"
      to potentially use two completely different meanings for "foo".
      
      Accordingly, narrow down the behavior of window clauses to use only the
      SQL99-compliant interpretation that the expressions are simple expressions.
      bb16dc49
Loading