OSDN Git Service

Re-implement EvalPlanQual processing to improve its performance and eliminate
[pg-rex/syncrep.git] / src / include / parser / parsetree.h
index a172b25..2399dcc 100644 (file)
@@ -5,10 +5,10 @@
  *       parse trees.
  *
  *
- * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: parsetree.h,v 1.21 2003/08/04 02:40:14 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/parser/parsetree.h,v 1.38 2009/10/26 02:26:45 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 #define PARSETREE_H
 
 #include "nodes/parsenodes.h"
-#include "nodes/pg_list.h"             /* for nth(), etc */
 
 
 /* ----------------
- *             range table macros
+ *             range table operations
  * ----------------
  */
 
@@ -30,7 +29,7 @@
  * NB: this will crash and burn if handed an out-of-range RT index
  */
 #define rt_fetch(rangetable_index, rangetable) \
-       ((RangeTblEntry *) nth((rangetable_index)-1, rangetable))
+       ((RangeTblEntry *) list_nth(rangetable, (rangetable_index)-1))
 
 /*
  *             getrelid
@@ -55,4 +54,26 @@ extern char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum);
 extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
                                           Oid *vartype, int32 *vartypmod);
 
+/*
+ * Check whether an attribute of an RTE has been dropped (note that
+ * get_rte_attribute_type will fail on such an attr)
+ */
+extern bool get_rte_attribute_is_dropped(RangeTblEntry *rte,
+                                                        AttrNumber attnum);
+
+
+/* ----------------
+ *             target list operations
+ * ----------------
+ */
+
+extern TargetEntry *get_tle_by_resno(List *tlist, AttrNumber resno);
+
+/* ----------------
+ *             FOR UPDATE/SHARE info
+ * ----------------
+ */
+
+extern RowMarkClause *get_parse_rowmark(Query *qry, Index rtindex);
+
 #endif   /* PARSETREE_H */