1. 25 Nov, 2003 2 commits
  2. 18 Oct, 2003 1 commit
  3. 08 Aug, 2003 1 commit
  4. 04 Aug, 2003 2 commits
  5. 25 Jul, 2003 1 commit
  6. 25 Jun, 2003 1 commit
  7. 24 Jun, 2003 1 commit
  8. 06 Jun, 2003 1 commit
    • Tom Lane's avatar
      Implement outer-level aggregates to conform to the SQL spec, with · e649796f
      Tom Lane authored
      extensions to support our historical behavior.  An aggregate belongs
      to the closest query level of any of the variables in its argument,
      or the current query level if there are no variables (e.g., COUNT(*)).
      The implementation involves adding an agglevelsup field to Aggref,
      and treating outer aggregates like outer variables at planning time.
      e649796f
  9. 29 Apr, 2003 1 commit
    • Tom Lane's avatar
      Infrastructure for deducing Param types from context, in the same way · aa282d44
      Tom Lane authored
      that the types of untyped string-literal constants are deduced (ie,
      when coerce_type is applied to 'em, that's what the type must be).
      Remove the ancient hack of storing the input Param-types array as a
      global variable, and put the info into ParseState instead.  This touches
      a lot of files because of adjustment of routine parameter lists, but
      it's really not a large patch.  Note: PREPARE statement still insists on
      exact specification of parameter types, but that could easily be relaxed
      now, if we wanted to do so.
      aa282d44
  10. 08 Apr, 2003 1 commit
  11. 10 Mar, 2003 1 commit
    • Tom Lane's avatar
      Restructure parsetree representation of DECLARE CURSOR: now it's a · aa83bc04
      Tom Lane authored
      utility statement (DeclareCursorStmt) with a SELECT query dangling from
      it, rather than a SELECT query with a few unusual fields in it.  Add
      code to determine whether a planned query can safely be run backwards.
      If DECLARE CURSOR specifies SCROLL, ensure that the plan can be run
      backwards by adding a Materialize plan node if it can't.  Without SCROLL,
      you get an error if you try to fetch backwards from a cursor that can't
      handle it.  (There is still some discussion about what the exact
      behavior should be, but this is necessary infrastructure in any case.)
      Along the way, make EXPLAIN DECLARE CURSOR work.
      aa83bc04
  12. 09 Feb, 2003 2 commits
  13. 08 Feb, 2003 1 commit
  14. 28 Jan, 2003 1 commit
  15. 20 Jan, 2003 1 commit
    • Tom Lane's avatar
      IN clauses appearing at top level of WHERE can now be handled as joins. · bdfbfde1
      Tom Lane authored
      There are two implementation techniques: the executor understands a new
      JOIN_IN jointype, which emits at most one matching row per left-hand row,
      or the result of the IN's sub-select can be fed through a DISTINCT filter
      and then joined as an ordinary relation.
      Along the way, some minor code cleanup in the optimizer; notably, break
      out most of the jointree-rearrangement preprocessing in planner.c and
      put it in a new file prep/prepjointree.c.
      bdfbfde1
  16. 17 Jan, 2003 1 commit
  17. 13 Jan, 2003 2 commits
  18. 12 Jan, 2003 1 commit
  19. 10 Jan, 2003 1 commit
  20. 09 Jan, 2003 1 commit
    • Tom Lane's avatar
      Adjust parser so that 'x NOT IN (subselect)' is converted to · 6bc61fc0
      Tom Lane authored
      'NOT (x IN (subselect))', that is 'NOT (x = ANY (subselect))',
      rather than 'x <> ALL (subselect)' as we formerly did.  This
      opens the door to optimizing NOT IN the same way as IN, whereas
      there's no hope of optimizing the expression using <>.  Also,
      convert 'x <> ALL (subselect)' to the NOT(IN) style, so that
      the optimization will be available when processing rules dumped
      by older Postgres versions.
      initdb forced due to small change in SubLink node representation.
      6bc61fc0
  21. 14 Dec, 2002 1 commit
    • Tom Lane's avatar
      Clean up plantree representation of SubPlan-s --- SubLink does not appear · 2d8d6662
      Tom Lane authored
      in the planned representation of a subplan at all any more, only SubPlan.
      This means subselect.c doesn't scribble on its input anymore, which seems
      like a good thing; and there are no longer three different possible
      interpretations of a SubLink.  Simplify node naming and improve comments
      in primnodes.h.  No change to stored rules, though.
      2d8d6662
  22. 12 Dec, 2002 1 commit
    • Tom Lane's avatar
      Phase 2 of read-only-plans project: restructure expression-tree nodes · a0bf885f
      Tom Lane authored
      so that all executable expression nodes inherit from a common supertype
      Expr.  This is somewhat of an exercise in code purity rather than any
      real functional advance, but getting rid of the extra Oper or Func node
      formerly used in each operator or function call should provide at least
      a little space and speed improvement.
      initdb forced by changes in stored-rules representation.
      a0bf885f
  23. 05 Dec, 2002 1 commit
    • Tom Lane's avatar
      Phase 1 of read-only-plans project: cause executor state nodes to point · 1fd0c59e
      Tom Lane authored
      to plan nodes, not vice-versa.  All executor state nodes now inherit from
      struct PlanState.  Copying of plan trees has been simplified by not
      storing a list of SubPlans in Plan nodes (eliminating duplicate links).
      The executor still needs such a list, but it can build it during
      ExecutorStart since it has to scan the plan tree anyway.
      No initdb forced since no stored-on-disk structures changed, but you
      will need a full recompile because of node-numbering changes.
      1fd0c59e
  24. 30 Nov, 2002 2 commits
  25. 26 Nov, 2002 1 commit
  26. 04 Sep, 2002 1 commit
  27. 20 Jun, 2002 1 commit
  28. 18 May, 2002 1 commit
    • Tom Lane's avatar
      Teach query_tree_walker, query_tree_mutator, and SS_finalize_plan to · a5b37094
      Tom Lane authored
      process function RTE expressions, which they were previously missing.
      This allows outer-Var references and subselects to work correctly in
      the arguments of a function RTE.  Install check to prevent function RTEs
      from cross-referencing Vars of sibling FROM-items, which doesn't make
      any sense (if you want to join, write a JOIN or WHERE clause).
      a5b37094
  29. 12 May, 2002 1 commit
  30. 16 Apr, 2002 1 commit
    • Tom Lane's avatar
      Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR take · 6cef5d25
      Tom Lane authored
      qualified operator names directly, for example CREATE OPERATOR myschema.+
      ( ... ).  To qualify an operator name in an expression you need to write
      OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch).
      I also took advantage of having to reformat pg_operator to fix something
      that'd been bugging me for a while: mergejoinable operators should have
      explicit links to the associated cross-data-type comparison operators,
      rather than hardwiring an assumption that they are named < and >.
      6cef5d25
  31. 30 Nov, 2001 1 commit
  32. 22 Mar, 2001 1 commit
  33. 24 Jan, 2001 1 commit
  34. 09 Jan, 2001 1 commit
    • Tom Lane's avatar
      Fix oversight in planning of GROUP queries: when an expression is used · 07c741e6
      Tom Lane authored
      as both a GROUP BY item and an output expression, the top-level Group
      node should just copy up the evaluated expression value from its input,
      rather than re-evaluating the expression.  Aside from any performance
      benefit this might offer, this avoids a crash when there is a sub-SELECT
      in said expression.
      07c741e6
  35. 21 Nov, 2000 1 commit