1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

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().
This commit is contained in:
Tom Lane
2003-08-11 20:46:47 +00:00
parent cae912d05b
commit 88381ade63
12 changed files with 161 additions and 316 deletions

View File

@@ -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 */