PostgreSQL Source Code git master
|
#include "postgres.h"
#include <ctype.h>
#include "access/attnum.h"
#include "common/shortest_dec.h"
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "nodes/bitmapset.h"
#include "nodes/nodes.h"
#include "nodes/pg_list.h"
#include "utils/datum.h"
#include "outfuncs.funcs.c"
#include "outfuncs.switch.c"
Go to the source code of this file.
Macros | |
#define | WRITE_NODE_TYPE(nodelabel) appendStringInfoString(str, nodelabel) |
#define | WRITE_INT_FIELD(fldname) appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname) |
#define | WRITE_UINT_FIELD(fldname) appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname) |
#define | WRITE_UINT64_FIELD(fldname) |
#define | WRITE_OID_FIELD(fldname) appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname) |
#define | WRITE_LONG_FIELD(fldname) appendStringInfo(str, " :" CppAsString(fldname) " %ld", node->fldname) |
#define | WRITE_CHAR_FIELD(fldname) |
#define | WRITE_ENUM_FIELD(fldname, enumtype) |
#define | WRITE_FLOAT_FIELD(fldname) |
#define | WRITE_BOOL_FIELD(fldname) |
#define | WRITE_STRING_FIELD(fldname) |
#define | WRITE_LOCATION_FIELD(fldname) appendStringInfo(str, " :" CppAsString(fldname) " %d", write_location_fields ? node->fldname : -1) |
#define | WRITE_NODE_FIELD(fldname) |
#define | WRITE_BITMAPSET_FIELD(fldname) |
#define | WRITE_NODE_ARRAY(fldname, len) |
#define | WRITE_ATTRNUMBER_ARRAY(fldname, len) |
#define | WRITE_OID_ARRAY(fldname, len) |
#define | WRITE_INDEX_ARRAY(fldname, len) |
#define | WRITE_INT_ARRAY(fldname, len) |
#define | WRITE_BOOL_ARRAY(fldname, len) |
#define | booltostr(x) ((x) ? "true" : "false") |
#define | WRITE_SCALAR_ARRAY(fnname, datatype, fmtstr, convfunc) |
Functions | |
static void | outChar (StringInfo str, char c) |
static void | outDouble (StringInfo str, double d) |
void | outToken (StringInfo str, const char *s) |
static void | writeNodeArray (StringInfo str, const Node *const *arr, int len) |
static void | _outList (StringInfo str, const List *node) |
void | outBitmapset (StringInfo str, const Bitmapset *bms) |
void | outDatum (StringInfo str, Datum value, int typlen, bool typbyval) |
static void | _outConst (StringInfo str, const Const *node) |
static void | _outBoolExpr (StringInfo str, const BoolExpr *node) |
static void | _outForeignKeyOptInfo (StringInfo str, const ForeignKeyOptInfo *node) |
static void | _outEquivalenceClass (StringInfo str, const EquivalenceClass *node) |
static void | _outExtensibleNode (StringInfo str, const ExtensibleNode *node) |
static void | _outRangeTblEntry (StringInfo str, const RangeTblEntry *node) |
static void | _outA_Expr (StringInfo str, const A_Expr *node) |
static void | _outInteger (StringInfo str, const Integer *node) |
static void | _outFloat (StringInfo str, const Float *node) |
static void | _outBoolean (StringInfo str, const Boolean *node) |
static void | _outString (StringInfo str, const String *node) |
static void | _outBitString (StringInfo str, const BitString *node) |
static void | _outA_Const (StringInfo str, const A_Const *node) |
void | outNode (StringInfo str, const void *obj) |
static char * | nodeToStringInternal (const void *obj, bool write_loc_fields) |
char * | nodeToString (const void *obj) |
char * | nodeToStringWithLocations (const void *obj) |
char * | bmsToString (const Bitmapset *bms) |
Variables | |
static bool | write_location_fields = false |
Definition at line 136 of file outfuncs.c.
#define WRITE_ATTRNUMBER_ARRAY | ( | fldname, | |
len | |||
) |
Definition at line 112 of file outfuncs.c.
#define WRITE_BITMAPSET_FIELD | ( | fldname | ) |
Definition at line 102 of file outfuncs.c.
#define WRITE_BOOL_ARRAY | ( | fldname, | |
len | |||
) |
Definition at line 132 of file outfuncs.c.
#define WRITE_BOOL_FIELD | ( | fldname | ) |
Definition at line 83 of file outfuncs.c.
#define WRITE_CHAR_FIELD | ( | fldname | ) |
Definition at line 68 of file outfuncs.c.
#define WRITE_ENUM_FIELD | ( | fldname, | |
enumtype | |||
) |
Definition at line 73 of file outfuncs.c.
#define WRITE_FLOAT_FIELD | ( | fldname | ) |
Definition at line 78 of file outfuncs.c.
#define WRITE_INDEX_ARRAY | ( | fldname, | |
len | |||
) |
Definition at line 122 of file outfuncs.c.
#define WRITE_INT_ARRAY | ( | fldname, | |
len | |||
) |
Definition at line 127 of file outfuncs.c.
#define WRITE_INT_FIELD | ( | fldname | ) | appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname) |
Definition at line 47 of file outfuncs.c.
#define WRITE_LOCATION_FIELD | ( | fldname | ) | appendStringInfo(str, " :" CppAsString(fldname) " %d", write_location_fields ? node->fldname : -1) |
Definition at line 93 of file outfuncs.c.
#define WRITE_LONG_FIELD | ( | fldname | ) | appendStringInfo(str, " :" CppAsString(fldname) " %ld", node->fldname) |
Definition at line 64 of file outfuncs.c.
#define WRITE_NODE_ARRAY | ( | fldname, | |
len | |||
) |
Definition at line 107 of file outfuncs.c.
#define WRITE_NODE_FIELD | ( | fldname | ) |
Definition at line 97 of file outfuncs.c.
#define WRITE_NODE_TYPE | ( | nodelabel | ) | appendStringInfoString(str, nodelabel) |
Definition at line 43 of file outfuncs.c.
#define WRITE_OID_ARRAY | ( | fldname, | |
len | |||
) |
Definition at line 117 of file outfuncs.c.
#define WRITE_OID_FIELD | ( | fldname | ) | appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname) |
Definition at line 60 of file outfuncs.c.
#define WRITE_SCALAR_ARRAY | ( | fnname, | |
datatype, | |||
fmtstr, | |||
convfunc | |||
) |
Definition at line 227 of file outfuncs.c.
#define WRITE_STRING_FIELD | ( | fldname | ) |
Definition at line 88 of file outfuncs.c.
#define WRITE_UINT64_FIELD | ( | fldname | ) |
Definition at line 55 of file outfuncs.c.
#define WRITE_UINT_FIELD | ( | fldname | ) | appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname) |
Definition at line 51 of file outfuncs.c.
|
static |
Definition at line 699 of file outfuncs.c.
References appendStringInfoString(), A_Const::isnull, outNode(), str, A_Const::val, WRITE_LOCATION_FIELD, and WRITE_NODE_TYPE.
|
static |
Definition at line 579 of file outfuncs.c.
References AEXPR_BETWEEN, AEXPR_BETWEEN_SYM, AEXPR_DISTINCT, AEXPR_ILIKE, AEXPR_IN, AEXPR_LIKE, AEXPR_NOT_BETWEEN, AEXPR_NOT_BETWEEN_SYM, AEXPR_NOT_DISTINCT, AEXPR_NULLIF, AEXPR_OP, AEXPR_OP_ALL, AEXPR_OP_ANY, AEXPR_SIMILAR, appendStringInfoString(), elog, ERROR, A_Expr::kind, name, str, WRITE_LOCATION_FIELD, WRITE_NODE_FIELD, and WRITE_NODE_TYPE.
|
static |
Definition at line 687 of file outfuncs.c.
References Assert, BitString::bsval, outToken(), and str.
Referenced by outNode().
|
static |
Definition at line 667 of file outfuncs.c.
References appendStringInfoString(), Boolean::boolval, and str.
Referenced by outNode().
|
static |
Definition at line 402 of file outfuncs.c.
References AND_EXPR, appendStringInfoString(), generate_unaccent_rules::args, BoolExpr::boolop, NOT_EXPR, OR_EXPR, outToken(), str, WRITE_LOCATION_FIELD, WRITE_NODE_FIELD, and WRITE_NODE_TYPE.
|
static |
Definition at line 382 of file outfuncs.c.
References appendStringInfoString(), outDatum(), str, WRITE_BOOL_FIELD, WRITE_INT_FIELD, WRITE_LOCATION_FIELD, WRITE_NODE_TYPE, and WRITE_OID_FIELD.
|
static |
Definition at line 455 of file outfuncs.c.
References EquivalenceClass::ec_merged, WRITE_BITMAPSET_FIELD, WRITE_BOOL_FIELD, WRITE_NODE_FIELD, WRITE_NODE_TYPE, WRITE_OID_FIELD, and WRITE_UINT_FIELD.
|
static |
Definition at line 481 of file outfuncs.c.
References ExtensibleNode::extnodename, GetExtensibleNodeMethods(), ExtensibleNodeMethods::nodeOut, str, WRITE_NODE_TYPE, and WRITE_STRING_FIELD.
|
static |
Definition at line 657 of file outfuncs.c.
References appendStringInfoString(), Float::fval, and str.
Referenced by outNode().
|
static |
Definition at line 429 of file outfuncs.c.
References appendStringInfo(), appendStringInfoString(), ForeignKeyOptInfo::eclass, i, list_length(), ForeignKeyOptInfo::nkeys, ForeignKeyOptInfo::rinfos, str, WRITE_ATTRNUMBER_ARRAY, WRITE_INT_FIELD, WRITE_NODE_TYPE, WRITE_OID_ARRAY, and WRITE_UINT_FIELD.
|
static |
Definition at line 651 of file outfuncs.c.
References appendStringInfo(), Integer::ival, and str.
Referenced by outNode().
|
static |
Definition at line 275 of file outfuncs.c.
References appendStringInfo(), appendStringInfoChar(), elog, ERROR, IsA, lfirst, lfirst_int, lfirst_oid, lfirst_xid, lnext(), outNode(), str, and List::type.
Referenced by outNode().
|
static |
Definition at line 496 of file outfuncs.c.
References elog, ERROR, functions, RTE_CTE, RTE_FUNCTION, RTE_GROUP, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, WRITE_BOOL_FIELD, WRITE_CHAR_FIELD, WRITE_ENUM_FIELD, WRITE_FLOAT_FIELD, WRITE_INT_FIELD, WRITE_NODE_FIELD, WRITE_NODE_TYPE, WRITE_OID_FIELD, WRITE_STRING_FIELD, and WRITE_UINT_FIELD.
|
static |
Definition at line 673 of file outfuncs.c.
References appendStringInfoChar(), outToken(), str, and String::sval.
Referenced by outNode().
char * bmsToString | ( | const Bitmapset * | bms | ) |
Definition at line 811 of file outfuncs.c.
References initStringInfo(), outBitmapset(), and str.
Referenced by search_indexed_tlist_for_phv(), and search_indexed_tlist_for_var().
char * nodeToString | ( | const void * | obj | ) |
Definition at line 794 of file outfuncs.c.
References nodeToStringInternal().
Referenced by AlterDomainDefault(), AlterPolicy(), CreatePolicy(), CreateStatistics(), CreateTriggerFiringOn(), DefineDomain(), DetachAddConstraintIfNeeded(), domainAddCheckConstraint(), ExecSerializePlan(), expandTableLikeClause(), InsertRule(), ProcedureCreate(), publication_add_relation(), StoreAttrDefault(), StorePartitionBound(), StorePartitionKey(), StoreRelCheck(), and UpdateIndexRelation().
|
static |
Definition at line 773 of file outfuncs.c.
References initStringInfo(), outNode(), str, and write_location_fields.
Referenced by nodeToString(), and nodeToStringWithLocations().
char * nodeToStringWithLocations | ( | const void * | obj | ) |
Definition at line 800 of file outfuncs.c.
References nodeToStringInternal().
Referenced by elog_node_display(), pg_parse_query(), pg_plan_query(), pg_rewrite_query(), pprint(), and print().
void outBitmapset | ( | StringInfo | str, |
const Bitmapset * | bms | ||
) |
Definition at line 325 of file outfuncs.c.
References appendStringInfo(), appendStringInfoChar(), bms_next_member(), str, and x.
Referenced by bmsToString(), and outNode().
|
static |
Definition at line 190 of file outfuncs.c.
References appendStringInfoString(), outToken(), and str.
void outDatum | ( | StringInfo | str, |
Datum | value, | ||
int | typlen, | ||
bool | typbyval | ||
) |
Definition at line 341 of file outfuncs.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), DatumGetPointer(), datumGetSize(), i, PointerIsValid, str, and value.
Referenced by _outConst().
|
static |
Definition at line 211 of file outfuncs.c.
References appendStringInfoString(), buf, DOUBLE_SHORTEST_DECIMAL_LEN, double_to_shortest_decimal_buf(), and str.
void outNode | ( | StringInfo | str, |
const void * | obj | ||
) |
Definition at line 719 of file outfuncs.c.
References _outBitString(), _outBoolean(), _outFloat(), _outInteger(), _outList(), _outString(), appendStringInfoChar(), appendStringInfoString(), check_stack_depth(), elog, IsA, nodeTag, outBitmapset(), str, and WARNING.
Referenced by _outA_Const(), _outList(), nodeToStringInternal(), and writeNodeArray().
void outToken | ( | StringInfo | str, |
const char * | s | ||
) |
Definition at line 149 of file outfuncs.c.
References appendStringInfoChar(), appendStringInfoString(), and str.
Referenced by _outBitString(), _outBoolExpr(), _outString(), and outChar().
|
static |
Definition at line 255 of file outfuncs.c.
References appendStringInfoChar(), appendStringInfoString(), i, len, outNode(), and str.
|
static |
Definition at line 29 of file outfuncs.c.
Referenced by nodeToStringInternal().