Skip to content

Commit db82332

Browse files
committed
Fix for views that use AS with two words.
1 parent a034884 commit db82332

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.36 1998/06/15 19:28:32 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.37 1998/07/09 14:59:27 momjian Exp $
1111
*
1212
* NOTES
1313
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -660,7 +660,8 @@ _outResdom(StringInfo str, Resdom *node)
660660
sprintf(buf, " :restypmod %d ", node->restypmod);
661661
appendStringInfo(str, buf);
662662
appendStringInfo(str, " :resname ");
663-
appendStringInfo(str, node->resname);
663+
sprintf(buf,"\"%s\"", node->resname); /* fix for SELECT col AS "my name" */
664+
appendStringInfo(str, buf);
664665
sprintf(buf, " :reskey %d ", node->reskey);
665666
appendStringInfo(str, buf);
666667
sprintf(buf, " :reskeyop %u ", node->reskeyop);
@@ -849,7 +850,7 @@ _outArray(StringInfo str, Array *node)
849850
appendStringInfo(str, " :arraylow ");
850851
for (i = 0; i < node->arrayndim; i++)
851852
{
852-
sprintf(buf, " %d ", node->arraylow.indx[i]);
853+
sprintf(buf, " %d ", node->arraylow.indx[i]);
853854
appendStringInfo(str, buf);
854855
}
855856
appendStringInfo(str, " :arrayhigh ");

0 commit comments

Comments
 (0)