5
5
*
6
6
* Copyright (c) 1994, Regents of the University of California
7
7
*
8
- * $Id: outfuncs.c,v 1.75 1999/02/18 00:49:14 momjian Exp $
8
+ * $Id: outfuncs.c,v 1.76 1999/02/23 08:01:47 thomas Exp $
9
9
*
10
10
* NOTES
11
11
* Every (plan) node in POSTGRES has an associated "out" routine which
42
42
#include "catalog/pg_type.h"
43
43
#include "lib/stringinfo.h"
44
44
45
- #ifdef PARSEDEBUG
46
45
#include "../parse.h"
47
- #endif
48
46
49
47
static void _outDatum (StringInfo str , Datum value , Oid type );
50
48
static void _outNode (StringInfo str , void * obj );
@@ -109,7 +107,6 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
109
107
node -> unique ? "true" : "false" );
110
108
}
111
109
112
- #ifdef PARSEDEBUG
113
110
static void
114
111
_outSelectStmt (StringInfo str , SelectStmt * node )
115
112
{
@@ -124,8 +121,6 @@ _outFuncCall(StringInfo str, FuncCall *node)
124
121
_outNode (str , node -> args );
125
122
}
126
123
127
- #endif
128
-
129
124
static void
130
125
_outColumnDef (StringInfo str , ColumnDef * node )
131
126
{
@@ -1293,7 +1288,6 @@ static void
1293
1288
_outAExpr (StringInfo str , A_Expr * node )
1294
1289
{
1295
1290
appendStringInfo (str , "EXPR " );
1296
- #ifdef PARSEDEBUG
1297
1291
switch (node -> oper )
1298
1292
{
1299
1293
case AND :
@@ -1312,12 +1306,9 @@ _outAExpr(StringInfo str, A_Expr *node)
1312
1306
appendStringInfo (str , "NOTNULL" );
1313
1307
break ;
1314
1308
default :
1315
- #endif
1316
1309
appendStringInfo (str , stringStringInfo (node -> opname ));
1317
- #ifdef PARSEDEBUG
1318
1310
break ;
1319
1311
}
1320
- #endif
1321
1312
_outNode (str , node -> lexpr );
1322
1313
_outNode (str , node -> rexpr );
1323
1314
return ;
@@ -1350,6 +1341,24 @@ _outIdent(StringInfo str, Ident *node)
1350
1341
return ;
1351
1342
}
1352
1343
1344
+ static void
1345
+ _outAttr (StringInfo str , Attr * node )
1346
+ {
1347
+ List * l ;
1348
+
1349
+ appendStringInfo (str , " ATTR \"%s\" " , stringStringInfo (node -> relname ));
1350
+
1351
+ appendStringInfo (str , "(" );
1352
+ foreach (l , node -> attrs )
1353
+ {
1354
+ _outNode (str , lfirst (l ));
1355
+ if (lnext (l ))
1356
+ appendStringInfo (str , "," );
1357
+ }
1358
+ appendStringInfo (str , ")" );
1359
+ return ;
1360
+ }
1361
+
1353
1362
static void
1354
1363
_outAConst (StringInfo str , A_Const * node )
1355
1364
{
@@ -1465,18 +1474,6 @@ _outNode(StringInfo str, void *obj)
1465
1474
case T_IndexElem :
1466
1475
_outIndexElem (str , obj );
1467
1476
break ;
1468
-
1469
- #ifdef PARSEDEBUG
1470
- case T_VariableSetStmt :
1471
- break ;
1472
- case T_SelectStmt :
1473
- _outSelectStmt (str , obj );
1474
- break ;
1475
- case T_FuncCall :
1476
- _outFuncCall (str , obj );
1477
- break ;
1478
- #endif
1479
-
1480
1477
case T_Query :
1481
1478
_outQuery (str , obj );
1482
1479
break ;
@@ -1659,6 +1656,19 @@ _outNode(StringInfo str, void *obj)
1659
1656
case T_CaseWhen :
1660
1657
_outCaseWhen (str , obj );
1661
1658
break ;
1659
+
1660
+ case T_VariableSetStmt :
1661
+ break ;
1662
+ case T_SelectStmt :
1663
+ _outSelectStmt (str , obj );
1664
+ break ;
1665
+ case T_FuncCall :
1666
+ _outFuncCall (str , obj );
1667
+ break ;
1668
+ case T_Attr :
1669
+ _outAttr (str , obj );
1670
+ break ;
1671
+
1662
1672
default :
1663
1673
elog (NOTICE , "_outNode: don't know how to print type %d " ,
1664
1674
nodeTag (obj ));
0 commit comments