|
3 | 3 | * back to source text
|
4 | 4 | *
|
5 | 5 | * IDENTIFICATION
|
6 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.62 2000/09/18 20:14:23 tgl Exp $ |
| 6 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.63 2000/09/25 18:14:54 tgl Exp $ |
7 | 7 | *
|
8 | 8 | * This software is copyrighted by Jan Wieck - Hamburg.
|
9 | 9 | *
|
@@ -110,7 +110,6 @@ static bool tleIsArrayAssign(TargetEntry *tle);
|
110 | 110 | static char *quote_identifier(char *ident);
|
111 | 111 | static char *get_relation_name(Oid relid);
|
112 | 112 | static char *get_relid_attribute_name(Oid relid, AttrNumber attnum);
|
113 |
| -static char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum); |
114 | 113 |
|
115 | 114 | #define only_marker(rte) ((rte)->inh ? "" : "ONLY ")
|
116 | 115 |
|
@@ -2020,33 +2019,3 @@ get_relid_attribute_name(Oid relid, AttrNumber attnum)
|
2020 | 2019 | attnum, relid);
|
2021 | 2020 | return attname;
|
2022 | 2021 | }
|
2023 |
| - |
2024 |
| -/* ---------- |
2025 |
| - * get_rte_attribute_name |
2026 |
| - * Get an attribute name from a RangeTblEntry |
2027 |
| - * |
2028 |
| - * This is unlike get_relid_attribute_name() because we use aliases if |
2029 |
| - * available. |
2030 |
| - * ---------- |
2031 |
| - */ |
2032 |
| -static char * |
2033 |
| -get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum) |
2034 |
| -{ |
2035 |
| - /* |
2036 |
| - * If there is an alias, use it |
2037 |
| - */ |
2038 |
| - if (attnum > 0 && attnum <= length(rte->eref->attrs)) |
2039 |
| - return strVal(nth(attnum-1, rte->eref->attrs)); |
2040 |
| - /* |
2041 |
| - * Can get here for a system attribute (which never has an alias), |
2042 |
| - * or if alias name list is too short (which probably can't happen |
2043 |
| - * anymore). Neither of these cases is valid for a subselect RTE. |
2044 |
| - */ |
2045 |
| - if (rte->relid == InvalidOid) |
2046 |
| - elog(ERROR, "Invalid attnum %d for rangetable entry %s", |
2047 |
| - attnum, rte->eref->relname); |
2048 |
| - /* |
2049 |
| - * Use the real name of the table's column |
2050 |
| - */ |
2051 |
| - return get_relid_attribute_name(rte->relid, attnum); |
2052 |
| -} |
0 commit comments