aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_relation.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-04-18 17:04:24 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-04-18 17:04:24 +0000
commit40136f4465d187e810a606f860dc4afbf4187d70 (patch)
tree945c16c2d6cb6f51ec55a92b2cdfc3a97ea72c37 /src/backend/parser/parse_relation.c
parent4a5905184ff38439083cbfec6371b8ddb0d315fe (diff)
downloadpostgresql-40136f4465d187e810a606f860dc4afbf4187d70.tar.gz
postgresql-40136f4465d187e810a606f860dc4afbf4187d70.zip
Make rule lister do the right thing with Vars representing whole tuples.
Diffstat (limited to 'src/backend/parser/parse_relation.c')
-rw-r--r--src/backend/parser/parse_relation.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 59be1044748..f5324cb3735 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.53 2001/03/22 03:59:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.54 2001/04/18 17:04:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -909,6 +909,9 @@ expandNamesVars(ParseState *pstate, List *names, List *vars)
* In particular, it will work on an RTE for a subselect, whereas
* get_attname() only works on real relations.
*
+ * "*" is returned if the given attnum is InvalidAttrNumber --- this case
+ * occurs when a Var represents a whole tuple of a relation.
+ *
* XXX Actually, this is completely bogus, because refnames of RTEs are
* not guaranteed unique, and may not even have scope across the whole
* query. Cleanest fix would be to add refname/attname to Var nodes and
@@ -920,6 +923,9 @@ get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum)
{
char *attname;
+ if (attnum == InvalidAttrNumber)
+ return "*";
+
/*
* If there is an alias, use it
*/