Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / include / parser / parsetree.h
blobb375da82118cc98a7f8ed9e34c92065dc2942ffe
1 /*-------------------------------------------------------------------------
3 * parsetree.h
4 * Routines to access various components and subcomponents of
5 * parse trees.
8 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * $PostgreSQL$
13 *-------------------------------------------------------------------------
15 #ifndef PARSETREE_H
16 #define PARSETREE_H
18 #include "nodes/parsenodes.h"
21 /* ----------------
22 * range table operations
23 * ----------------
27 * rt_fetch
29 * NB: this will crash and burn if handed an out-of-range RT index
31 #define rt_fetch(rangetable_index, rangetable) \
32 ((RangeTblEntry *) list_nth(rangetable, (rangetable_index)-1))
35 * getrelid
37 * Given the range index of a relation, return the corresponding
38 * relation OID. Note that InvalidOid will be returned if the
39 * RTE is for a non-relation-type RTE.
41 #define getrelid(rangeindex,rangetable) \
42 (rt_fetch(rangeindex, rangetable)->relid)
45 * Given an RTE and an attribute number, return the appropriate
46 * variable name or alias for that attribute of that RTE.
48 extern char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum);
51 * Given an RTE and an attribute number, return the appropriate
52 * type and typemod info for that attribute of that RTE.
54 extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
55 Oid *vartype, int32 *vartypmod);
58 * Check whether an attribute of an RTE has been dropped (note that
59 * get_rte_attribute_type will fail on such an attr)
61 extern bool get_rte_attribute_is_dropped(RangeTblEntry *rte,
62 AttrNumber attnum);
65 /* ----------------
66 * target list operations
67 * ----------------
70 extern TargetEntry *get_tle_by_resno(List *tlist, AttrNumber resno);
72 /* ----------------
73 * FOR UPDATE/SHARE info
74 * ----------------
77 extern RowMarkClause *get_rowmark(Query *qry, Index rtindex);
79 #endif /* PARSETREE_H */