Skip to content

Commit 4c2071c

Browse files
committed
Repair bogus rule display of attr lists.
1 parent 1204c3e commit 4c2071c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/backend/utils/adt/ruleutils.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* out of its tuple
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.40 2000/02/15 03:37:56 thomas Exp $
6+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.41 2000/02/15 08:24:12 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -992,17 +992,21 @@ get_select_query_def(Query *query, deparse_context *context)
992992
quote_identifier(rte->relname),
993993
inherit_marker(rte));
994994
if (strcmp(rte->relname, rte->ref->relname) != 0)
995-
{
996-
List *col;
997995
appendStringInfo(buf, " %s",
998996
quote_identifier(rte->ref->relname));
997+
if (rte->ref->attrs != NIL)
998+
{
999+
List *col;
1000+
9991001
appendStringInfo(buf, " (");
1000-
foreach (col, rte->ref->attrs)
1002+
foreach(col, rte->ref->attrs)
10011003
{
1002-
if (col != lfirst(rte->ref->attrs))
1004+
if (col != rte->ref->attrs)
10031005
appendStringInfo(buf, ", ");
1004-
appendStringInfo(buf, "%s", strVal(col));
1006+
appendStringInfo(buf, "%s",
1007+
quote_identifier(strVal(lfirst(col))));
10051008
}
1009+
appendStringInfo(buf, ")");
10061010
}
10071011
}
10081012
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy