67#include "utils/fmgroids.h"
86#define PRETTYINDENT_STD 8
87#define PRETTYINDENT_JOIN 4
88#define PRETTYINDENT_VAR 4
90#define PRETTYINDENT_LIMIT 40
93#define PRETTYFLAG_PAREN 0x0001
94#define PRETTYFLAG_INDENT 0x0002
95#define PRETTYFLAG_SCHEMA 0x0004
98#define GET_PRETTY_FLAGS(pretty) \
99 ((pretty) ? (PRETTYFLAG_PAREN | PRETTYFLAG_INDENT | PRETTYFLAG_SCHEMA) \
103#define WRAP_COLUMN_DEFAULT 0
106#define PRETTY_PAREN(context) ((context)->prettyFlags & PRETTYFLAG_PAREN)
107#define PRETTY_INDENT(context) ((context)->prettyFlags & PRETTYFLAG_INDENT)
108#define PRETTY_SCHEMA(context) ((context)->prettyFlags & PRETTYFLAG_SCHEMA)
317#define deparse_columns_fetch(rangetable_index, dpns) \
318 ((deparse_columns *) list_nth((dpns)->rtable_columns, (rangetable_index)-1))
341static const char *
const query_getviewrule =
"SELECT * FROM pg_catalog.pg_rewrite WHERE ev_class = $1 AND rulename = $2";
359 int prettyFlags,
int wrapColumn);
368 int prettyFlags,
bool missing_ok);
377 int prettyFlags,
bool missing_ok);
422 int prettyFlags,
int wrapColumn);
424 TupleDesc resultDesc,
bool colNamesVisible,
559#define only_marker(rte) ((rte)->inh ? "" : "ONLY ")
845 elog(
ERROR,
"failed to get pg_rewrite tuple for view %u", viewoid);
1039 tgrel->rd_att, &isnull);
1045 tgrel->rd_att, &isnull);
1050 if (tgoldtable !=
NULL || tgnewtable !=
NULL)
1053 if (tgoldtable !=
NULL)
1056 if (tgnewtable !=
NULL)
1068 tgrel->rd_att, &isnull);
1088 oldrte->relkind = relkind;
1099 newrte->relkind = relkind;
1139 false,
NULL,
false));
1147 tgrel->rd_att, &isnull);
1253 prettyFlags,
false);
1269 prettyFlags,
false);
1283 int prettyFlags,
bool missing_ok)
1317 elog(
ERROR,
"cache lookup failed for index %u", indexrelid);
1342 elog(
ERROR,
"cache lookup failed for relation %u", indexrelid);
1350 elog(
ERROR,
"cache lookup failed for access method %u",
1390 idxrec->indisunique ?
"UNIQUE " :
"",
1407 for (keyno = 0; keyno <
idxrec->indnatts; keyno++)
1420 if (!colno && keyno ==
idxrec->indnkeyatts)
1437 if (!colno || colno == keyno + 1)
1449 elog(
ERROR,
"too few entries in indexprs list");
1455 if (!colno || colno == keyno + 1)
1469 (!colno || colno == keyno + 1))
1523 if (
idxrec->indnullsnotdistinct)
1637 errmsg(
"\"%s\" is not a property graph",
name)));
1723 srckey = isnull ? 0 : datum;
1725 srcref = isnull ? 0 : datum;
1727 destkey = isnull ? 0 : datum;
1729 destref = isnull ? 0 : datum;
1734 elog(
ERROR,
"cache lookup failed for property graph element %u",
pgeform->pgesrcvertexid);
1751 elog(
ERROR,
"cache lookup failed for property graph element %u",
pgeform->pgedestvertexid);
1935 foreach(
lc, outlist)
2085 elog(
ERROR,
"stxkind is not a 1-D char array");
2144 for (colno = 0; colno <
statextrec->stxkeys.dim1; colno++)
2314 elog(
ERROR,
"cache lookup failed for partition key of %u", relid);
2347 elog(
ERROR,
"unexpected node type found in partexprs: %d",
2360 switch (
form->partstrat)
2375 elog(
ERROR,
"unexpected partition strategy: %d",
2376 (
int)
form->partstrat);
2382 for (keyno = 0; keyno <
form->partnatts; keyno++)
2409 elog(
ERROR,
"too few entries in partexprs list");
2472 false, prettyFlags, 0);
2550 int prettyFlags,
bool missing_ok)
2652 switch (
conForm->confmatchtype)
2655 string =
" MATCH FULL";
2658 string =
" MATCH PARTIAL";
2664 elog(
ERROR,
"unrecognized confmatchtype: %d",
2678 string =
"RESTRICT";
2684 string =
"SET NULL";
2687 string =
"SET DEFAULT";
2690 elog(
ERROR,
"unrecognized confupdtype: %d",
2704 string =
"RESTRICT";
2710 string =
"SET NULL";
2713 string =
"SET DEFAULT";
2716 elog(
ERROR,
"unrecognized confdeltype: %d",
2790 &keys,
NULL, &nKeys);
2878 conForm->connoinherit ?
" NO INHERIT" :
"");
2927 &elems,
NULL, &nElems);
2930 for (
i = 0;
i < nElems;
i++)
2960 else if (!
conForm->convalidated)
2986 &keys,
NULL, &nKeys);
2988 for (
j = 0;
j < nKeys;
j++)
3096 errmsg(
"input is a query, not an expression")));
3108 errmsg(
"expression contains variables of more than one relation")));
3115 errmsg(
"expression contains variables")));
3214 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
3312 errmsg(
"\"%s\" is an aggregate function",
name)));
3343 switch (proc->provolatile)
3355 switch (proc->proparallel)
3367 if (proc->proisstrict)
3369 if (proc->prosecdef)
3371 if (proc->proleakproof)
3383 if (proc->prorows > 0 && proc->prorows != 1000)
3386 if (proc->prosupport)
3398 false,
NULL,
false));
3464 elog(
ERROR,
"invalid list syntax in proconfig item");
3628 if (proc->proretset)
3642 if (proc->proretset)
3707 elog(
ERROR,
"cache lookup failed for aggregate %u",
3717 for (
i = 0;
i < numargs;
i++)
3719 Oid argtype = argtypes[
i];
3720 char *argname = argnames ? argnames[
i] :
NULL;
3777 if (argname && argname[0])
3929 dpns.numargs = numargs;
3930 dpns.argnames = argnames;
4083 rte->lateral =
false;
4085 rte->inFromCl =
true;
4121 dpns->rtable_names = rtable_names;
4194 dpns->ancestors = ancestors;
4220 dpns.rtable = rtable;
4227 return dpns.rtable_names;
4266 names_hash =
hash_create(
"set_rtable_names names",
4294 foreach(
lc,
dpns->rtable)
4307 else if (
rte->alias)
4310 refname =
rte->alias->aliasname;
4325 refname =
rte->eref->aliasname;
4401 dpns->ret_old_alias = query->returningOldAlias;
4402 dpns->ret_new_alias = query->returningNewAlias;
4417 dpns->unique_using =
4522 if (
j->alias ==
NULL &&
j->usingClause)
4532 for (
int i = 0;
i <
jrte->joinmergedcols;
i++)
4548 elog(
ERROR,
"unrecognized node type: %d",
4598 leftattnos =
colinfo->leftattnos;
4599 rightattnos =
colinfo->rightattnos;
4614 char *colname =
colinfo->colnames[
i];
4616 if (colname ==
NULL)
4620 if (leftattnos[
i] > 0)
4627 if (rightattnos[
i] > 0)
4668 foreach(
lc,
j->usingClause)
4673 Assert(leftattnos[
i] != 0 && rightattnos[
i] != 0);
4685 if (
dpns->unique_using)
4694 parentUsing =
lappend(parentUsing, colname);
4697 if (leftattnos[
i] > 0)
4704 if (rightattnos[
i] > 0)
4723 elog(
ERROR,
"unrecognized node type: %d",
4759 ncolumns = tupdesc->
natts;
4762 for (
i = 0;
i < ncolumns;
i++)
4766 if (attr->attisdropped)
4798 true , &colnames,
NULL);
4801 colnames =
rte->eref->colnames;
4807 foreach(
lc, colnames)
4815 if (
cname[0] ==
'\0')
4840 colinfo->new_colnames = (
char **)
palloc(ncolumns *
sizeof(
char *));
4841 colinfo->is_new_col = (
bool *)
palloc(ncolumns *
sizeof(
bool));
4856 for (
i = 0;
i < ncolumns;
i++)
4859 char *colname =
colinfo->colnames[
i];
4869 if (colname ==
NULL)
4885 colinfo->new_colnames[
j] = colname;
4921 colinfo->printaliases =
false;
4922 else if (
rte->alias &&
rte->alias->colnames !=
NIL)
4980 char *colname =
colinfo->colnames[
i];
4989 else if (
colinfo->rightattnos[
i] > 0)
5013 if (colname ==
NULL)
5182#ifdef USE_ASSERT_CHECKING
5199 colinfo->printaliases =
false;
5266 foreach(
lc,
dpns->using_names)
5439 elog(
ERROR,
"unrecognized node type in jointree: %d",
5446 elog(
ERROR,
"unrecognized node type in jointree: %d",
5467 foreach(
lc,
jrte->joinleftcols)
5474 foreach(
lc,
jrte->joinrightcols)
5498 return (
char *)
list_nth(
dpns->rtable_names, rtindex - 1);
5529 if (
dpns->outer_plan)
5530 dpns->outer_tlist =
dpns->outer_plan->targetlist;
5571 else if (
dpns->inner_plan)
5572 dpns->inner_tlist =
dpns->inner_plan->targetlist;
5597 foreach(
lc,
dpns->ancestors)
5605 elog(
ERROR,
"could not find RecursiveUnion for WorkTableScan with wtParam %d",
5651 dpns->ancestors = ancestors;
5755 elog(
ERROR,
"invalid empty ev_action list");
5793 errmsg(
"rule \"%s\" has unsupported event type %d",
5794 rulename, ev_type)));
5867 foreach(action, actions)
5900 int prettyFlags,
int wrapColumn)
5949 if (ev_type !=
'1' || !is_instead ||
5959 prettyFlags, wrapColumn, 0);
5985 TupleDesc resultDesc,
bool colNamesVisible,
5996 rtable_size = query->hasGroupRTE ?
6007 if (query->hasGroupRTE)
6076 elog(
ERROR,
"unrecognized query command type: %d",
6095 foreach(
vtl, values_lists)
6145 if (query->hasRecursive)
6146 sep =
"WITH RECURSIVE ";
6155 if (cte->aliascolnames)
6161 foreach(
col, cte->aliascolnames)
6195 if (cte->search_clause)
6201 cte->search_clause->search_breadth_first ?
"BREADTH" :
"DEPTH");
6203 foreach(
lc, cte->search_clause->search_col_list)
6216 if (cte->cycle_clause)
6223 foreach(
lc, cte->cycle_clause->cycle_col_list)
6243 get_rule_expr(cte->cycle_clause->cycle_mark_value, context,
false);
6245 get_rule_expr(cte->cycle_clause->cycle_mark_default, context,
false);
6350 if (query->hasForUpdate)
6382 elog(
ERROR,
"unrecognized LockClauseStrength %d",
6386 return " FOR KEY SHARE";
6388 return " FOR SHARE";
6390 return " FOR NO KEY UPDATE";
6392 return " FOR UPDATE";
6460 colname =
tle->resname;
6500 if (query->isReturn)
6508 if (query->hasDistinctOn)
6619 foreach(l, targetList)
6673 colno - 1)->attname);
6675 colname =
tle->resname;
6753 if (query->returningOldAlias &&
strcmp(query->returningOldAlias,
"old") != 0)
6759 if (query->returningNewAlias &&
strcmp(query->returningNewAlias,
"new") != 0)
6917 elog(
ERROR,
"unrecognized node type: %d",
7016 foreach(l,
gset->content)
7043 foreach(l,
gset->content)
7082 if (
srt->nulls_first)
7085 else if (
srt->sortop == typentry->
gt_opr)
7089 if (!
srt->nulls_first)
7099 if (
srt->nulls_first)
7126 if (wc->name ==
NULL)
7205 Node *startOffset,
Node *endOffset,
7265 buf->data[--(
buf->len)] =
'\0';
7274 Node *startOffset,
Node *endOffset,
7322 foreach(l, query->
rtable)
7329 elog(
ERROR,
"too many subquery RTEs in INSERT");
7336 elog(
ERROR,
"too many values RTEs in INSERT");
7341 elog(
ERROR,
"both subquery and values RTEs in INSERT");
7405 if (query->override)
7447 if (
confl->arbiterElems)
7479 elog(
ERROR,
"cache lookup failed for constraint %u",
7603 if (query->hasSubLinks)
7605 foreach(l, targetList)
7627 foreach(l, targetList)
7844 switch (action->matchKind)
7859 elog(
ERROR,
"unrecognized matchKind: %d",
7860 (
int) action->matchKind);
7876 const char *
sep =
"";
7881 if (action->targetList)
7883 foreach(
lc2, action->targetList)
7900 if (action->targetList)
7903 if (action->override)
7965 elog(
ERROR,
"unexpected utility statement type");
7998 foreach(
lc,
be->args)
8031 const char *
sep =
"";
8071 if (
gep->whereClause)
8095 if (
gep->quantifier)
8171 elog(
ERROR,
"bogus varlevelsup: %d offset %d",
8184 if (var->varnosyn > 0 &&
dpns->plan ==
NULL)
8186 varno = var->varnosyn;
8187 varattno = var->varattnosyn;
8251 refname =
dpns->ret_old_alias;
8253 refname =
dpns->ret_new_alias;
8255 refname = (
char *)
list_nth(
dpns->rtable_names, varno - 1);
8287 elog(
ERROR,
"invalid attnum %d for relation \"%s\"",
8321 if (
rte->joinaliasvars ==
NIL)
8322 elog(
ERROR,
"cannot decompile join alias var in plan tree");
8350 elog(
ERROR,
"invalid attnum %d for relation \"%s\"",
8396 colno - 1)->attname);
8398 colname =
tle->resname;
8469 (*callback) (node, context, callback_arg);
8544 (*callback) (node, context, callback_arg);
8629 elog(
ERROR,
"bogus varlevelsup: %d offset %d",
8639 if (var->varnosyn > 0 &&
dpns->plan ==
NULL)
8641 varno = var->varnosyn;
8642 varattno = var->varattnosyn;
8672 elog(
ERROR,
"bogus varattno for OUTER_VAR var: %d", varattno);
8691 elog(
ERROR,
"bogus varattno for INNER_VAR var: %d", varattno);
8709 elog(
ERROR,
"bogus varattno for INDEX_VAR var: %d", varattno);
8737 expr = (
Node *) var;
8739 switch (
rte->rtekind)
8762 elog(
ERROR,
"subquery %s does not have attribute %d",
8818 if (!
dpns->inner_plan)
8830 elog(
ERROR,
"bogus varattno for subquery var: %d",
8845 if (
rte->joinaliasvars ==
NIL)
8846 elog(
ERROR,
"cannot decompile join alias var in plan tree");
8898 elog(
ERROR,
"CTE %s does not have attribute %d",
8949 if (!
dpns->inner_plan)
8962 elog(
ERROR,
"bogus varattno for subquery var: %d",
9025 foreach(
lc,
dpns->ancestors)
9038 foreach(
lc2,
nl->nestParams)
9066 if (paramid == param->
paramid)
9088 elog(
ERROR,
"SubPlan cannot be outermost ancestor");
9158 if (paramid == param->
paramid)
9170 foreach(
lc,
dpns->ancestors)
9183 if (paramid == param->
paramid)
9221 if (paramid == param->
paramid)
9324 if (
dpns->argnames &&
9328 char *argname =
dpns->argnames[param->
paramid - 1];
9695 while (
str->len > 0 &&
str->data[
str->len - 1] ==
' ')
9696 str->data[--(
str->len)] =
'\0';
9988 expr->
useOr ?
"ANY" :
"ALL");
10204 const char *fieldname;
10449 if (arrayexpr->elements ==
NIL)
10485 if (tupdesc ==
NULL ||
10495 if (tupdesc !=
NULL)
10727 Assert(!con->constisnull);
10730 " PRESERVE WHITESPACE");
10733 " STRIP WHITESPACE");
10750 if (con->constisnull)
10758 ", STANDALONE YES");
10762 ", STANDALONE NO");
10766 ", STANDALONE NO VALUE");
10810 if (
ntest->argisrow ||
10813 switch (
ntest->nulltesttype)
10822 elog(
ERROR,
"unrecognized nulltesttype: %d",
10823 (
int)
ntest->nulltesttype);
10828 switch (
ntest->nulltesttype)
10837 elog(
ERROR,
"unrecognized nulltesttype: %d",
10838 (
int)
ntest->nulltesttype);
10853 switch (
btest->booltesttype)
10874 elog(
ERROR,
"unrecognized booltesttype: %d",
10875 (
int)
btest->booltesttype);
10897 ctest->resulttypmod,
10972 if (
iexpr->infercollid)
10977 if (
iexpr->inferopclass)
10979 Oid inferopclass =
iexpr->inferopclass;
11007 if (
spec->is_default)
11013 switch (
spec->strategy)
11029 foreach(cell,
spec->listdatums)
11053 elog(
ERROR,
"unrecognized partition strategy: %d",
11054 (
int)
spec->strategy);
11125 elog(
ERROR,
"unrecognized JsonExpr op: %d",
11135 if (
jexpr->passing_values)
11176 foreach(l, (
List *) node)
11218 if (node &&
IsA(node,
Var))
11373 false, (
Node *) expr);
11385 Oid rettype = expr->funcresulttype;
11416 errmsg(
"too many arguments")));
11419 foreach(l, expr->
args)
11431 argnames, argtypes,
11432 expr->funcvariadic,
11436 foreach(l, expr->
args)
11502 argtypes, aggref->aggvariadic,
11517 Assert(!aggref->aggvariadic);
11526 if (aggref->aggstar)
11534 foreach(l, aggref->
args)
11595 elog(
ERROR,
"combining Aggref does not point to an Aggref");
11597 aggref = (
Aggref *) node;
11629 errmsg(
"too many arguments")));
11632 foreach(l, wfunc->
args)
11644 argtypes,
false,
NULL,
11650 if (wfunc->winstar)
11697 elog(
ERROR,
"could not find window clause for winref %u",
11722 elog(
ERROR,
"could not find window clause for winref %u",
11805 !con->constisnull);
11825 !con->constisnull);
11849 !con->constisnull);
12008 ((
Const *)
arg)->consttype == resulttype &&
12058 if (constval->constisnull)
12069 constval->consttypmod));
12162 needlabel |= (constval->consttypmod >= 0);
12171 constval->consttypmod));
12188 if (constval->constcollid != typcollation)
12219 " FORMAT JSONB" :
" FORMAT JSON");
12277 switch (
ctor->type)
12325 if (
ctor->absent_on_null)
12370 elog(
ERROR,
"invalid JsonConstructorExpr underlying node type: %d",
12469 elog(
ERROR,
"unrecognized testexpr type: %d",
12475 switch (
sublink->subLinkType)
12504 elog(
ERROR,
"unrecognized sublink type: %d",
12534 if (tf->ns_uris !=
NIL)
12582 forfive(l1, tf->colnames, l2, tf->coltypes, l3, tf->coltypmods,
12583 l4, tf->
colexprs, l5, tf->coldefexprs)
12590 bool ordinality = (tf->ordinalitycol == colnum);
12598 ordinality ?
"FOR ORDINALITY" :
12603 if (coldefexpr !=
NULL)
12609 if (colexpr !=
NULL)
12698 if (colnum > scan->
colMax)
12701 if (colnum > scan->
colMin)
12706 ordinality = !colexpr;
12711 ordinality ?
"FOR ORDINALITY" :
12737 " FORMAT JSONB" :
" FORMAT JSON");
12786 if (
jexpr->passing_values)
12875 if (!
rte->inFromCl)
12963 switch (
rte->rtekind)
13017 foreach(
lc,
rte->functions)
13023 rtfunc->funccolnames !=
NIL)
13034 foreach(
lc,
rte->functions)
13051 foreach(
lc,
rte->functions)
13058 if (rtfunc->funccolnames !=
NIL)
13073 if (
rte->funcordinality)
13089 foreach(
lc,
rte->graph_table_columns)
13119 elog(
ERROR,
"unrecognized RTE kind: %d", (
int)
rte->rtekind);
13157 switch (
j->jointype)
13190 elog(
ERROR,
"unrecognized join type: %d",
13191 (
int)
j->jointype);
13200 if (
j->usingClause)
13209 char *colname = (
char *)
lfirst(
lc);
13219 if (
j->join_using_alias)
13242 if (
j->alias !=
NULL)
13258 elog(
ERROR,
"unrecognized node type: %d",
13281 else if (
colinfo->printaliases)
13323 if (
strcmp(refname,
rte->ctename) != 0)
13351 char *colname =
colinfo->new_colnames[
i];
13393 forfour(l1, rtfunc->funccoltypes,
13394 l2, rtfunc->funccoltypmods,
13395 l3, rtfunc->funccolcollations,
13396 l4, rtfunc->funccolnames)
13445 false,
NULL,
false));
13448 foreach(l, tablesample->
args)
13484 elog(
ERROR,
"cache lookup failed for opclass %u", opclass);
13519 return &
buf.data[1];
13552 elog(
ERROR,
"argument type %s of FieldStore is not a tuple type",
13661 for (ptr =
ident; *ptr; ptr++)
13665 if ((
ch >=
'a' &&
ch <=
'z') ||
13666 (
ch >=
'0' &&
ch <=
'9') ||
13705 for (ptr =
ident; *ptr; ptr++)
13751 elog(
ERROR,
"cache lookup failed for relation %u", relid);
13778 elog(
ERROR,
"cache lookup failed for relation %u", relid);
13784 foreach(
nslist, namespaces)
13836 elog(
ERROR,
"cache lookup failed for relation %u", relid);
13842 elog(
ERROR,
"cache lookup failed for namespace %u",
13892 elog(
ERROR,
"cache lookup failed for function %u", funcid);
13938 NIL, argnames, nargs, argtypes,
14103 elog(
ERROR,
"cache lookup failed for type %u", typid);
14135 elog(
ERROR,
"cache lookup failed for type %u", typid);
14141 elog(
ERROR,
"cache lookup failed for namespace %u",
14260 char *result =
NULL;
14267 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)
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
#define palloc_object(type)
#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 Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
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)
void list_sort(List *list, list_sort_comparator cmp)
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)
char * get_propgraph_property_name(Oid propoid)
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_propgraph_label_name(Oid labeloid)
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)
Datum lower(PG_FUNCTION_ARGS)
Datum upper(PG_FUNCTION_ARGS)
#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)
END_CATALOG_STRUCT typedef FormData_pg_aggregate * Form_pg_aggregate
END_CATALOG_STRUCT typedef FormData_pg_am * Form_pg_am
FormData_pg_attribute * Form_pg_attribute
END_CATALOG_STRUCT typedef FormData_pg_authid * Form_pg_authid
FormData_pg_class * Form_pg_class
END_CATALOG_STRUCT typedef FormData_pg_collation * Form_pg_collation
AttrNumber extractNotNullColumn(HeapTuple constrTup)
END_CATALOG_STRUCT typedef FormData_pg_constraint * Form_pg_constraint
END_CATALOG_STRUCT typedef FormData_pg_depend * Form_pg_depend
END_CATALOG_STRUCT typedef 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 foreach_ptr(type, var, lst)
#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)
END_CATALOG_STRUCT typedef FormData_pg_opclass * Form_pg_opclass
END_CATALOG_STRUCT typedef FormData_pg_operator * Form_pg_operator
END_CATALOG_STRUCT typedef FormData_pg_partitioned_table * Form_pg_partitioned_table
END_CATALOG_STRUCT typedef FormData_pg_proc * Form_pg_proc
END_CATALOG_STRUCT typedef FormData_pg_propgraph_element * Form_pg_propgraph_element
END_CATALOG_STRUCT typedef FormData_pg_propgraph_element_label * Form_pg_propgraph_element_label
END_CATALOG_STRUCT typedef FormData_pg_propgraph_label_property * Form_pg_propgraph_label_property
END_CATALOG_STRUCT typedef FormData_pg_statistic_ext * Form_pg_statistic_ext
static char buf[DEFAULT_XLOG_SEG_SIZE]
END_CATALOG_STRUCT typedef FormData_pg_trigger * Form_pg_trigger
END_CATALOG_STRUCT typedef 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 make_propgraphdef_labels(StringInfo buf, Oid elid, const char *elalias, Oid elrelid)
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)
static void get_graph_label_expr(Node *label_expr, deparse_context *context)
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 char * get_lock_clause_strength(LockClauseStrength strength)
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)
static int propdata_by_name_cmp(const ListCell *a, const ListCell *b)
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)
static void get_path_pattern_expr_def(List *path_pattern_expr, deparse_context *context)
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 int list_oid_str_pair_cmp_by_str(const ListCell *p1, const ListCell *p2)
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)
static void get_graph_pattern_def(GraphPattern *graph_pattern, deparse_context *context)
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 make_propgraphdef_properties(StringInfo buf, Oid ellabelid, Oid elrelid)
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_propgraphdef(PG_FUNCTION_ARGS)
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 make_propgraphdef_elements(StringInfo buf, Oid pgrelid, char pgekind)
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)
Datum SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
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)