62#include "utils/fmgroids.h"
81#define PRETTYINDENT_STD 8
82#define PRETTYINDENT_JOIN 4
83#define PRETTYINDENT_VAR 4
85#define PRETTYINDENT_LIMIT 40
88#define PRETTYFLAG_PAREN 0x0001
89#define PRETTYFLAG_INDENT 0x0002
90#define PRETTYFLAG_SCHEMA 0x0004
93#define GET_PRETTY_FLAGS(pretty) \
94 ((pretty) ? (PRETTYFLAG_PAREN | PRETTYFLAG_INDENT | PRETTYFLAG_SCHEMA) \
98#define WRAP_COLUMN_DEFAULT 0
101#define PRETTY_PAREN(context) ((context)->prettyFlags & PRETTYFLAG_PAREN)
102#define PRETTY_INDENT(context) ((context)->prettyFlags & PRETTYFLAG_INDENT)
103#define PRETTY_SCHEMA(context) ((context)->prettyFlags & PRETTYFLAG_SCHEMA)
312#define deparse_columns_fetch(rangetable_index, dpns) \
313 ((deparse_columns *) list_nth((dpns)->rtable_columns, (rangetable_index)-1))
336static const char *
const query_getviewrule =
"SELECT * FROM pg_catalog.pg_rewrite WHERE ev_class = $1 AND rulename = $2";
354 int prettyFlags,
int wrapColumn);
363 int prettyFlags,
bool missing_ok);
369 int prettyFlags,
bool missing_ok);
414 int prettyFlags,
int wrapColumn);
416 TupleDesc resultDesc,
bool colNamesVisible,
550#define only_marker(rte) ((rte)->inh ? "" : "ONLY ")
836 elog(
ERROR,
"failed to get pg_rewrite tuple for view %u", viewoid);
1030 tgrel->rd_att, &isnull);
1036 tgrel->rd_att, &isnull);
1041 if (tgoldtable !=
NULL || tgnewtable !=
NULL)
1044 if (tgoldtable !=
NULL)
1047 if (tgnewtable !=
NULL)
1059 tgrel->rd_att, &isnull);
1079 oldrte->relkind = relkind;
1090 newrte->relkind = relkind;
1130 false,
NULL,
false));
1138 tgrel->rd_att, &isnull);
1244 prettyFlags,
false);
1260 prettyFlags,
false);
1274 int prettyFlags,
bool missing_ok)
1308 elog(
ERROR,
"cache lookup failed for index %u", indexrelid);
1333 elog(
ERROR,
"cache lookup failed for relation %u", indexrelid);
1341 elog(
ERROR,
"cache lookup failed for access method %u",
1381 idxrec->indisunique ?
"UNIQUE " :
"",
1398 for (keyno = 0; keyno <
idxrec->indnatts; keyno++)
1411 if (!colno && keyno ==
idxrec->indnkeyatts)
1428 if (!colno || colno == keyno + 1)
1440 elog(
ERROR,
"too few entries in indexprs list");
1446 if (!colno || colno == keyno + 1)
1460 (!colno || colno == keyno + 1))
1514 if (
idxrec->indnullsnotdistinct)
1728 elog(
ERROR,
"stxkind is not a 1-D char array");
1787 for (colno = 0; colno <
statextrec->stxkeys.dim1; colno++)
1957 elog(
ERROR,
"cache lookup failed for partition key of %u", relid);
1990 elog(
ERROR,
"unexpected node type found in partexprs: %d",
2003 switch (
form->partstrat)
2018 elog(
ERROR,
"unexpected partition strategy: %d",
2019 (
int)
form->partstrat);
2025 for (keyno = 0; keyno <
form->partnatts; keyno++)
2052 elog(
ERROR,
"too few entries in partexprs list");
2115 false, prettyFlags, 0);
2193 int prettyFlags,
bool missing_ok)
2295 switch (
conForm->confmatchtype)
2298 string =
" MATCH FULL";
2301 string =
" MATCH PARTIAL";
2307 elog(
ERROR,
"unrecognized confmatchtype: %d",
2321 string =
"RESTRICT";
2327 string =
"SET NULL";
2330 string =
"SET DEFAULT";
2333 elog(
ERROR,
"unrecognized confupdtype: %d",
2347 string =
"RESTRICT";
2353 string =
"SET NULL";
2356 string =
"SET DEFAULT";
2359 elog(
ERROR,
"unrecognized confdeltype: %d",
2433 &keys,
NULL, &nKeys);
2521 conForm->connoinherit ?
" NO INHERIT" :
"");
2570 &elems,
NULL, &nElems);
2573 for (
i = 0;
i < nElems;
i++)
2603 else if (!
conForm->convalidated)
2629 &keys,
NULL, &nKeys);
2631 for (
j = 0;
j < nKeys;
j++)
2739 errmsg(
"input is a query, not an expression")));
2751 errmsg(
"expression contains variables of more than one relation")));
2758 errmsg(
"expression contains variables")));
2857 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
2955 errmsg(
"\"%s\" is an aggregate function",
name)));
2986 switch (proc->provolatile)
2998 switch (proc->proparallel)
3010 if (proc->proisstrict)
3012 if (proc->prosecdef)
3014 if (proc->proleakproof)
3026 if (proc->prorows > 0 && proc->prorows != 1000)
3029 if (proc->prosupport)
3041 false,
NULL,
false));
3107 elog(
ERROR,
"invalid list syntax in proconfig item");
3271 if (proc->proretset)
3285 if (proc->proretset)
3350 elog(
ERROR,
"cache lookup failed for aggregate %u",
3360 for (
i = 0;
i < numargs;
i++)
3362 Oid argtype = argtypes[
i];
3363 char *argname = argnames ? argnames[
i] :
NULL;
3420 if (argname && argname[0])
3572 dpns.numargs = numargs;
3573 dpns.argnames = argnames;
3726 rte->lateral =
false;
3728 rte->inFromCl =
true;
3764 dpns->rtable_names = rtable_names;
3837 dpns->ancestors = ancestors;
3863 dpns.rtable = rtable;
3870 return dpns.rtable_names;
3909 names_hash =
hash_create(
"set_rtable_names names",
3937 foreach(
lc,
dpns->rtable)
3950 else if (
rte->alias)
3953 refname =
rte->alias->aliasname;
3968 refname =
rte->eref->aliasname;
4044 dpns->ret_old_alias = query->returningOldAlias;
4045 dpns->ret_new_alias = query->returningNewAlias;
4060 dpns->unique_using =
4165 if (
j->alias ==
NULL &&
j->usingClause)
4175 for (
int i = 0;
i <
jrte->joinmergedcols;
i++)
4191 elog(
ERROR,
"unrecognized node type: %d",
4241 leftattnos =
colinfo->leftattnos;
4242 rightattnos =
colinfo->rightattnos;
4257 char *colname =
colinfo->colnames[
i];
4259 if (colname ==
NULL)
4263 if (leftattnos[
i] > 0)
4270 if (rightattnos[
i] > 0)
4311 foreach(
lc,
j->usingClause)
4316 Assert(leftattnos[
i] != 0 && rightattnos[
i] != 0);
4328 if (
dpns->unique_using)
4337 parentUsing =
lappend(parentUsing, colname);
4340 if (leftattnos[
i] > 0)
4347 if (rightattnos[
i] > 0)
4366 elog(
ERROR,
"unrecognized node type: %d",
4402 ncolumns = tupdesc->
natts;
4405 for (
i = 0;
i < ncolumns;
i++)
4409 if (attr->attisdropped)
4441 true , &colnames,
NULL);
4444 colnames =
rte->eref->colnames;
4450 foreach(
lc, colnames)
4458 if (
cname[0] ==
'\0')
4483 colinfo->new_colnames = (
char **)
palloc(ncolumns *
sizeof(
char *));
4484 colinfo->is_new_col = (
bool *)
palloc(ncolumns *
sizeof(
bool));
4499 for (
i = 0;
i < ncolumns;
i++)
4502 char *colname =
colinfo->colnames[
i];
4512 if (colname ==
NULL)
4528 colinfo->new_colnames[
j] = colname;
4564 colinfo->printaliases =
false;
4565 else if (
rte->alias &&
rte->alias->colnames !=
NIL)
4623 char *colname =
colinfo->colnames[
i];
4632 else if (
colinfo->rightattnos[
i] > 0)
4656 if (colname ==
NULL)
4825#ifdef USE_ASSERT_CHECKING
4842 colinfo->printaliases =
false;
4909 foreach(
lc,
dpns->using_names)
5082 elog(
ERROR,
"unrecognized node type in jointree: %d",
5089 elog(
ERROR,
"unrecognized node type in jointree: %d",
5110 foreach(
lc,
jrte->joinleftcols)
5117 foreach(
lc,
jrte->joinrightcols)
5141 return (
char *)
list_nth(
dpns->rtable_names, rtindex - 1);
5172 if (
dpns->outer_plan)
5173 dpns->outer_tlist =
dpns->outer_plan->targetlist;
5214 else if (
dpns->inner_plan)
5215 dpns->inner_tlist =
dpns->inner_plan->targetlist;
5240 foreach(
lc,
dpns->ancestors)
5248 elog(
ERROR,
"could not find RecursiveUnion for WorkTableScan with wtParam %d",
5294 dpns->ancestors = ancestors;
5398 elog(
ERROR,
"invalid empty ev_action list");
5436 errmsg(
"rule \"%s\" has unsupported event type %d",
5437 rulename, ev_type)));
5510 foreach(action, actions)
5543 int prettyFlags,
int wrapColumn)
5592 if (ev_type !=
'1' || !is_instead ||
5602 prettyFlags, wrapColumn, 0);
5628 TupleDesc resultDesc,
bool colNamesVisible,
5639 rtable_size = query->hasGroupRTE ?
5647 if (query->hasGroupRTE)
5716 elog(
ERROR,
"unrecognized query command type: %d",
5735 foreach(
vtl, values_lists)
5785 if (query->hasRecursive)
5786 sep =
"WITH RECURSIVE ";
5795 if (cte->aliascolnames)
5801 foreach(
col, cte->aliascolnames)
5835 if (cte->search_clause)
5841 cte->search_clause->search_breadth_first ?
"BREADTH" :
"DEPTH");
5843 foreach(
lc, cte->search_clause->search_col_list)
5856 if (cte->cycle_clause)
5863 foreach(
lc, cte->cycle_clause->cycle_col_list)
5883 get_rule_expr(cte->cycle_clause->cycle_mark_value, context,
false);
5885 get_rule_expr(cte->cycle_clause->cycle_mark_default, context,
false);
5990 if (query->hasForUpdate)
6004 elog(
ERROR,
"unrecognized LockClauseStrength %d",
6099 colname =
tle->resname;
6139 if (query->isReturn)
6147 if (query->hasDistinctOn)
6258 foreach(l, targetList)
6312 colno - 1)->attname);
6314 colname =
tle->resname;
6392 if (query->returningOldAlias &&
strcmp(query->returningOldAlias,
"old") != 0)
6398 if (query->returningNewAlias &&
strcmp(query->returningNewAlias,
"new") != 0)
6556 elog(
ERROR,
"unrecognized node type: %d",
6655 foreach(l,
gset->content)
6682 foreach(l,
gset->content)
6721 if (
srt->nulls_first)
6724 else if (
srt->sortop == typentry->
gt_opr)
6728 if (!
srt->nulls_first)
6738 if (
srt->nulls_first)
6765 if (wc->name ==
NULL)
6844 Node *startOffset,
Node *endOffset,
6904 buf->data[--(
buf->len)] =
'\0';
6913 Node *startOffset,
Node *endOffset,
6961 foreach(l, query->
rtable)
6968 elog(
ERROR,
"too many subquery RTEs in INSERT");
6975 elog(
ERROR,
"too many values RTEs in INSERT");
6980 elog(
ERROR,
"both subquery and values RTEs in INSERT");
7044 if (query->override)
7086 if (
confl->arbiterElems)
7118 elog(
ERROR,
"cache lookup failed for constraint %u",
7225 if (query->hasSubLinks)
7227 foreach(l, targetList)
7249 foreach(l, targetList)
7466 switch (action->matchKind)
7481 elog(
ERROR,
"unrecognized matchKind: %d",
7482 (
int) action->matchKind);
7498 const char *
sep =
"";
7503 if (action->targetList)
7505 foreach(
lc2, action->targetList)
7522 if (action->targetList)
7525 if (action->override)
7587 elog(
ERROR,
"unexpected utility statement type");
7628 elog(
ERROR,
"bogus varlevelsup: %d offset %d",
7641 if (var->varnosyn > 0 &&
dpns->plan ==
NULL)
7643 varno = var->varnosyn;
7644 varattno = var->varattnosyn;
7708 refname =
dpns->ret_old_alias;
7710 refname =
dpns->ret_new_alias;
7712 refname = (
char *)
list_nth(
dpns->rtable_names, varno - 1);
7744 elog(
ERROR,
"invalid attnum %d for relation \"%s\"",
7778 if (
rte->joinaliasvars ==
NIL)
7779 elog(
ERROR,
"cannot decompile join alias var in plan tree");
7807 elog(
ERROR,
"invalid attnum %d for relation \"%s\"",
7853 colno - 1)->attname);
7855 colname =
tle->resname;
7926 (*callback) (node, context, callback_arg);
8001 (*callback) (node, context, callback_arg);
8086 elog(
ERROR,
"bogus varlevelsup: %d offset %d",
8096 if (var->varnosyn > 0 &&
dpns->plan ==
NULL)
8098 varno = var->varnosyn;
8099 varattno = var->varattnosyn;
8129 elog(
ERROR,
"bogus varattno for OUTER_VAR var: %d", varattno);
8148 elog(
ERROR,
"bogus varattno for INNER_VAR var: %d", varattno);
8166 elog(
ERROR,
"bogus varattno for INDEX_VAR var: %d", varattno);
8194 expr = (
Node *) var;
8196 switch (
rte->rtekind)
8218 elog(
ERROR,
"subquery %s does not have attribute %d",
8274 if (!
dpns->inner_plan)
8286 elog(
ERROR,
"bogus varattno for subquery var: %d",
8301 if (
rte->joinaliasvars ==
NIL)
8302 elog(
ERROR,
"cannot decompile join alias var in plan tree");
8354 elog(
ERROR,
"CTE %s does not have attribute %d",
8405 if (!
dpns->inner_plan)
8418 elog(
ERROR,
"bogus varattno for subquery var: %d",
8481 foreach(
lc,
dpns->ancestors)
8494 foreach(
lc2,
nl->nestParams)
8522 if (paramid == param->
paramid)
8544 elog(
ERROR,
"SubPlan cannot be outermost ancestor");
8614 if (paramid == param->
paramid)
8626 foreach(
lc,
dpns->ancestors)
8639 if (paramid == param->
paramid)
8677 if (paramid == param->
paramid)
8780 if (
dpns->argnames &&
8784 char *argname =
dpns->argnames[param->
paramid - 1];
9151 while (
str->len > 0 &&
str->data[
str->len - 1] ==
' ')
9152 str->data[--(
str->len)] =
'\0';
9444 expr->
useOr ?
"ANY" :
"ALL");
9660 const char *fieldname;
9905 if (arrayexpr->elements ==
NIL)
9941 if (tupdesc ==
NULL ||
9951 if (tupdesc !=
NULL)
10183 Assert(!con->constisnull);
10186 " PRESERVE WHITESPACE");
10189 " STRIP WHITESPACE");
10206 if (con->constisnull)
10214 ", STANDALONE YES");
10218 ", STANDALONE NO");
10222 ", STANDALONE NO VALUE");
10266 if (
ntest->argisrow ||
10269 switch (
ntest->nulltesttype)
10278 elog(
ERROR,
"unrecognized nulltesttype: %d",
10279 (
int)
ntest->nulltesttype);
10284 switch (
ntest->nulltesttype)
10293 elog(
ERROR,
"unrecognized nulltesttype: %d",
10294 (
int)
ntest->nulltesttype);
10309 switch (
btest->booltesttype)
10330 elog(
ERROR,
"unrecognized booltesttype: %d",
10331 (
int)
btest->booltesttype);
10353 ctest->resulttypmod,
10428 if (
iexpr->infercollid)
10433 if (
iexpr->inferopclass)
10435 Oid inferopclass =
iexpr->inferopclass;
10463 if (
spec->is_default)
10469 switch (
spec->strategy)
10485 foreach(cell,
spec->listdatums)
10509 elog(
ERROR,
"unrecognized partition strategy: %d",
10510 (
int)
spec->strategy);
10581 elog(
ERROR,
"unrecognized JsonExpr op: %d",
10591 if (
jexpr->passing_values)
10632 foreach(l, (
List *) node)
10666 if (node &&
IsA(node,
Var))
10821 false, (
Node *) expr);
10833 Oid rettype = expr->funcresulttype;
10864 errmsg(
"too many arguments")));
10867 foreach(l, expr->
args)
10879 argnames, argtypes,
10880 expr->funcvariadic,
10884 foreach(l, expr->
args)
10950 argtypes, aggref->aggvariadic,
10965 Assert(!aggref->aggvariadic);
10974 if (aggref->aggstar)
10982 foreach(l, aggref->
args)
11043 elog(
ERROR,
"combining Aggref does not point to an Aggref");
11045 aggref = (
Aggref *) node;
11077 errmsg(
"too many arguments")));
11080 foreach(l, wfunc->
args)
11092 argtypes,
false,
NULL,
11098 if (wfunc->winstar)
11145 elog(
ERROR,
"could not find window clause for winref %u",
11170 elog(
ERROR,
"could not find window clause for winref %u",
11253 !con->constisnull);
11273 !con->constisnull);
11297 !con->constisnull);
11456 ((
Const *)
arg)->consttype == resulttype &&
11506 if (constval->constisnull)
11517 constval->consttypmod));
11610 needlabel |= (constval->consttypmod >= 0);
11619 constval->consttypmod));
11636 if (constval->constcollid != typcollation)
11667 " FORMAT JSONB" :
" FORMAT JSON");
11725 switch (
ctor->type)
11773 if (
ctor->absent_on_null)
11818 elog(
ERROR,
"invalid JsonConstructorExpr underlying node type: %d",
11917 elog(
ERROR,
"unrecognized testexpr type: %d",
11923 switch (
sublink->subLinkType)
11952 elog(
ERROR,
"unrecognized sublink type: %d",
11982 if (tf->ns_uris !=
NIL)
12030 forfive(l1, tf->colnames, l2, tf->coltypes, l3, tf->coltypmods,
12031 l4, tf->
colexprs, l5, tf->coldefexprs)
12038 bool ordinality = (tf->ordinalitycol == colnum);
12046 ordinality ?
"FOR ORDINALITY" :
12051 if (coldefexpr !=
NULL)
12057 if (colexpr !=
NULL)
12146 if (colnum > scan->
colMax)
12149 if (colnum > scan->
colMin)
12154 ordinality = !colexpr;
12159 ordinality ?
"FOR ORDINALITY" :
12185 " FORMAT JSONB" :
" FORMAT JSON");
12234 if (
jexpr->passing_values)
12323 if (!
rte->inFromCl)
12411 switch (
rte->rtekind)
12465 foreach(
lc,
rte->functions)
12471 rtfunc->funccolnames !=
NIL)
12482 foreach(
lc,
rte->functions)
12499 foreach(
lc,
rte->functions)
12506 if (rtfunc->funccolnames !=
NIL)
12521 if (
rte->funcordinality)
12537 elog(
ERROR,
"unrecognized RTE kind: %d", (
int)
rte->rtekind);
12575 switch (
j->jointype)
12608 elog(
ERROR,
"unrecognized join type: %d",
12609 (
int)
j->jointype);
12618 if (
j->usingClause)
12627 char *colname = (
char *)
lfirst(
lc);
12637 if (
j->join_using_alias)
12660 if (
j->alias !=
NULL)
12676 elog(
ERROR,
"unrecognized node type: %d",
12699 else if (
colinfo->printaliases)
12741 if (
strcmp(refname,
rte->ctename) != 0)
12769 char *colname =
colinfo->new_colnames[
i];
12811 forfour(l1, rtfunc->funccoltypes,
12812 l2, rtfunc->funccoltypmods,
12813 l3, rtfunc->funccolcollations,
12814 l4, rtfunc->funccolnames)
12863 false,
NULL,
false));
12866 foreach(l, tablesample->
args)
12902 elog(
ERROR,
"cache lookup failed for opclass %u", opclass);
12937 return &
buf.data[1];
12970 elog(
ERROR,
"argument type %s of FieldStore is not a tuple type",
13079 for (ptr =
ident; *ptr; ptr++)
13083 if ((
ch >=
'a' &&
ch <=
'z') ||
13084 (
ch >=
'0' &&
ch <=
'9') ||
13123 for (ptr =
ident; *ptr; ptr++)
13169 elog(
ERROR,
"cache lookup failed for relation %u", relid);
13196 elog(
ERROR,
"cache lookup failed for relation %u", relid);
13202 foreach(
nslist, namespaces)
13254 elog(
ERROR,
"cache lookup failed for relation %u", relid);
13260 elog(
ERROR,
"cache lookup failed for namespace %u",
13310 elog(
ERROR,
"cache lookup failed for function %u", funcid);
13356 NIL, argnames, nargs, argtypes,
13521 elog(
ERROR,
"cache lookup failed for type %u", typid);
13553 elog(
ERROR,
"cache lookup failed for type %u", typid);
13559 elog(
ERROR,
"cache lookup failed for namespace %u",
13678 char *result =
NULL;
13685 elog(
ERROR,
"cache lookup failed for relation %u", relid);
const IndexAmRoutine * GetIndexAmRoutine(Oid amhandler)
#define DatumGetArrayTypeP(X)
ArrayBuildState * accumArrayResult(ArrayBuildState *astate, Datum dvalue, bool disnull, Oid element_type, MemoryContext rcontext)
Datum array_ref(ArrayType *array, int nSubscripts, int *indx, int arraytyplen, int elmlen, bool elmbyval, char elmalign, bool *isNull)
void deconstruct_array_builtin(const ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
Datum makeArrayResult(ArrayBuildState *astate, MemoryContext rcontext)
#define InvalidAttrNumber
char * get_tablespace_name(Oid spc_oid)
Bitmapset * bms_make_singleton(int x)
bool bms_is_subset(const Bitmapset *a, const Bitmapset *b)
bool bms_is_member(int x, const Bitmapset *a)
Bitmapset * bms_add_member(Bitmapset *a, int x)
Bitmapset * bms_union(const Bitmapset *a, const Bitmapset *b)
#define TextDatumGetCString(d)
#define Assert(condition)
#define SQL_STR_DOUBLE(ch, escape_backslash)
#define OidIsValid(objectId)
const uint8 ScanKeywordCategories[SCANKEYWORDS_NUM_KEYWORDS]
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
void hash_destroy(HTAB *hashp)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
#define palloc0_array(type, count)
#define palloc0_object(type)
char * OidOutputFunctionCall(Oid functionId, Datum val)
#define PG_GETARG_TEXT_PP(n)
#define DatumGetByteaPP(X)
#define DirectFunctionCall1(func, arg1)
#define PG_RETURN_TEXT_P(x)
#define PG_RETURN_NAME(x)
#define PG_GETARG_INT32(n)
#define PG_GETARG_BOOL(n)
#define PG_RETURN_DATUM(x)
int get_func_trftypes(HeapTuple procTup, Oid **p_trftypes)
int get_func_arg_info(HeapTuple procTup, Oid **p_argtypes, char ***p_argnames, char **p_argmodes)
TupleDesc get_expr_result_tupdesc(Node *expr, bool noError)
void systable_endscan(SysScanDesc sysscan)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
int GetConfigOptionFlags(const char *name, bool missing_ok)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
Oid GetDefaultOpClass(Oid type_id, Oid am_id)
PGDLLIMPORT const ScanKeywordList ScanKeywords
#define UNRESERVED_KEYWORD
int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords)
List * lappend(List *list, void *datum)
List * list_copy_tail(const List *oldlist, int nskip)
List * list_delete_first(List *list)
List * list_concat(List *list1, const List *list2)
List * list_copy(const List *oldlist)
List * lcons(void *datum, List *list)
void list_free(List *list)
char * get_rel_name(Oid relid)
AttrNumber get_attnum(Oid relid, const char *attname)
Oid get_opclass_input_type(Oid opclass)
bool type_is_rowtype(Oid typid)
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
Datum get_attoptions(Oid relid, int16 attnum)
char get_rel_relkind(Oid relid)
Oid get_typcollation(Oid typid)
char * get_language_name(Oid langoid, bool missing_ok)
char * get_namespace_name_or_temp(Oid nspid)
char * get_constraint_name(Oid conoid)
char * get_attname(Oid relid, AttrNumber attnum, bool missing_ok)
Oid get_rel_tablespace(Oid relid)
Oid get_typ_typrelid(Oid typid)
Oid get_base_element_type(Oid typid)
char * get_namespace_name(Oid nspid)
void get_type_category_preferred(Oid typid, char *typcategory, bool *typispreferred)
void get_atttypetypmodcoll(Oid relid, AttrNumber attnum, Oid *typid, int32 *typmod, Oid *collid)
Alias * makeAlias(const char *aliasname, List *colnames)
int pg_mbcliplen(const char *mbstr, int len, int limit)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define CHECK_FOR_INTERRUPTS()
Datum namein(PG_FUNCTION_ARGS)
bool CollationIsVisible(Oid collid)
bool RelationIsVisible(Oid relid)
bool OpclassIsVisible(Oid opcid)
RangeVar * makeRangeVarFromNameList(const List *names)
#define RangeVarGetRelid(relation, lockmode, missing_ok)
Oid exprType(const Node *expr)
bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
int32 exprTypmod(const Node *expr)
Oid exprCollation(const Node *expr)
Node * strip_implicit_coercions(Node *node)
#define DO_AGGSPLIT_SKIPFINAL(as)
#define IsA(nodeptr, _type_)
#define DO_AGGSPLIT_COMBINE(as)
#define castNode(_type_, nodeptr)
#define repalloc0_array(pointer, type, oldcount, count)
int get_aggregate_argtypes(Aggref *aggref, Oid *inputTypes)
FuncDetailCode func_get_detail(List *funcname, List *fargs, List *fargnames, int nargs, Oid *argtypes, bool expand_variadic, bool expand_defaults, bool include_out_arguments, int *fgc_flags, Oid *funcid, Oid *rettype, bool *retset, int *nvargs, Oid *vatype, Oid **true_typeids, List **argdefaults)
Operator left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
Operator oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId, bool noError, int location)
char * get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum)
TargetEntry * get_tle_by_resno(List *tlist, AttrNumber resno)
void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, VarReturningType returning_type, int location, bool include_dropped, List **colnames, List **colvars)
#define FRAMEOPTION_END_CURRENT_ROW
#define FRAMEOPTION_END_OFFSET
#define FRAMEOPTION_EXCLUDE_CURRENT_ROW
#define FKCONSTR_ACTION_RESTRICT
#define FRAMEOPTION_END_OFFSET_PRECEDING
#define FRAMEOPTION_START_UNBOUNDED_PRECEDING
#define GetCTETargetList(cte)
#define FKCONSTR_ACTION_SETDEFAULT
@ PARTITION_STRATEGY_HASH
@ PARTITION_STRATEGY_LIST
@ PARTITION_STRATEGY_RANGE
#define FRAMEOPTION_START_CURRENT_ROW
#define FKCONSTR_MATCH_SIMPLE
#define FRAMEOPTION_START_OFFSET
@ PARTITION_RANGE_DATUM_MAXVALUE
@ PARTITION_RANGE_DATUM_MINVALUE
#define FKCONSTR_MATCH_PARTIAL
#define FRAMEOPTION_END_OFFSET_FOLLOWING
#define FRAMEOPTION_EXCLUDE_TIES
#define FRAMEOPTION_RANGE
#define FRAMEOPTION_EXCLUDE_GROUP
#define FKCONSTR_ACTION_CASCADE
#define FRAMEOPTION_GROUPS
#define FRAMEOPTION_BETWEEN
#define FKCONSTR_ACTION_SETNULL
#define FRAMEOPTION_END_UNBOUNDED_FOLLOWING
#define FRAMEOPTION_START_OFFSET_PRECEDING
#define FRAMEOPTION_START_OFFSET_FOLLOWING
#define FRAMEOPTION_NONDEFAULT
#define FKCONSTR_MATCH_FULL
#define FKCONSTR_ACTION_NOACTION
#define rt_fetch(rangetable_index, rangetable)
Expr * get_partition_qual_relid(Oid relid)
FormData_pg_aggregate * Form_pg_aggregate
FormData_pg_am * Form_pg_am
FormData_pg_attribute * Form_pg_attribute
FormData_pg_authid * Form_pg_authid
FormData_pg_class * Form_pg_class
FormData_pg_collation * Form_pg_collation
AttrNumber extractNotNullColumn(HeapTuple constrTup)
FormData_pg_constraint * Form_pg_constraint
FormData_pg_depend * Form_pg_depend
FormData_pg_index * Form_pg_index
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
#define lsecond_node(type, l)
#define forboth(cell1, list1, cell2, list2)
#define foreach_current_index(var_or_cell)
#define for_each_cell(cell, lst, initcell)
#define for_each_from(cell, lst, N)
static void * list_nth(const List *list, int n)
#define foreach_node(type, var, lst)
#define forfour(cell1, list1, cell2, list2, cell3, list3, cell4, list4)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
#define forfive(cell1, list1, cell2, list2, cell3, list3, cell4, list4, cell5, list5)
#define list_make2(x1, x2)
#define foreach_int(var, lst)
static int list_cell_number(const List *l, const ListCell *c)
#define lthird_node(type, l)
FormData_pg_opclass * Form_pg_opclass
FormData_pg_operator * Form_pg_operator
FormData_pg_partitioned_table * Form_pg_partitioned_table
FormData_pg_proc * Form_pg_proc
FormData_pg_statistic_ext * Form_pg_statistic_ext
static char buf[DEFAULT_XLOG_SEG_SIZE]
FormData_pg_trigger * Form_pg_trigger
FormData_pg_type * Form_pg_type
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static Name DatumGetName(Datum X)
static Oid DatumGetObjectId(Datum X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
static char DatumGetChar(Datum X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
static int16 DatumGetInt16(Datum X)
static int32 DatumGetInt32(Datum X)
@ SVFOP_CURRENT_TIMESTAMP
@ SVFOP_CURRENT_TIMESTAMP_N
#define PARSER_IGNORE_NULLS
@ JSON_BEHAVIOR_EMPTY_ARRAY
@ OVERRIDING_SYSTEM_VALUE
@ MERGE_WHEN_NOT_MATCHED_BY_TARGET
@ MERGE_WHEN_NOT_MATCHED_BY_SOURCE
void * stringToNode(const char *str)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
void AcquireRewriteLocks(Query *parsetree, bool forExecute, bool forUpdatePushedDown)
Query * getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr)
#define ViewSelectRuleName
Datum pg_get_triggerdef_ext(PG_FUNCTION_ARGS)
static void make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc, int prettyFlags, int wrapColumn)
static void removeStringInfoSpaces(StringInfo str)
static bool looks_like_function(Node *node)
Datum pg_get_partition_constraintdef(PG_FUNCTION_ARGS)
static char * get_rtable_name(int rtindex, deparse_context *context)
Datum pg_get_viewdef_wrap(PG_FUNCTION_ARGS)
static int decompile_column_index_array(Datum column_index_array, Oid relId, bool withPeriod, StringInfo buf)
static void set_relation_column_names(deparse_namespace *dpns, RangeTblEntry *rte, deparse_columns *colinfo)
static void appendContextKeyword(deparse_context *context, const char *str, int indentBefore, int indentAfter, int indentPlus)
List * deparse_context_for_plan_tree(PlannedStmt *pstmt, List *rtable_names)
char * pg_get_statisticsobjdef_string(Oid statextid)
Datum pg_get_indexdef_ext(PG_FUNCTION_ARGS)
static void set_using_names(deparse_namespace *dpns, Node *jtnode, List *parentUsing)
static Plan * find_recursive_union(deparse_namespace *dpns, WorkTableScan *wtscan)
static text * string_to_text(char *str)
static void get_values_def(List *values_lists, deparse_context *context)
#define PRETTYINDENT_LIMIT
Datum pg_get_viewdef(PG_FUNCTION_ARGS)
static char * make_colname_unique(char *colname, deparse_namespace *dpns, deparse_columns *colinfo)
static void get_json_behavior(JsonBehavior *behavior, deparse_context *context, const char *on)
static const char * get_simple_binary_op_name(OpExpr *expr)
static void get_json_agg_constructor(JsonConstructorExpr *ctor, deparse_context *context, const char *funcname, bool is_json_objectagg)
Datum pg_get_constraintdef(PG_FUNCTION_ARGS)
static void set_deparse_for_query(deparse_namespace *dpns, Query *query, List *parent_namespaces)
static void print_function_trftypes(StringInfo buf, HeapTuple proctup)
void(* rsv_callback)(Node *node, deparse_context *context, void *callback_arg)
char * quote_qualified_identifier(const char *qualifier, const char *ident)
static void get_setop_query(Node *setOp, Query *query, deparse_context *context)
#define PRETTYINDENT_JOIN
static bool is_input_argument(int nth, const char *argmodes)
static void get_query_def(Query *query, StringInfo buf, List *parentnamespace, TupleDesc resultDesc, bool colNamesVisible, int prettyFlags, int wrapColumn, int startIndent)
static void get_tablesample_def(TableSampleClause *tablesample, deparse_context *context)
Datum pg_get_functiondef(PG_FUNCTION_ARGS)
Datum pg_get_function_result(PG_FUNCTION_ARGS)
Datum pg_get_indexdef(PG_FUNCTION_ARGS)
static void get_sublink_expr(SubLink *sublink, deparse_context *context)
static const char * get_name_for_var_field(Var *var, int fieldno, int levelsup, deparse_context *context)
static void get_rte_alias(RangeTblEntry *rte, int varno, bool use_as, deparse_context *context)
Datum pg_get_function_arg_default(PG_FUNCTION_ARGS)
static void get_parameter(Param *param, deparse_context *context)
static void build_colinfo_names_hash(deparse_columns *colinfo)
Datum pg_get_statisticsobjdef_expressions(PG_FUNCTION_ARGS)
static void get_delete_query_def(Query *query, deparse_context *context)
Datum pg_get_ruledef(PG_FUNCTION_ARGS)
static void get_json_table_columns(TableFunc *tf, JsonTablePathScan *scan, deparse_context *context, bool showimplicit)
#define PRETTYFLAG_INDENT
static void get_column_alias_list(deparse_columns *colinfo, deparse_context *context)
Datum pg_get_statisticsobjdef_columns(PG_FUNCTION_ARGS)
Datum pg_get_statisticsobjdef(PG_FUNCTION_ARGS)
static void add_to_names_hash(deparse_columns *colinfo, const char *name)
static void simple_quote_literal(StringInfo buf, const char *val)
static bool colname_is_unique(const char *colname, deparse_namespace *dpns, deparse_columns *colinfo)
static void get_from_clause_coldeflist(RangeTblFunction *rtfunc, deparse_columns *colinfo, deparse_context *context)
char * pg_get_partkeydef_columns(Oid relid, bool pretty)
static void get_from_clause(Query *query, const char *prefix, deparse_context *context)
List * deparse_context_for(const char *aliasname, Oid relid)
static bool get_func_sql_syntax(FuncExpr *expr, deparse_context *context)
Datum pg_get_partkeydef(PG_FUNCTION_ARGS)
static char * generate_qualified_relation_name(Oid relid)
static void set_simple_column_names(deparse_namespace *dpns)
static void get_json_expr_options(JsonExpr *jsexpr, deparse_context *context, JsonBehaviorType default_behavior)
char * pg_get_indexdef_columns(Oid indexrelid, bool pretty)
#define PRETTY_INDENT(context)
static void get_rule_groupingset(GroupingSet *gset, List *targetlist, bool omit_parens, deparse_context *context)
char * pg_get_indexdef_columns_extended(Oid indexrelid, bits16 flags)
static char * pg_get_indexdef_worker(Oid indexrelid, int colno, const Oid *excludeOps, bool attrsOnly, bool keysOnly, bool showTblSpc, bool inherits, int prettyFlags, bool missing_ok)
static char * pg_get_constraintdef_worker(Oid constraintId, bool fullCommand, int prettyFlags, bool missing_ok)
static void get_rule_expr_funccall(Node *node, deparse_context *context, bool showimplicit)
static char * generate_function_name(Oid funcid, int nargs, List *argnames, Oid *argtypes, bool has_variadic, bool *use_variadic_p, bool inGroupBy)
static void expand_colnames_array_to(deparse_columns *colinfo, int n)
static void get_returning_clause(Query *query, deparse_context *context)
List * set_deparse_context_plan(List *dpcontext, Plan *plan, List *ancestors)
static SubPlan * find_param_generator(Param *param, deparse_context *context, int *column_p)
static void add_cast_to(StringInfo buf, Oid typid)
static void get_special_variable(Node *node, deparse_context *context, void *callback_arg)
static void get_windowfunc_expr_helper(WindowFunc *wfunc, deparse_context *context, const char *funcname, const char *options, bool is_json_objectagg)
static void get_rule_list_toplevel(List *lst, deparse_context *context, bool showimplicit)
static char * pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok)
#define deparse_columns_fetch(rangetable_index, dpns)
static void get_json_constructor(JsonConstructorExpr *ctor, deparse_context *context, bool showimplicit)
static const char *const query_getrulebyoid
static void get_json_path_spec(Node *path_spec, deparse_context *context, bool showimplicit)
static void printSubscripts(SubscriptingRef *sbsref, deparse_context *context)
static SubPlan * find_param_generator_initplan(Param *param, Plan *plan, int *column_p)
static void pop_ancestor_plan(deparse_namespace *dpns, deparse_namespace *save_dpns)
static void get_window_frame_options(int frameOptions, Node *startOffset, Node *endOffset, deparse_context *context)
static void get_rule_expr_paren(Node *node, deparse_context *context, bool showimplicit, Node *parentNode)
bool quote_all_identifiers
static void get_agg_expr(Aggref *aggref, deparse_context *context, Aggref *original_aggref)
static void get_const_collation(Const *constval, deparse_context *context)
static void get_target_list(List *targetList, deparse_context *context)
static SPIPlanPtr plan_getrulebyoid
static void get_json_table_nested_columns(TableFunc *tf, JsonTablePlan *plan, deparse_context *context, bool showimplicit, bool needcomma)
static char * deparse_expression_pretty(Node *expr, List *dpcontext, bool forceprefix, bool showimplicit, int prettyFlags, int startIndent)
Datum pg_get_ruledef_ext(PG_FUNCTION_ARGS)
char * pg_get_indexdef_string(Oid indexrelid)
static void get_insert_query_def(Query *query, deparse_context *context)
char * pg_get_querydef(Query *query, bool pretty)
static void print_function_sqlbody(StringInfo buf, HeapTuple proctup)
static bool has_dangerous_join_using(deparse_namespace *dpns, Node *jtnode)
const char * quote_identifier(const char *ident)
static Node * get_rule_sortgroupclause(Index ref, List *tlist, bool force_colno, deparse_context *context)
static char * pg_get_viewdef_worker(Oid viewoid, int prettyFlags, int wrapColumn)
static void push_ancestor_plan(deparse_namespace *dpns, ListCell *ancestor_cell, deparse_namespace *save_dpns)
static SPIPlanPtr plan_getviewrule
#define WRAP_COLUMN_DEFAULT
static char * flatten_reloptions(Oid relid)
static text * pg_get_expr_worker(text *expr, Oid relid, int prettyFlags)
static Node * processIndirection(Node *node, deparse_context *context)
static void get_agg_combine_expr(Node *node, deparse_context *context, void *callback_arg)
#define PRETTY_PAREN(context)
Datum pg_get_triggerdef(PG_FUNCTION_ARGS)
List * select_rtable_names_for_explain(List *rtable, Bitmapset *rels_used)
Datum pg_get_function_sqlbody(PG_FUNCTION_ARGS)
Datum pg_get_expr(PG_FUNCTION_ARGS)
static char * generate_qualified_type_name(Oid typid)
static void get_xmltable(TableFunc *tf, deparse_context *context, bool showimplicit)
static void get_utility_query_def(Query *query, deparse_context *context)
static char * get_relation_name(Oid relid)
Datum pg_get_expr_ext(PG_FUNCTION_ARGS)
static void get_rule_windowclause(Query *query, deparse_context *context)
static void get_rule_windowspec(WindowClause *wc, List *targetList, deparse_context *context)
static void get_json_returning(JsonReturning *returning, StringInfo buf, bool json_format_by_default)
Datum pg_get_viewdef_name_ext(PG_FUNCTION_ARGS)
static Node * find_param_referent(Param *param, deparse_context *context, deparse_namespace **dpns_p, ListCell **ancestor_cell_p)
static void get_rule_orderby(List *orderList, List *targetList, bool force_colno, deparse_context *context)
static void pop_child_plan(deparse_namespace *dpns, deparse_namespace *save_dpns)
char * generate_collation_name(Oid collid)
char * pg_get_constraintdef_command(Oid constraintId)
char * pg_get_partconstrdef_string(Oid partitionId, char *aliasname)
static void set_join_column_names(deparse_namespace *dpns, RangeTblEntry *rte, deparse_columns *colinfo)
Datum pg_get_constraintdef_ext(PG_FUNCTION_ARGS)
static void set_rtable_names(deparse_namespace *dpns, List *parent_namespaces, Bitmapset *rels_used)
char * get_window_frame_options_for_explain(int frameOptions, Node *startOffset, Node *endOffset, List *dpcontext, bool forceprefix)
static void get_update_query_targetlist_def(Query *query, List *targetList, deparse_context *context, RangeTblEntry *rte)
static void get_rule_expr(Node *node, deparse_context *context, bool showimplicit)
Datum pg_get_viewdef_ext(PG_FUNCTION_ARGS)
static char * pg_get_partkeydef_worker(Oid relid, int prettyFlags, bool attrsOnly, bool missing_ok)
static void get_oper_expr(OpExpr *expr, deparse_context *context)
Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS)
static char * pg_get_triggerdef_worker(Oid trigid, bool pretty)
#define GET_PRETTY_FLAGS(pretty)
static void get_reloptions(StringInfo buf, Datum reloptions)
static void get_func_expr(FuncExpr *expr, deparse_context *context, bool showimplicit)
static void get_const_expr(Const *constval, deparse_context *context, int showtype)
char * deparse_expression(Node *expr, List *dpcontext, bool forceprefix, bool showimplicit)
void generate_operator_clause(StringInfo buf, const char *leftop, Oid leftoptype, Oid opoid, const char *rightop, Oid rightoptype)
static void make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc, int prettyFlags)
static const char *const query_getviewrule
static char * pg_get_ruledef_worker(Oid ruleoid, int prettyFlags)
static int print_function_arguments(StringInfo buf, HeapTuple proctup, bool print_table_args, bool print_defaults)
static void identify_join_columns(JoinExpr *j, RangeTblEntry *jrte, deparse_columns *colinfo)
static void print_function_rettype(StringInfo buf, HeapTuple proctup)
char * generate_opclass_name(Oid opclass)
static void set_deparse_plan(deparse_namespace *dpns, Plan *plan)
static void get_merge_query_def(Query *query, deparse_context *context)
static void resolve_special_varno(Node *node, deparse_context *context, rsv_callback callback, void *callback_arg)
static void get_json_format(JsonFormat *format, StringInfo buf)
char * get_range_partbound_string(List *bound_datums)
static void get_tablefunc(TableFunc *tf, deparse_context *context, bool showimplicit)
static void get_rule_expr_toplevel(Node *node, deparse_context *context, bool showimplicit)
static RangeTblEntry * get_simple_values_rte(Query *query, TupleDesc resultDesc)
static void get_coercion_expr(Node *arg, deparse_context *context, Oid resulttype, int32 resulttypmod, Node *parentNode)
static void push_child_plan(deparse_namespace *dpns, Plan *plan, deparse_namespace *save_dpns)
static void get_update_query_def(Query *query, deparse_context *context)
static void get_json_constructor_options(JsonConstructorExpr *ctor, StringInfo buf)
static void get_basic_select_query(Query *query, deparse_context *context)
static bool isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
static void get_with_clause(Query *query, deparse_context *context)
static void destroy_colinfo_names_hash(deparse_columns *colinfo)
static char * generate_relation_name(Oid relid, List *namespaces)
static void get_windowfunc_expr(WindowFunc *wfunc, deparse_context *context)
static char * get_variable(Var *var, int levelsup, bool istoplevel, deparse_context *context)
Datum pg_get_serial_sequence(PG_FUNCTION_ARGS)
static char * generate_operator_name(Oid operid, Oid arg1, Oid arg2)
static void get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
Datum pg_get_function_arguments(PG_FUNCTION_ARGS)
static void get_json_table(TableFunc *tf, deparse_context *context, bool showimplicit)
#define PRETTYFLAG_SCHEMA
static void get_select_query_def(Query *query, deparse_context *context)
static void get_opclass_name(Oid opclass, Oid actual_datatype, StringInfo buf)
Datum pg_get_viewdef_name(PG_FUNCTION_ARGS)
Datum pg_get_userbyid(PG_FUNCTION_ARGS)
static void get_agg_expr_helper(Aggref *aggref, deparse_context *context, Aggref *original_aggref, const char *funcname, const char *options, bool is_json_objectagg)
#define RULE_INDEXDEF_PRETTY
#define RULE_INDEXDEF_KEYS_ONLY
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Snapshot GetTransactionSnapshot(void)
void UnregisterSnapshot(Snapshot snapshot)
Snapshot RegisterSnapshot(Snapshot snapshot)
int SPI_fnumber(TupleDesc tupdesc, const char *fname)
SPITupleTable * SPI_tuptable
int SPI_execute_plan(SPIPlanPtr plan, const Datum *Values, const char *Nulls, bool read_only, long tcount)
SPIPlanPtr SPI_prepare(const char *src, int nargs, Oid *argtypes)
int SPI_keepplan(SPIPlanPtr plan)
char * SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation try_relation_open(Oid relationId, LOCKMODE lockmode)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
void check_stack_depth(void)
#define BTEqualStrategyNumber
void resetStringInfo(StringInfo str)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void appendStringInfoSpaces(StringInfo str, int count)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
CTEMaterialize ctematerialized
PartitionRangeDatumKind kind
Node * mergeJoinCondition
OnConflictExpr * onConflict
LockClauseStrength strength
LockWaitPolicy waitPolicy
VarReturningType varreturningtype
Bitmapset * appendparents
AppendRelInfo ** appendrels
Oid values[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, AttrNumber attributeNumber)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
TargetEntry * get_sortgroupref_tle(Index sortref, List *targetList)
int count_nonjunk_tlist_entries(List *tlist)
#define ReleaseTupleDesc(tupdesc)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
static CompactAttribute * TupleDescCompactAttr(TupleDesc tupdesc, int i)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
String * makeString(char *str)
Node * flatten_group_exprs(PlannerInfo *root, Query *query, Node *node)
Relids pull_varnos(PlannerInfo *root, Node *node)
static char * VARDATA_ANY(const void *PTR)
text * cstring_to_text_with_len(const char *s, int len)
bool SplitGUCList(char *rawstring, char separator, List **namelist)
text * cstring_to_text(const char *s)
char * text_to_cstring(const text *t)
List * textToQualifiedNameList(text *textval)
char * map_xml_name_to_sql_identifier(const char *name)
@ XML_STANDALONE_NO_VALUE
static void convert(const int_fast32_t val, char *const buf)