125 bool isAddConstraint);
127 bool skipValidation);
129 List *constraintList);
131 static void setSchemaName(
char *context_schema,
char **stmt_schema_name);
159 bool like_found =
false;
191 (
errcode(ERRCODE_DUPLICATE_TABLE),
192 errmsg(
"relation \"%s\" already exists, skipping",
212 cxt.
stmtType =
"CREATE FOREIGN TABLE";
281 elog(
ERROR,
"unrecognized node type: %d",
312 save_alist = cxt.
alist;
369 if (strcmp(typname,
"smallserial") == 0 ||
370 strcmp(typname,
"serial2") == 0)
376 else if (strcmp(typname,
"serial") == 0 ||
377 strcmp(typname,
"serial4") == 0)
383 else if (strcmp(typname,
"bigserial") == 0 ||
384 strcmp(typname,
"serial8") == 0)
398 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
399 errmsg(
"array of serial is not implemented"),
447 (
errmsg(
"%s will create implicit sequence \"%s\" for serial column \"%s.%s\"",
485 (
Node *) attnamelist));
506 castnode->
arg = (
Node *) snamenode;
527 saw_nullable =
false;
532 constraint =
lfirst(clist);
540 (
errcode(ERRCODE_SYNTAX_ERROR),
541 errmsg(
"conflicting NULL/NOT NULL declarations for column \"%s\" of table \"%s\"",
552 (
errcode(ERRCODE_SYNTAX_ERROR),
553 errmsg(
"conflicting NULL/NOT NULL declarations for column \"%s\" of table \"%s\"",
564 (
errcode(ERRCODE_SYNTAX_ERROR),
565 errmsg(
"multiple default values specified for column \"%s\" of table \"%s\"",
581 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
582 errmsg(
"primary key constraints are not supported on foreign tables"),
590 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
591 errmsg(
"unique constraints are not supported on foreign tables"),
601 elog(
ERROR,
"column exclusion constraints are not supported");
607 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
608 errmsg(
"foreign key constraints are not supported on foreign tables"),
628 elog(
ERROR,
"unrecognized constraint type: %d",
672 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
673 errmsg(
"primary key constraints are not supported on foreign tables"),
682 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
683 errmsg(
"unique constraints are not supported on foreign tables"),
692 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
693 errmsg(
"exclusion constraints are not supported on foreign tables"),
706 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
707 errmsg(
"foreign key constraints are not supported on foreign tables"),
720 elog(
ERROR,
"invalid context for constraint type %d",
725 elog(
ERROR,
"unrecognized constraint type: %d",
756 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
757 errmsg(
"LIKE is not supported for creating foreign tables")));
767 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
768 errmsg(
"\"%s\" is not a table, view, materialized view, composite type, or foreign table",
794 constr = tupleDesc->
constr;
806 for (parent_attno = 1; parent_attno <= tupleDesc->
natts;
810 char *attributeName =
NameStr(attribute->attname);
816 if (attribute->attisdropped)
828 attribute->atttypmod);
837 def->
collOid = attribute->attcollation;
851 if (attribute->atthasdef &&
863 if (attrdef[i].adnum == parent_attno)
881 def->
storage = attribute->attstorage;
889 attribute->attnum)) !=
NULL)
922 bool found_whole_row;
926 attmap, tupleDesc->
natts,
937 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
938 errmsg(
"cannot convert whole-row table reference"),
939 errdetail(
"Constraint \"%s\" contains a whole-row reference to table \"%s\".",
975 relation->
rd_rel->relhasindex)
977 List *parent_indexes;
982 foreach(l, parent_indexes)
992 attmap, tupleDesc->
natts);
1034 ofTypename->
typeOid = ofTypeId;
1037 for (i = 0; i < tupdesc->
natts; i++)
1042 if (attr->attisdropped)
1056 n->
collOid = attr->attcollation;
1099 elog(
ERROR,
"cache lookup failed for relation %u", source_relid);
1105 indrelid = idxrec->indrelid;
1110 elog(
ERROR,
"cache lookup failed for access method %u",
1138 index->
unique = idxrec->indisunique;
1139 index->
primary = idxrec->indisprimary;
1156 if (index->
primary || index->
unique || idxrec->indisexclusion)
1168 elog(
ERROR,
"cache lookup failed for constraint %u",
1177 if (idxrec->indisexclusion)
1189 elog(
ERROR,
"null conexclop for constraint %u",
1194 &elems,
NULL, &nElems);
1196 for (i = 0; i < nElems; i++)
1208 elog(
ERROR,
"cache lookup failed for operator %u",
1247 for (keyno = 0; keyno < idxrec->indnatts; keyno++)
1250 AttrNumber attnum = idxrec->indkey.values[keyno];
1263 iparam->
name = attname;
1270 bool found_whole_row;
1272 if (indexpr_item ==
NULL)
1273 elog(
ERROR,
"too few entries in indexprs list");
1275 indexpr_item =
lnext(indexpr_item);
1280 attmap, attmap_length,
1284 if (found_whole_row)
1286 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1287 errmsg(
"cannot convert whole-row table reference"),
1288 errdetail(
"Index \"%s\" contains a whole-row table reference.",
1292 iparam->
expr = indexkey;
1347 bool found_whole_row;
1356 attmap, attmap_length,
1360 if (found_whole_row)
1362 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1363 errmsg(
"cannot convert whole-row table reference"),
1364 errdetail(
"Index \"%s\" contains a whole-row table reference.",
1399 elog(
ERROR,
"cache lookup failed for collation %u", collation);
1426 elog(
ERROR,
"cache lookup failed for opclass %u", opclass);
1473 indexlist =
lappend(indexlist, index);
1485 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
1486 errmsg(
"multiple primary keys for table \"%s\" are not allowed",
1491 indexlist =
lappend(indexlist, index);
1510 foreach(lc, indexlist)
1518 if (index == cxt->
pkey)
1521 foreach(k, cxt->
alist)
1571 (
errcode(ERRCODE_INVALID_TABLE_DEFINITION),
1572 errmsg(
"multiple primary keys for table \"%s\" are not allowed",
1613 char *index_name = constraint->
indexname;
1619 Datum indclassDatum;
1633 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1634 errmsg(
"cannot use an existing index in CREATE TABLE"),
1642 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1643 errmsg(
"index \"%s\" does not exist", index_name),
1653 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1654 errmsg(
"index \"%s\" is already associated with a constraint",
1661 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1662 errmsg(
"index \"%s\" does not belong to table \"%s\"",
1668 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1669 errmsg(
"index \"%s\" is not valid", index_name),
1672 if (!index_form->indisunique)
1674 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1675 errmsg(
"\"%s\" is not a unique index", index_name),
1676 errdetail(
"Cannot create a primary key or unique constraint using such an index."),
1681 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1682 errmsg(
"index \"%s\" contains expressions", index_name),
1683 errdetail(
"Cannot create a primary key or unique constraint using such an index."),
1688 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1689 errmsg(
"\"%s\" is a partial index", index_name),
1690 errdetail(
"Cannot create a primary key or unique constraint using such an index."),
1698 if (!index_form->indimmediate && !constraint->
deferrable)
1700 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1701 errmsg(
"\"%s\" is a deferrable index", index_name),
1702 errdetail(
"Cannot create a non-deferrable constraint using a deferrable index."),
1714 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1715 errmsg(
"index \"%s\" is not a btree", index_name),
1724 for (i = 0; i < index_form->indnatts; i++)
1726 int16 attnum = index_form->indkey.values[
i];
1738 Assert(attnum <= heap_rel->rd_att->natts);
1743 heap_rel->
rd_rel->relhasoids);
1754 index_rel->
rd_rel->relam);
1755 if (indclass->
values[i] != defopclass ||
1758 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1759 errmsg(
"index \"%s\" does not have default sorting behavior", index_name),
1760 errdetail(
"Cannot create a primary key or unique constraint using such an index."),
1806 foreach(lc, constraint->
keys)
1814 foreach(columns, cxt->
columns)
1818 if (strcmp(column->
colname, key) == 0)
1856 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1857 errmsg(
"inherited relation \"%s\" is not a table or foreign table",
1859 for (count = 0; count < rel->
rd_att->
natts; count++)
1862 char *inhname =
NameStr(inhattr->attname);
1864 if (inhattr->attisdropped)
1866 if (strcmp(key, inhname) == 0)
1893 (
errcode(ERRCODE_UNDEFINED_COLUMN),
1894 errmsg(
"column \"%s\" named in key does not exist", key),
1901 if (iparam->
name && strcmp(key, iparam->
name) == 0)
1905 (
errcode(ERRCODE_DUPLICATE_COLUMN),
1906 errmsg(
"column \"%s\" appears twice in primary key constraint",
1911 (
errcode(ERRCODE_DUPLICATE_COLUMN),
1912 errmsg(
"column \"%s\" appears twice in unique constraint",
1973 bool skipValidation,
bool isAddConstraint)
2007 if (!isAddConstraint)
2022 altercmd->
def = (
Node *) constraint;
2115 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2116 errmsg(
"index expression cannot return a set")));
2126 (
errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
2127 errmsg(
"index expressions and predicates can refer only to the table being indexed")));
2155 List **actions,
Node **whereClause)
2172 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2173 errmsg(
"rules on materialized views are not supported")));
2201 switch (stmt->
event)
2217 elog(
ERROR,
"unrecognized event type: %d",
2233 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2234 errmsg(
"rule WHERE condition cannot contain references to other relations")));
2303 *whereClause !=
NULL)
2305 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2306 errmsg(
"rules with WHERE conditions can only have SELECT, INSERT, UPDATE, or DELETE actions")));
2323 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2324 errmsg(
"conditional UNION/INTERSECT/EXCEPT statements are not implemented")));
2336 switch (stmt->
event)
2341 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2342 errmsg(
"ON SELECT rule cannot use OLD")));
2345 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2346 errmsg(
"ON SELECT rule cannot use NEW")));
2354 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2355 errmsg(
"ON INSERT rule cannot use OLD")));
2360 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2361 errmsg(
"ON DELETE rule cannot use NEW")));
2364 elog(
ERROR,
"unrecognized event type: %d",
2388 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2389 errmsg(
"cannot refer to OLD within WITH query")));
2395 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2396 errmsg(
"cannot refer to NEW within WITH query")));
2422 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2423 errmsg(
"conditional UNION/INTERSECT/EXCEPT statements are not implemented")));
2431 newactions =
lappend(newactions, top_subqry);
2436 *actions = newactions;
2460 const char *queryString)
2470 bool skipValidation =
true;
2497 cxt.
stmtType =
"ALTER FOREIGN TABLE";
2524 foreach(lcmd, stmt->
cmds)
2543 skipValidation =
false;
2551 newcmds =
lappend(newcmds, cmd);
2564 skipValidation =
false;
2567 elog(
ERROR,
"unrecognized node type: %d",
2578 newcmds =
lappend(newcmds, cmd);
2598 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2599 errmsg(
"transform expression must not return a set")));
2602 newcmds =
lappend(newcmds, cmd);
2607 newcmds =
lappend(newcmds, cmd);
2617 save_alist = cxt.
alist;
2631 foreach(l, cxt.
alist)
2639 newcmd->
def = (
Node *) idxstmt;
2640 newcmds =
lappend(newcmds, newcmd);
2650 newcmds =
lappend(newcmds, newcmd);
2657 newcmds =
lappend(newcmds, newcmd);
2666 stmt->
cmds = newcmds;
2689 bool saw_deferrability =
false;
2690 bool saw_initially =
false;
2693 #define SUPPORTS_ATTRS(node) \
2694 ((node) != NULL && \
2695 ((node)->contype == CONSTR_PRIMARY || \
2696 (node)->contype == CONSTR_UNIQUE || \
2697 (node)->contype == CONSTR_EXCLUSION || \
2698 (node)->contype == CONSTR_FOREIGN))
2700 foreach(clist, constraintList)
2705 elog(
ERROR,
"unrecognized node type: %d",
2712 (
errcode(ERRCODE_SYNTAX_ERROR),
2713 errmsg(
"misplaced DEFERRABLE clause"),
2715 if (saw_deferrability)
2717 (
errcode(ERRCODE_SYNTAX_ERROR),
2718 errmsg(
"multiple DEFERRABLE/NOT DEFERRABLE clauses not allowed"),
2720 saw_deferrability =
true;
2727 (
errcode(ERRCODE_SYNTAX_ERROR),
2728 errmsg(
"misplaced NOT DEFERRABLE clause"),
2730 if (saw_deferrability)
2732 (
errcode(ERRCODE_SYNTAX_ERROR),
2733 errmsg(
"multiple DEFERRABLE/NOT DEFERRABLE clauses not allowed"),
2735 saw_deferrability =
true;
2737 if (saw_initially &&
2740 (
errcode(ERRCODE_SYNTAX_ERROR),
2741 errmsg(
"constraint declared INITIALLY DEFERRED must be DEFERRABLE"),
2748 (
errcode(ERRCODE_SYNTAX_ERROR),
2749 errmsg(
"misplaced INITIALLY DEFERRED clause"),
2753 (
errcode(ERRCODE_SYNTAX_ERROR),
2754 errmsg(
"multiple INITIALLY IMMEDIATE/DEFERRED clauses not allowed"),
2756 saw_initially =
true;
2762 if (!saw_deferrability)
2766 (
errcode(ERRCODE_SYNTAX_ERROR),
2767 errmsg(
"constraint declared INITIALLY DEFERRED must be DEFERRABLE"),
2774 (
errcode(ERRCODE_SYNTAX_ERROR),
2775 errmsg(
"misplaced INITIALLY IMMEDIATE clause"),
2779 (
errcode(ERRCODE_SYNTAX_ERROR),
2780 errmsg(
"multiple INITIALLY IMMEDIATE/DEFERRED clauses not allowed"),
2782 saw_initially =
true;
2788 lastprimarycon = con;
2790 saw_deferrability =
false;
2791 saw_initially =
false;
2819 (
errcode(ERRCODE_DATATYPE_MISMATCH),
2820 errmsg(
"collations are not supported by type %s",
2938 elog(
ERROR,
"unrecognized node type: %d",
2961 if (*stmt_schema_name ==
NULL)
2962 *stmt_schema_name = context_schema;
2963 else if (strcmp(context_schema, *stmt_schema_name) != 0)
2965 (
errcode(ERRCODE_INVALID_SCHEMA_DEFINITION),
2966 errmsg(
"CREATE specifies a schema (%s) "
2967 "different from the one being created (%s)",
2968 *stmt_schema_name, context_schema)));
#define list_make2(x1, x2)
Node * map_variable_attnos(Node *node, int target_varno, int sublevels_up, const AttrNumber *attno_map, int map_length, bool *found_whole_row)
Value * makeString(char *str)
#define list_make3(x1, x2, x3)
static List * get_opclass(Oid opclass, Oid actual_datatype)
#define INDOPTION_NULLS_FIRST
Relation relation_openrv(const RangeVar *relation, LOCKMODE lockmode)
Query * getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr)
List * SystemFuncName(char *name)
void * stringToNode(char *str)
FromExpr * makeFromExpr(List *fromlist, Node *quals)
#define IsA(nodeptr, _type_)
Oid GetDefaultOpClass(Oid type_id, Oid am_id)
Type typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
#define IndexIsValid(indexForm)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
bool equal(const void *a, const void *b)
#define RelationGetDescr(relation)
Oid get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok)
#define Anum_pg_class_reloptions
#define DatumGetObjectId(X)
char * pstrdup(const char *in)
#define RelationRelationId
bool expression_returns_set(Node *clause)
Node * transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind)
Form_pg_attribute * attrs
#define Anum_pg_index_indclass
Form_pg_attribute SystemAttributeByName(const char *attname, bool relhasoids)
#define CONSTRAINT_EXCLUSION
int errcode(int sqlerrcode)
char * FigureIndexColname(Node *node)
void relation_close(Relation relation, LOCKMODE lockmode)
List * list_concat(List *list1, List *list2)
FormData_pg_type * Form_pg_type
#define OidIsValid(objectId)
void RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid)
struct IndexAmRoutine * rd_amroutine
#define RELKIND_COMPOSITE_TYPE
#define SearchSysCache1(cacheId, key1)
List * RelationGetIndexPredicate(Relation relation)
struct HeapTupleData * rd_indextuple
ParseState * make_parsestate(ParseState *parentParseState)
void * copyObject(const void *from)
void assign_expr_collations(ParseState *pstate, Node *expr)
Alias * makeAlias(const char *aliasname, List *colnames)
Value * makeInteger(long i)
void cancel_parser_errposition_callback(ParseCallbackState *pcbstate)
SortByNulls nulls_ordering
#define ObjectIdGetDatum(X)
static void transformConstraintAttrs(CreateStmtContext *cxt, List *constraintList)
void check_of_type(HeapTuple typetuple)
Oid get_relname_relid(const char *relname, Oid relnamespace)
char * get_namespace_name(Oid nspid)
Oid get_index_am_oid(const char *amname, bool missing_ok)
List * transformAlterTableStmt(Oid relid, AlterTableStmt *stmt, const char *queryString)
List * RelationGetIndexExpressions(Relation relation)
Oid values[FLEXIBLE_ARRAY_MEMBER]
void aclcheck_error(AclResult aclerr, AclObjectKind objectkind, const char *objectname)
union Value::ValUnion val
int errdetail(const char *fmt,...)
#define DEFAULT_INDEX_TYPE
#define RelationGetRelationName(relation)
static ListCell * list_head(const List *l)
FormData_pg_attribute * Form_pg_attribute
static void transformColumnType(CreateStmtContext *cxt, ColumnDef *column)
Oid get_index_constraint(Oid indexId)
#define RELKIND_FOREIGN_TABLE
const char * p_sourcetext
Oid get_atttype(Oid relid, AttrNumber attnum)
#define ereport(elevel, rest)
#define AssertArg(condition)
void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location)
void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace)
Query * transformStmt(ParseState *pstate, Node *parseTree)
List * lappend(List *list, void *datum)
char * quote_qualified_identifier(const char *qualifier, const char *ident)
DefElem * makeDefElem(char *name, Node *arg)
char * get_relid_attribute_name(Oid relid, AttrNumber attnum)
FormData_pg_index * Form_pg_index
#define AttributeNumberIsValid(attributeNumber)
Oid RangeVarGetAndCheckCreationNamespace(RangeVar *relation, LOCKMODE lockmode, Oid *existing_relation_id)
FuncCall * makeFuncCall(List *name, List *args, int location)
TypeName * SystemTypeName(char *name)
#define TextDatumGetCString(d)
void * palloc0(Size size)
void ReleaseSysCache(HeapTuple tuple)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
static IndexStmt * transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
List * untransformRelOptions(Datum options)
Oid LookupCollation(ParseState *pstate, List *collnames, int location)
TypeName * makeTypeNameFromOid(Oid typeOid, int32 typmod)
Relation heap_openrv(const RangeVar *relation, LOCKMODE lockmode)
Form_pg_attribute SystemAttributeDefinition(AttrNumber attno, bool relhasoids)
Oid get_typcollation(Oid typid)
#define Anum_pg_index_indpred
List * lcons(void *datum, List *list)
static void transformOfType(CreateStmtContext *cxt, TypeName *ofTypename)
FormData_pg_constraint * Form_pg_constraint
#define HeapTupleIsValid(tuple)
#define Assert(condition)
static void setSchemaName(char *context_schema, char **stmt_schema_name)
static void transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column)
void DecrTupleDescRefCount(TupleDesc tupdesc)
Node * transformWhereClause(ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName)
Oid exprType(const Node *expr)
static int list_length(const List *l)
List * transformCreateStmt(CreateStmt *stmt, const char *queryString)
int parser_errposition(ParseState *pstate, int location)
RangeTblEntry * addRangeTableEntryForRelation(ParseState *pstate, Relation rel, Alias *alias, bool inh, bool inFromCl)
CollateClause * collClause
List * RelationGetIndexList(Relation relation)
FormData_pg_operator* Form_pg_operator
static void transformFKConstraints(CreateStmtContext *cxt, bool skipValidation, bool isAddConstraint)
FormData_pg_collation * Form_pg_collation
void index_close(Relation relation, LOCKMODE lockmode)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
#define DatumGetPointer(X)
#define Anum_pg_index_indcollation
bool interpretOidsOption(List *defList, bool allowOids)
void deconstruct_array(ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp)
FormData_pg_class * Form_pg_class
List * transformCreateSchemaStmt(CreateSchemaStmt *stmt)
#define AccessExclusiveLock
FormData_pg_am * Form_pg_am
int errmsg(const char *fmt,...)
char * get_tablespace_name(Oid spc_oid)
#define SUPPORTS_ATTRS(node)
static IndexStmt * generateClonedIndexStmt(CreateStmtContext *cxt, Relation source_idx, const AttrNumber *attmap, int attmap_length)
static celt element(struct vars *v, const chr *startp, const chr *endp)
char * nodeToString(const void *obj)
Relation relation_open(Oid relationId, LOCKMODE lockmode)
bool rangeTableEntry_used(Node *node, int rt_index, int sublevels_up)
#define ConstraintRelationId
char * ChooseRelationName(const char *name1, const char *name2, const char *label, Oid namespaceid)
#define HeapTupleGetOid(tuple)
#define RELPERSISTENCE_TEMP
AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode)
static void transformTableConstraint(CreateStmtContext *cxt, Constraint *constraint)
void free_parsestate(ParseState *pstate)
static void transformIndexConstraints(CreateStmtContext *cxt)
IndexStmt * transformIndexStmt(Oid relid, IndexStmt *stmt, const char *queryString)
static List * get_collation(Oid collation, Oid actual_datatype)
FormData_pg_opclass * Form_pg_opclass
static void transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_clause)
#define RelationGetRelid(relation)
void transformRuleStmt(RuleStmt *stmt, const char *queryString, List **actions, Node **whereClause)
Relation index_open(Oid relationId, LOCKMODE lockmode)
#define Anum_pg_constraint_conexclop
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
static void transformCheckConstraints(CreateStmtContext *cxt, bool skipValidation)
Oid RangeVarGetCreationNamespace(const RangeVar *newRelation)
#define Anum_pg_index_indexprs
#define RelationGetNamespace(relation)
#define DatumGetArrayTypeP(X)