aboutsummaryrefslogtreecommitdiff
path: root/src/include/parser/parsetree.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-08-11 20:46:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-08-11 20:46:47 +0000
commit88381ade63de931c84f53dc873c986d40b8c8b61 (patch)
tree1ec3c77e29b1d320718b64b38db10f8a8f0e0cd3 /src/include/parser/parsetree.h
parentcae912d05bfb354d81427c6ae5354eab90869fe9 (diff)
downloadpostgresql-88381ade63de931c84f53dc873c986d40b8c8b61.tar.gz
postgresql-88381ade63de931c84f53dc873c986d40b8c8b61.zip
Code cleanup inspired by recent resname bug report (doesn't fix the bug
yet, though). Avoid using nth() to fetch tlist entries; provide a common routine get_tle_by_resno() to search a tlist for a particular resno. This replaces a couple uses of nth() and a dozen hand-coded search loops. Also, replace a few uses of nth(length-1, list) with llast().
Diffstat (limited to 'src/include/parser/parsetree.h')
-rw-r--r--src/include/parser/parsetree.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/include/parser/parsetree.h b/src/include/parser/parsetree.h
index a172b25bd3e..d69acffeff3 100644
--- a/src/include/parser/parsetree.h
+++ b/src/include/parser/parsetree.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2003, 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 $
+ * $Id: parsetree.h,v 1.22 2003/08/11 20:46:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,7 +20,7 @@
/* ----------------
- * range table macros
+ * range table operations
* ----------------
*/
@@ -55,4 +55,12 @@ extern char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum);
extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
Oid *vartype, int32 *vartypmod);
+
+/* ----------------
+ * target list operations
+ * ----------------
+ */
+
+extern TargetEntry *get_tle_by_resno(List *tlist, AttrNumber resno);
+
#endif /* PARSETREE_H */