40 #define WRITE_NODE_TYPE(nodelabel) \
41 appendStringInfoString(str, nodelabel)
44 #define WRITE_INT_FIELD(fldname) \
45 appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname)
48 #define WRITE_UINT_FIELD(fldname) \
49 appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname)
52 #define WRITE_UINT64_FIELD(fldname) \
53 appendStringInfo(str, " :" CppAsString(fldname) " " UINT64_FORMAT, \
57 #define WRITE_OID_FIELD(fldname) \
58 appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname)
61 #define WRITE_LONG_FIELD(fldname) \
62 appendStringInfo(str, " :" CppAsString(fldname) " %ld", node->fldname)
65 #define WRITE_CHAR_FIELD(fldname) \
66 (appendStringInfo(str, " :" CppAsString(fldname) " "), \
67 outChar(str, node->fldname))
70 #define WRITE_ENUM_FIELD(fldname, enumtype) \
71 appendStringInfo(str, " :" CppAsString(fldname) " %d", \
75 #define WRITE_FLOAT_FIELD(fldname) \
76 (appendStringInfo(str, " :" CppAsString(fldname) " "), \
77 outDouble(str, node->fldname))
80 #define WRITE_BOOL_FIELD(fldname) \
81 appendStringInfo(str, " :" CppAsString(fldname) " %s", \
82 booltostr(node->fldname))
85 #define WRITE_STRING_FIELD(fldname) \
86 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
87 outToken(str, node->fldname))
90 #define WRITE_LOCATION_FIELD(fldname) \
91 appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname)
94 #define WRITE_NODE_FIELD(fldname) \
95 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
96 outNode(str, node->fldname))
99 #define WRITE_BITMAPSET_FIELD(fldname) \
100 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
101 outBitmapset(str, node->fldname))
104 #define WRITE_NODE_ARRAY(fldname, len) \
105 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
106 writeNodeArray(str, (const Node * const *) node->fldname, len))
109 #define WRITE_ATTRNUMBER_ARRAY(fldname, len) \
110 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
111 writeAttrNumberCols(str, node->fldname, len))
114 #define WRITE_OID_ARRAY(fldname, len) \
115 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
116 writeOidCols(str, node->fldname, len))
119 #define WRITE_INDEX_ARRAY(fldname, len) \
120 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
121 writeIndexCols(str, node->fldname, len))
124 #define WRITE_INT_ARRAY(fldname, len) \
125 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
126 writeIntCols(str, node->fldname, len))
129 #define WRITE_BOOL_ARRAY(fldname, len) \
130 (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
131 writeBoolCols(str, node->fldname, len))
133 #define booltostr(x) ((x) ? "true" : "false")
167 isdigit((
unsigned char) *s) ||
168 ((*s ==
'+' || *s ==
'-') &&
169 (isdigit((
unsigned char) s[1]) || s[1] ==
'.')))
174 if (*s ==
' ' || *s ==
'\n' || *s ==
'\t' ||
175 *s ==
'(' || *s ==
')' || *s ==
'{' || *s ==
'}' ||
224 #define WRITE_SCALAR_ARRAY(fnname, datatype, fmtstr, convfunc) \
226 fnname(StringInfo str, const datatype *arr, int len) \
230 appendStringInfoChar(str, '('); \
231 for (int i = 0; i < len; i++) \
232 appendStringInfo(str, fmtstr, convfunc(arr[i])); \
233 appendStringInfoChar(str, ')'); \
236 appendStringInfoString(str, "<>"); \
257 for (
int i = 0;
i <
len;
i++)
278 if (
IsA(node, IntList))
280 else if (
IsA(node, OidList))
282 else if (
IsA(node, XidList))
298 else if (
IsA(node, IntList))
300 else if (
IsA(node, OidList))
302 else if (
IsA(node, XidList))
305 elog(
ERROR,
"unrecognized list node type: %d",
348 s = (
char *) (&
value);
362 for (
i = 0;
i < length;
i++)
370 #include "outfuncs.funcs.c"
392 if (node->constisnull)
395 outDatum(
str, node->constvalue, node->constlen, node->constbyval);
635 elog(
ERROR,
"unrecognized A_Expr_Kind: %d", (
int) node->
kind);
675 if (node->
sval[0] !=
'\0')
841 else if (
IsA(obj,
List) ||
IsA(obj, IntList) ||
IsA(obj, OidList) ||
862 #include "outfuncs.switch.c"
870 elog(
WARNING,
"could not dump unrecognized node type: %d",
int bms_next_member(const Bitmapset *a, int prevbit)
#define PointerIsValid(pointer)
int double_to_shortest_decimal_buf(double f, char *result)
Size datumGetSize(Datum value, bool typByVal, int typLen)
elog(ERROR, "%s: %s", p2, msg)
const ExtensibleNodeMethods * GetExtensibleNodeMethods(const char *extnodename, bool missing_ok)
#define IsA(nodeptr, _type_)
static void _outString(StringInfo str, const String *node)
#define WRITE_OID_FIELD(fldname)
#define WRITE_BITMAPSET_FIELD(fldname)
void outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
static void outChar(StringInfo str, char c)
static void _outExtensibleNode(StringInfo str, const ExtensibleNode *node)
static void _outA_Const(StringInfo str, const A_Const *node)
static void _outBoolExpr(StringInfo str, const BoolExpr *node)
#define WRITE_ENUM_FIELD(fldname, enumtype)
static void _outForeignKeyOptInfo(StringInfo str, const ForeignKeyOptInfo *node)
static void outDouble(StringInfo str, double d)
#define WRITE_ATTRNUMBER_ARRAY(fldname, len)
#define WRITE_FLOAT_FIELD(fldname)
#define WRITE_NODE_FIELD(fldname)
#define WRITE_SCALAR_ARRAY(fnname, datatype, fmtstr, convfunc)
#define WRITE_NODE_TYPE(nodelabel)
static void _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
static void _outConst(StringInfo str, const Const *node)
#define WRITE_BOOL_FIELD(fldname)
void outToken(StringInfo str, const char *s)
static void _outInteger(StringInfo str, const Integer *node)
#define WRITE_UINT_FIELD(fldname)
#define WRITE_OID_ARRAY(fldname, len)
static void _outA_Expr(StringInfo str, const A_Expr *node)
static void _outList(StringInfo str, const List *node)
static void _outConstraint(StringInfo str, const Constraint *node)
#define WRITE_CHAR_FIELD(fldname)
void outNode(StringInfo str, const void *obj)
#define WRITE_LOCATION_FIELD(fldname)
static void _outFloat(StringInfo str, const Float *node)
char * bmsToString(const Bitmapset *bms)
#define WRITE_STRING_FIELD(fldname)
#define WRITE_INT_FIELD(fldname)
static void _outBitString(StringInfo str, const BitString *node)
static void _outBoolean(StringInfo str, const Boolean *node)
static void writeNodeArray(StringInfo str, const Node *const *arr, int len)
char * nodeToString(const void *obj)
static void _outEquivalenceClass(StringInfo str, const EquivalenceClass *node)
void outBitmapset(StringInfo str, const Bitmapset *bms)
@ CONSTR_ATTR_NOT_DEFERRABLE
static int list_length(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
void check_stack_depth(void)
static Pointer DatumGetPointer(Datum X)
static const struct fns functions
#define DOUBLE_SHORTEST_DECIMAL_LEN
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct EquivalenceClass * ec_merged
void(* nodeOut)(struct StringInfoData *str, const struct ExtensibleNode *node)
struct EquivalenceClass * eclass[INDEX_MAX_KEYS]
List * rinfos[INDEX_MAX_KEYS]