mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Repair some issues with column aliases and RowExpr construction in the
presence of dropped columns. Document the already-presumed fact that eref aliases in relation RTEs are supposed to have entries for dropped columns; cause the user alias structs to have such entries too, so that there's always a one-to-one mapping to the underlying physical attnums. Adjust expandRTE() and related code to handle the case where a column that is part of a JOIN has been dropped. Generalize expandRTE()'s API so that it can be used in a couple of places that formerly rolled their own implementation of the same logic. Fix ruleutils.c to suppress display of aliases for columns that were dropped since the rule was made.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/parser/parsetree.h,v 1.25 2004/08/17 18:47:09 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/parser/parsetree.h,v 1.26 2004/08/19 20:57:41 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
|
||||
* 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,
|
||||
extern bool get_rte_attribute_is_dropped(List *rtable, int rtindex,
|
||||
AttrNumber attnum);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user