~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/backend/optimizer/plan/setrefs.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-01 17:41:41 UTC
  • mfrom: (1.1.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20090701174141-jfmn9tt8e69m950x
Tags: 8.4.0-1
* Final 8.4.0 release. Major enhancements:
  - Windowing Functions
  - Common Table Expressions and Recursive Queries
  - Default and variadic parameters for functions
  - Parallel Restore
  - Column Permissions
  - Per-database locale settings
  - Improved hash indexes
  - Improved join performance for EXISTS and NOT EXISTS queries
  - Easier-to-use Warm Standby
  - Automatic sizing of the Free Space Map
  - Visibility Map (greatly reduces vacuum overhead for slowly-changing
    tables)
  - Version-aware psql (backslash commands work against older servers)
  - Support SSL certificates for user authentication
  - Per-function runtime statistics
  - Easy editing of functions in psql
  - New contrib modules: pg_stat_statements, auto_explain, citext,
    btree_gin 
  Upload to unstable, 8.4 is the new default. 
* debian/control: Build the versionless metapackages and have them point to
  8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 *
10
10
 *
11
11
 * IDENTIFICATION
12
 
 *        $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.149 2009/01/22 20:16:04 tgl Exp $
 
12
 *        $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.150 2009/06/11 14:48:59 momjian Exp $
13
13
 *
14
14
 *-------------------------------------------------------------------------
15
15
 */
116
116
                                           fix_upper_expr_context *context);
117
117
static bool fix_opfuncids_walker(Node *node, void *context);
118
118
static bool extract_query_dependencies_walker(Node *node,
119
 
                                                                                          PlannerGlobal *context);
 
119
                                                                  PlannerGlobal *context);
120
120
 
121
121
 
122
122
/*****************************************************************************
349
349
                        break;
350
350
                case T_CteScan:
351
351
                        {
352
 
                                CteScan *splan = (CteScan *) plan;
 
352
                                CteScan    *splan = (CteScan *) plan;
353
353
 
354
354
                                splan->scan.scanrelid += rtoffset;
355
355
                                splan->scan.plan.targetlist =
713
713
        {
714
714
                set_sa_opfuncid((ScalarArrayOpExpr *) node);
715
715
                record_plan_function_dependency(glob,
716
 
                                                                                ((ScalarArrayOpExpr *) node)->opfuncid);
 
716
                                                                         ((ScalarArrayOpExpr *) node)->opfuncid);
717
717
        }
718
718
        else if (IsA(node, ArrayCoerceExpr))
719
719
        {
720
720
                if (OidIsValid(((ArrayCoerceExpr *) node)->elemfuncid))
721
721
                        record_plan_function_dependency(glob,
722
 
                                                                                        ((ArrayCoerceExpr *) node)->elemfuncid);
 
722
                                                                         ((ArrayCoerceExpr *) node)->elemfuncid);
723
723
        }
724
724
        else if (IsA(node, Const))
725
725
        {
759
759
                 * If rtoffset == 0, we don't need to change any Vars, and if there
760
760
                 * are no placeholders anywhere we won't need to remove them.  Then
761
761
                 * it's OK to just scribble on the input node tree instead of copying
762
 
                 * (since the only change, filling in any unset opfuncid fields,
763
 
                 * is harmless).  This saves just enough cycles to be noticeable on
 
762
                 * (since the only change, filling in any unset opfuncid fields, is
 
763
                 * harmless).  This saves just enough cycles to be noticeable on
764
764
                 * trivial queries.
765
765
                 */
766
766
                (void) fix_scan_expr_walker(node, &context);
1633
1633
         * entries, while leaving result-rel Vars as-is.
1634
1634
         *
1635
1635
         * PlaceHolderVars will also be sought in the targetlist, but no
1636
 
         * more-complex expressions will be.  Note that it is not possible for
1637
 
         * a PlaceHolderVar to refer to the result relation, since the result
1638
 
         * is never below an outer join.  If that case could happen, we'd have
1639
 
         * to be prepared to pick apart the PlaceHolderVar and evaluate its
1640
 
         * contained expression instead.
 
1636
         * more-complex expressions will be.  Note that it is not possible for a
 
1637
         * PlaceHolderVar to refer to the result relation, since the result is
 
1638
         * never below an outer join.  If that case could happen, we'd have to be
 
1639
         * prepared to pick apart the PlaceHolderVar and evaluate its contained
 
1640
         * expression instead.
1641
1641
         */
1642
1642
        itlist = build_tlist_index_other_vars(topplan->targetlist, resultRelation);
1643
1643
 
1734
1734
         * we just assume they'll never change (or at least not in ways that'd
1735
1735
         * invalidate plans using them).  For this purpose we can consider a
1736
1736
         * built-in function to be one with OID less than FirstBootstrapObjectId.
1737
 
         * Note that the OID generator guarantees never to generate such an
1738
 
         * OID after startup, even at OID wraparound.
 
1737
         * Note that the OID generator guarantees never to generate such an OID
 
1738
         * after startup, even at OID wraparound.
1739
1739
         */
1740
1740
        if (funcid >= (Oid) FirstBootstrapObjectId)
1741
1741
        {