1. 22 Oct, 2008 1 commit
  2. 21 Oct, 2008 4 commits
    • Tom Lane's avatar
      Add a concept of "placeholder" variables to the planner. These are variables · e6ae3b5d
      Tom Lane authored
      that represent some expression that we desire to compute below the top level
      of the plan, and then let that value "bubble up" as though it were a plain
      Var (ie, a column value).
      
      The immediate application is to allow sub-selects to be flattened even when
      they are below an outer join and have non-nullable output expressions.
      Formerly we couldn't flatten because such an expression wouldn't properly
      go to NULL when evaluated above the outer join.  Now, we wrap it in a
      PlaceHolderVar and arrange for the actual evaluation to occur below the outer
      join.  When the resulting Var bubbles up through the join, it will be set to
      NULL if necessary, yielding the correct results.  This fixes a planner
      limitation that's existed since 7.1.
      
      In future we might want to use this mechanism to re-introduce some form of
      Hellerstein's "expensive functions" optimization, ie place the evaluation of
      an expensive function at the most suitable point in the plan tree.
      e6ae3b5d
    • Peter Eisentraut's avatar
      Clean regression.out · 831abae5
      Peter Eisentraut authored
      831abae5
    • Peter Eisentraut's avatar
      Use format_type_be() instead of TypeNameToString() for some more user-facing · d1b02e76
      Peter Eisentraut authored
      error messages where the type existence is established.
      d1b02e76
    • Peter Eisentraut's avatar
      Allow SQL:2008 syntax ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE · 1471e384
      Peter Eisentraut authored
      alongside our traditional syntax.
      1471e384
  3. 20 Oct, 2008 10 commits
  4. 18 Oct, 2008 3 commits
  5. 17 Oct, 2008 8 commits
  6. 16 Oct, 2008 3 commits
    • Neil Conway's avatar
      Fix a small memory leak in ExecReScanAgg() in the hashed aggregation case. · e034e517
      Neil Conway authored
      In the previous coding, the list of columns that needed to be hashed on
      was allocated in the per-query context, but we reallocated every time
      the Agg node was rescanned. Since this information doesn't change over
      a rescan, just construct the list of columns once during ExecInitAgg().
      e034e517
    • Tom Lane's avatar
      Reduce chatter from _dosmaperr() when used in FRONTEND code. · 0e3d5ad4
      Tom Lane authored
      ITAGAKI Takahiro
      0e3d5ad4
    • Tom Lane's avatar
      Fix SPI_getvalue and SPI_getbinval to range-check the given attribute number · bcf188a2
      Tom Lane authored
      according to the TupleDesc's natts, not the number of physical columns in the
      tuple.  The previous coding would do the wrong thing in cases where natts is
      different from the tuple's column count: either incorrectly report error when
      it should just treat the column as null, or actually crash due to indexing off
      the end of the TupleDesc's attribute array.  (The second case is probably not
      possible in modern PG versions, due to more careful handling of inheritance
      cases than we once had.  But it's still a clear lack of robustness here.)
      
      The incorrect error indication is ignored by all callers within the core PG
      distribution, so this bug has no symptoms visible within the core code, but
      it might well be an issue for add-on packages.  So patch all the way back.
      bcf188a2
  7. 14 Oct, 2008 10 commits
  8. 13 Oct, 2008 1 commit
    • Tom Lane's avatar
      Implement comparison of generic records (composite types), and invent a · e3b01174
      Tom Lane authored
      pseudo-type record[] to represent arrays of possibly-anonymous composite
      types.  Since composite datums carry their own type identification, no
      extra knowledge is needed at the array level.
      
      The main reason for doing this right now is that it is necessary to support
      the general case of detection of cycles in recursive queries: if you need to
      compare more than one column to detect a cycle, you need to compare a ROW()
      to an array built from ROW()s, at least if you want to do it as the spec
      suggests.  Add some documentation and regression tests concerning the cycle
      detection issue.
      e3b01174