1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

Fix various infelicities in node functions.

Mostly, this consists of adding support for fields which exist in the
structure but aren't handled by copy/equal/outfuncs; but the create
foreign table case can actually produce garbage output.

Noah Misch
This commit is contained in:
Robert Haas
2012-04-18 10:43:16 -04:00
parent 37e666b8b5
commit 53bbc681ca
3 changed files with 19 additions and 5 deletions

View File

@ -1927,11 +1927,12 @@ _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
*
*****************************************************************************/
/*
* print the basic stuff of all nodes that inherit from CreateStmt
*/
static void
_outCreateStmt(StringInfo str, const CreateStmt *node)
_outCreateStmtInfo(StringInfo str, const CreateStmt *node)
{
WRITE_NODE_TYPE("CREATESTMT");
WRITE_NODE_FIELD(relation);
WRITE_NODE_FIELD(tableElts);
WRITE_NODE_FIELD(inhRelations);
@ -1943,12 +1944,20 @@ _outCreateStmt(StringInfo str, const CreateStmt *node)
WRITE_BOOL_FIELD(if_not_exists);
}
static void
_outCreateStmt(StringInfo str, const CreateStmt *node)
{
WRITE_NODE_TYPE("CREATESTMT");
_outCreateStmtInfo(str, (const CreateStmt *) node);
}
static void
_outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
{
WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
_outCreateStmt(str, (const CreateStmt *) &node->base);
_outCreateStmtInfo(str, (const CreateStmt *) node);
WRITE_STRING_FIELD(servername);
WRITE_NODE_FIELD(options);
@ -2088,7 +2097,7 @@ _outColumnDef(StringInfo str, const ColumnDef *node)
WRITE_BOOL_FIELD(is_local);
WRITE_BOOL_FIELD(is_not_null);
WRITE_BOOL_FIELD(is_from_type);
WRITE_INT_FIELD(storage);
WRITE_CHAR_FIELD(storage);
WRITE_NODE_FIELD(raw_default);
WRITE_NODE_FIELD(cooked_default);
WRITE_NODE_FIELD(collClause);