81 bool *publish_via_partition_root_given,
82 bool *publish_via_partition_root,
83 bool *publish_generated_columns_given,
84 char *publish_generated_columns)
88 *publish_given =
false;
89 *publish_via_partition_root_given =
false;
90 *publish_generated_columns_given =
false;
97 *publish_via_partition_root =
false;
98 *publish_generated_columns = PUBLISH_GENCOLS_NONE;
105 if (strcmp(defel->
defname,
"publish") == 0)
123 *publish_given =
true;
133 (
errcode(ERRCODE_SYNTAX_ERROR),
134 errmsg(
"invalid list syntax in parameter \"%s\"",
138 foreach(lc2, publish_list)
140 char *publish_opt = (
char *)
lfirst(lc2);
142 if (strcmp(publish_opt,
"insert") == 0)
144 else if (strcmp(publish_opt,
"update") == 0)
146 else if (strcmp(publish_opt,
"delete") == 0)
148 else if (strcmp(publish_opt,
"truncate") == 0)
152 (
errcode(ERRCODE_SYNTAX_ERROR),
153 errmsg(
"unrecognized value for publication option \"%s\": \"%s\"",
154 "publish", publish_opt)));
157 else if (strcmp(defel->
defname,
"publish_via_partition_root") == 0)
159 if (*publish_via_partition_root_given)
161 *publish_via_partition_root_given =
true;
164 else if (strcmp(defel->
defname,
"publish_generated_columns") == 0)
166 if (*publish_generated_columns_given)
168 *publish_generated_columns_given =
true;
173 (
errcode(ERRCODE_SYNTAX_ERROR),
174 errmsg(
"unrecognized publication parameter: \"%s\"", defel->
defname)));
189 if (!pubobjspec_list)
192 foreach(cell, pubobjspec_list)
212 if (search_path ==
NIL)
214 errcode(ERRCODE_UNDEFINED_SCHEMA),
215 errmsg(
"no schema has been selected for CURRENT_SCHEMA"));
289 if (relation->
rd_rel->relreplident == REPLICA_IDENTITY_FULL)
300 if (pubviaroot && relation->
rd_rel->relispartition)
306 publish_as_relid = relid;
317 Anum_pg_publication_rel_prqual,
327 context.
parentid = publish_as_relid;
328 context.
relid = relid;
362 bool pubviaroot,
char pubgencols_type,
363 bool *invalid_column_list,
364 bool *invalid_gen_col)
374 *invalid_column_list =
false;
375 *invalid_gen_col =
false;
385 if (pubviaroot && relation->
rd_rel->relispartition)
390 publish_as_relid = relid;
397 if (relation->
rd_rel->relreplident == REPLICA_IDENTITY_FULL)
400 *invalid_column_list = (columns != NULL);
407 if (pubgencols_type != PUBLISH_GENCOLS_STORED &&
410 *invalid_gen_col =
true;
418 *invalid_gen_col =
true;
420 if (*invalid_gen_col && *invalid_column_list)
446 if (att->attgenerated == ATTRIBUTE_GENERATED_STORED && pubgencols_type != PUBLISH_GENCOLS_STORED)
448 *invalid_gen_col =
true;
456 if (att->attgenerated == ATTRIBUTE_GENERATED_VIRTUAL)
458 *invalid_gen_col =
true;
488 if (*invalid_column_list && *invalid_gen_col)
495 return *invalid_column_list || *invalid_gen_col;
586 char *errdetail_msg = NULL;
596 errdetail_msg =
_(
"System columns are not allowed.");
603 errdetail_msg =
_(
"User-defined operators are not allowed.");
605 case T_ScalarArrayOpExpr:
608 errdetail_msg =
_(
"User-defined operators are not allowed.");
616 case T_RowCompareExpr:
625 errdetail_msg =
_(
"User-defined operators are not allowed.");
649 errdetail_msg =
_(
"Only columns, constants, built-in operators, built-in data types, built-in collations, and immutable built-in functions are allowed.");
658 if (!errdetail_msg && !
IsA(node,
List))
661 errdetail_msg =
_(
"User-defined types are not allowed.");
664 errdetail_msg =
_(
"User-defined or built-in mutable functions are not allowed.");
667 errdetail_msg =
_(
"User-defined collations are not allowed.");
676 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
677 errmsg(
"invalid publication WHERE expression"),
714 Node *whereclause = NULL;
729 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
730 errmsg(
"cannot use publication WHERE clause for relation \"%s\"",
732 errdetail(
"WHERE clause cannot be used for a partitioned table when %s is false.",
733 "publish_via_partition_root")));
749 "PUBLICATION WHERE");
781 bool publish_schema,
bool pubviaroot)
804 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
805 errmsg(
"cannot use column list for relation \"%s.%s\" in publication \"%s\"",
808 errdetail(
"Column lists cannot be specified in publications containing FOR TABLES IN SCHEMA elements."));
818 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
819 errmsg(
"cannot use column list for relation \"%s.%s\" in publication \"%s\"",
822 errdetail(
"Column lists cannot be specified for partitioned tables when %s is false.",
823 "publish_via_partition_root")));
836 bool nulls[Natts_pg_publication];
841 bool publish_via_partition_root_given;
842 bool publish_via_partition_root;
843 bool publish_generated_columns_given;
844 char publish_generated_columns;
858 if (
stmt->for_all_tables ||
stmt->for_all_sequences)
860 errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
861 errmsg(
"must be superuser to create a FOR ALL TABLES or ALL SEQUENCES publication"));
872 errmsg(
"publication \"%s\" already exists",
877 memset(nulls,
false,
sizeof(nulls));
879 values[Anum_pg_publication_pubname - 1] =
885 &publish_given, &pubactions,
886 &publish_via_partition_root_given,
887 &publish_via_partition_root,
888 &publish_generated_columns_given,
889 &publish_generated_columns);
891 if (
stmt->for_all_sequences &&
892 (publish_given || publish_via_partition_root_given ||
893 publish_generated_columns_given))
895 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
896 errmsg(
"publication parameters are not applicable to sequence synchronization and will be ignored for sequences"));
899 Anum_pg_publication_oid);
901 values[Anum_pg_publication_puballtables - 1] =
903 values[Anum_pg_publication_puballsequences - 1] =
905 values[Anum_pg_publication_pubinsert - 1] =
907 values[Anum_pg_publication_pubupdate - 1] =
909 values[Anum_pg_publication_pubdelete - 1] =
911 values[Anum_pg_publication_pubtruncate - 1] =
913 values[Anum_pg_publication_pubviaroot - 1] =
915 values[Anum_pg_publication_pubgencols - 1] =
932 if (
stmt->for_all_tables)
941 else if (!
stmt->for_all_sequences)
949 errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
950 errmsg(
"must be superuser to create FOR TABLES IN SCHEMA publication"));
952 if (relations !=
NIL)
958 publish_via_partition_root);
962 publish_via_partition_root);
968 if (schemaidlist !=
NIL)
990 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
991 errmsg(
"logical decoding must be enabled to publish logical changes"),
992 errhint(
"Before creating subscriptions, ensure that \"wal_level\" is set to \"replica\" or higher.")));
1004 bool nulls[Natts_pg_publication];
1005 bool replaces[Natts_pg_publication];
1009 bool publish_via_partition_root_given;
1010 bool publish_via_partition_root;
1011 bool publish_generated_columns_given;
1012 char publish_generated_columns;
1022 &publish_given, &pubactions,
1023 &publish_via_partition_root_given,
1024 &publish_via_partition_root,
1025 &publish_generated_columns_given,
1026 &publish_generated_columns);
1028 if (pubform->puballsequences &&
1029 (publish_given || publish_via_partition_root_given ||
1030 publish_generated_columns_given))
1032 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1033 errmsg(
"publication parameters are not applicable to sequence synchronization and will be ignored for sequences"));
1041 if (!pubform->puballtables && publish_via_partition_root_given &&
1042 !publish_via_partition_root)
1056 foreach(lc, root_relids)
1075 has_rowfilter = !
heap_attisnull(rftuple, Anum_pg_publication_rel_prqual, NULL);
1076 has_collist = !
heap_attisnull(rftuple, Anum_pg_publication_rel_prattrs, NULL);
1077 if (!has_rowfilter && !has_collist)
1084 if (relkind != RELKIND_PARTITIONED_TABLE)
1098 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1099 errmsg(
"cannot set parameter \"%s\" to false for publication \"%s\"",
1100 "publish_via_partition_root",
1102 errdetail(
"The publication contains a WHERE clause for partitioned table \"%s\", which is not allowed when \"%s\" is false.",
1103 relname,
"publish_via_partition_root")));
1106 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1107 errmsg(
"cannot set parameter \"%s\" to false for publication \"%s\"",
1108 "publish_via_partition_root",
1110 errdetail(
"The publication contains a column list for partitioned table \"%s\", which is not allowed when \"%s\" is false.",
1111 relname,
"publish_via_partition_root")));
1117 memset(nulls,
false,
sizeof(nulls));
1118 memset(replaces,
false,
sizeof(replaces));
1123 replaces[Anum_pg_publication_pubinsert - 1] =
true;
1126 replaces[Anum_pg_publication_pubupdate - 1] =
true;
1129 replaces[Anum_pg_publication_pubdelete - 1] =
true;
1132 replaces[Anum_pg_publication_pubtruncate - 1] =
true;
1135 if (publish_via_partition_root_given)
1137 values[Anum_pg_publication_pubviaroot - 1] =
BoolGetDatum(publish_via_partition_root);
1138 replaces[Anum_pg_publication_pubviaroot - 1] =
true;
1141 if (publish_generated_columns_given)
1143 values[Anum_pg_publication_pubgencols - 1] =
CharGetDatum(publish_generated_columns);
1144 replaces[Anum_pg_publication_pubgencols - 1] =
true;
1158 if (pubform->puballtables)
1172 if (root_relids ==
NIL)
1181 foreach(lc, root_relids)
1227 List *tables,
const char *queryString,
1228 bool publish_schema)
1232 Oid pubid = pubform->oid;
1251 pubform->pubviaroot);
1267 pubform->pubviaroot);
1273 foreach(oldlc, oldrelids)
1280 Node *oldrelwhereclause = NULL;
1295 Datum whereClauseDatum;
1296 Datum columnListDatum;
1300 Anum_pg_publication_rel_prqual,
1307 Anum_pg_publication_rel_prattrs,
1316 foreach(newlc, rels)
1341 if (newrelid == oldrelid)
1363 delrels =
lappend(delrels, oldrel);
1413 foreach(lc, reloids)
1428 if (!
heap_attisnull(coltuple, Anum_pg_publication_rel_prattrs, NULL))
1430 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1431 errmsg(
"cannot add schema to publication \"%s\"",
1433 errdetail(
"Schemas cannot be added if any tables that specify a column list are already part of the publication."));
1480 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
1481 errmsg(
"must be superuser to add or set schemas")));
1487 if (schemaidlist && (pubform->puballtables || pubform->puballsequences))
1489 if (pubform->puballtables && pubform->puballsequences)
1491 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1492 errmsg(
"publication \"%s\" is defined as FOR ALL TABLES, ALL SEQUENCES",
1494 errdetail(
"Schemas cannot be added to or dropped from FOR ALL TABLES, ALL SEQUENCES publications."));
1495 else if (pubform->puballtables)
1497 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1498 errmsg(
"publication \"%s\" is defined as FOR ALL TABLES",
1500 errdetail(
"Schemas cannot be added to or dropped from FOR ALL TABLES publications."));
1503 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1504 errmsg(
"publication \"%s\" is defined as FOR ALL SEQUENCES",
1506 errdetail(
"Schemas cannot be added to or dropped from FOR ALL SEQUENCES publications."));
1510 if (tables && (pubform->puballtables || pubform->puballsequences))
1512 if (pubform->puballtables && pubform->puballsequences)
1514 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1515 errmsg(
"publication \"%s\" is defined as FOR ALL TABLES, ALL SEQUENCES",
1517 errdetail(
"Tables or sequences cannot be added to or dropped from FOR ALL TABLES, ALL SEQUENCES publications."));
1518 else if (pubform->puballtables)
1520 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1521 errmsg(
"publication \"%s\" is defined as FOR ALL TABLES",
1523 errdetail(
"Tables or sequences cannot be added to or dropped from FOR ALL TABLES publications."));
1526 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1527 errmsg(
"publication \"%s\" is defined as FOR ALL SEQUENCES",
1529 errdetail(
"Tables or sequences cannot be added to or dropped from FOR ALL SEQUENCES publications."));
1553 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1554 errmsg(
"publication \"%s\" does not exist",
1570 Oid pubid = pubform->oid;
1592 errcode(ERRCODE_UNDEFINED_OBJECT),
1593 errmsg(
"publication \"%s\" does not exist",
1597 schemaidlist !=
NIL);
1622 elog(
ERROR,
"cache lookup failed for publication table %u",
1661 elog(
ERROR,
"cache lookup failed for publication %u", pubid);
1666 if (pubform->puballtables)
1692 elog(
ERROR,
"cache lookup failed for publication schema %u", psoid);
1724 List *relids_with_collist =
NIL;
1756 errmsg(
"conflicting or redundant WHERE clauses for table \"%s\"",
1763 errmsg(
"conflicting or redundant column lists for table \"%s\"",
1774 rels =
lappend(rels, pub_rel);
1778 relids_with_rf =
lappend_oid(relids_with_rf, myrelid);
1781 relids_with_collist =
lappend_oid(relids_with_collist, myrelid);
1789 if (recurse && rel->
rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
1797 foreach(child, children)
1815 if (childrelid != myrelid &&
1819 errmsg(
"conflicting or redundant WHERE clauses for table \"%s\"",
1827 if (childrelid != myrelid &&
1831 errmsg(
"conflicting or redundant column lists for table \"%s\"",
1846 rels =
lappend(rels, pub_rel);
1850 relids_with_rf =
lappend_oid(relids_with_rf, childrelid);
1853 relids_with_collist =
lappend_oid(relids_with_collist, childrelid);
1892 foreach(lc, schemalist)
1907 errcode(ERRCODE_UNDEFINED_SCHEMA),
1908 errmsg(
"schema with OID %u does not exist", schemaid));
1962 errcode(ERRCODE_SYNTAX_ERROR),
1963 errmsg(
"column list must not be specified in ALTER PUBLICATION ... DROP"));
1965 prid =
GetSysCacheOid2(PUBLICATIONRELMAP, Anum_pg_publication_rel_oid,
1974 (
errcode(ERRCODE_UNDEFINED_OBJECT),
1975 errmsg(
"relation \"%s\" is not part of the publication",
1981 (
errcode(ERRCODE_SYNTAX_ERROR),
1982 errmsg(
"cannot use a WHERE clause when removing a table from a publication")));
1998 foreach(lc, schemas)
2025 foreach(lc, schemas)
2030 Anum_pg_publication_namespace_oid,
2039 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2040 errmsg(
"tables from schema \"%s\" are not part of the publication",
2059 if (form->pubowner == newOwnerId)
2082 if (form->puballtables || form->puballsequences ||
2085 errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
2086 errmsg(
"permission denied to change owner of publication \"%s\"",
2088 errhint(
"The owner of a FOR ALL TABLES or ALL SEQUENCES or TABLES IN SCHEMA publication must be a superuser."));
2092 form->pubowner = newOwnerId;
2122 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2123 errmsg(
"publication \"%s\" does not exist",
name)));
2126 pubid = pubform->oid;
2154 (
errcode(ERRCODE_UNDEFINED_OBJECT),
2155 errmsg(
"publication with OID %u does not exist", pubid)));
2181 return PUBLISH_GENCOLS_NONE;
2183 return PUBLISH_GENCOLS_STORED;
2187 errcode(ERRCODE_SYNTAX_ERROR),
2188 errmsg(
"invalid value for publication parameter \"%s\": \"%s\"", def->
defname, sval),
2189 errdetail(
"Valid values are \"%s\" and \"%s\".",
"none",
"stored"));
2191 return PUBLISH_GENCOLS_NONE;
void check_can_set_role(Oid member, Oid role)
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
#define InvalidAttrNumber
bool bms_equal(const Bitmapset *a, const Bitmapset *b)
int bms_next_member(const Bitmapset *a, int prevbit)
void bms_free(Bitmapset *a)
bool bms_is_member(int x, const Bitmapset *a)
static Datum values[MAXATTR]
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
char * defGetString(DefElem *def)
bool defGetBoolean(DefElem *def)
void errorConflictingDefElem(DefElem *defel, ParseState *pstate)
void performDeletion(const ObjectAddress *object, DropBehavior behavior, int flags)
int errdetail_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
void EventTriggerCollectSimpleCommand(ObjectAddress address, ObjectAddress secondaryObject, Node *parsetree)
#define palloc_object(type)
#define DirectFunctionCall1(func, arg1)
Assert(PointerIsAligned(start, uint64))
HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, const Datum *replValues, const bool *replIsnull, const bool *doReplace)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc)
void heap_freetuple(HeapTuple htup)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)
void CatalogTupleInsert(Relation heapRel, HeapTuple tup)
void CatalogTupleDelete(Relation heapRel, const ItemPointerData *tid)
void CacheInvalidateRelSyncAll(void)
void CacheInvalidateRelcacheByRelid(Oid relid)
void CacheInvalidateRelSync(Oid relid)
void CacheInvalidateRelcacheAll(void)
if(TABLE==NULL||TABLE_index==NULL)
List * list_concat_unique_oid(List *list1, const List *list2)
List * lappend(List *list, void *datum)
List * list_difference_oid(const List *list1, const List *list2)
List * lappend_oid(List *list, Oid datum)
List * list_append_unique_oid(List *list, Oid datum)
void list_free(List *list)
bool list_member_oid(const List *list, Oid datum)
void list_free_deep(List *list)
void LockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode)
#define AccessExclusiveLock
#define ShareUpdateExclusiveLock
char * get_rel_name(Oid relid)
AttrNumber get_attnum(Oid relid, const char *attname)
char * get_database_name(Oid dbid)
char get_rel_relkind(Oid relid)
char func_volatile(Oid funcid)
char * get_attname(Oid relid, AttrNumber attnum, bool missing_ok)
char * get_namespace_name(Oid nspid)
char * pstrdup(const char *in)
#define CHECK_FOR_INTERRUPTS()
Datum namein(PG_FUNCTION_ARGS)
List * fetch_search_path(bool includeImplicit)
Oid get_namespace_oid(const char *nspname, bool missing_ok)
Oid exprType(const Node *expr)
Oid exprInputCollation(const Node *expr)
bool check_functions_in_node(Node *node, check_function_callback checker, void *context)
Oid exprCollation(const Node *expr)
int exprLocation(const Node *expr)
#define expression_tree_walker(n, w, c)
#define IsA(nodeptr, _type_)
#define InvokeObjectPostCreateHook(classId, objectId, subId)
#define InvokeObjectPostAlterHook(classId, objectId, subId)
ObjectType get_relkind_objtype(char relkind)
const ObjectAddress InvalidObjectAddress
#define ObjectAddressSet(addr, class_id, object_id)
Node * transformWhereClause(ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName)
void assign_expr_collations(ParseState *pstate, Node *expr)
void free_parsestate(ParseState *pstate)
int parser_errposition(ParseState *pstate, int location)
ParseState * make_parsestate(ParseState *parentParseState)
ParseNamespaceItem * addRangeTableEntryForRelation(ParseState *pstate, Relation rel, int lockmode, Alias *alias, bool inh, bool inFromCl)
void addNSItemToQuery(ParseState *pstate, ParseNamespaceItem *nsitem, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace)
@ PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA
@ PUBLICATIONOBJ_TABLES_IN_SCHEMA
FormData_pg_attribute * Form_pg_attribute
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define foreach_oid(var, lst)
Bitmapset * pub_collist_validate(Relation targetrel, List *columns)
List * GetPubPartitionOptionRelations(List *result, PublicationPartOpt pub_partopt, Oid relid)
bool is_schema_publication(Oid pubid)
ObjectAddress publication_add_schema(Oid pubid, Oid schemaid, bool if_not_exists)
List * GetPublicationSchemas(Oid pubid)
ObjectAddress publication_add_relation(Oid pubid, PublicationRelInfo *pri, bool if_not_exists)
List * GetAllSchemaPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt)
Oid GetTopMostAncestorInPublication(Oid puboid, List *ancestors, int *ancestor_level)
List * GetSchemaPublicationRelations(Oid schemaid, PublicationPartOpt pub_partopt)
Publication * GetPublication(Oid pubid)
bool check_and_fetch_column_list(Publication *pub, Oid relid, MemoryContext mcxt, Bitmapset **cols)
Bitmapset * pub_collist_to_bitmapset(Bitmapset *columns, Datum pubcols, MemoryContext mcxt)
List * GetPublicationRelations(Oid pubid, PublicationPartOpt pub_partopt)
FormData_pg_publication * Form_pg_publication
FormData_pg_publication_namespace * Form_pg_publication_namespace
FormData_pg_publication_rel * Form_pg_publication_rel
void changeDependencyOnOwner(Oid classId, Oid objectId, Oid newOwnerId)
void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
int pg_strcasecmp(const char *s1, const char *s2)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum CharGetDatum(char X)
struct rf_context rf_context
static void PublicationAddSchemas(Oid pubid, List *schemas, bool if_not_exists, AlterPublicationStmt *stmt)
static bool contain_invalid_rfcolumn_walker(Node *node, rf_context *context)
bool pub_contains_invalid_column(Oid pubid, Relation relation, List *ancestors, bool pubviaroot, char pubgencols_type, bool *invalid_column_list, bool *invalid_gen_col)
static void AlterPublicationSchemas(AlterPublicationStmt *stmt, HeapTuple tup, List *schemaidlist)
void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId)
static void PublicationAddTables(Oid pubid, List *rels, bool if_not_exists, AlterPublicationStmt *stmt)
void InvalidatePublicationRels(List *relids)
static void CloseTableList(List *rels)
void RemovePublicationSchemaById(Oid psoid)
static void PublicationDropTables(Oid pubid, List *rels, bool missing_ok)
static void TransformPubWhereClauses(List *tables, const char *queryString, bool pubviaroot)
ObjectAddress CreatePublication(ParseState *pstate, CreatePublicationStmt *stmt)
static void PublicationDropSchemas(Oid pubid, List *schemas, bool missing_ok)
bool pub_rf_contains_invalid_column(Oid pubid, Relation relation, List *ancestors, bool pubviaroot)
void InvalidatePubRelSyncCache(Oid pubid, bool puballtables)
static void ObjectsInPublicationToOids(List *pubobjspec_list, ParseState *pstate, List **rels, List **schemas)
static void CheckAlterPublication(AlterPublicationStmt *stmt, HeapTuple tup, List *tables, List *schemaidlist)
static bool contain_mutable_or_user_functions_checker(Oid func_id, void *context)
void RemovePublicationById(Oid pubid)
static List * OpenTableList(List *tables)
static void AlterPublicationOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
static bool check_simple_rowfilter_expr(Node *node, ParseState *pstate)
static char defGetGeneratedColsOption(DefElem *def)
void AlterPublication(ParseState *pstate, AlterPublicationStmt *stmt)
static void parse_publication_options(ParseState *pstate, List *options, bool *publish_given, PublicationActions *pubactions, bool *publish_via_partition_root_given, bool *publish_via_partition_root, bool *publish_generated_columns_given, char *publish_generated_columns)
void RemovePublicationRelById(Oid proid)
ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId)
static void CheckPubRelationColumnList(char *pubname, List *tables, bool publish_schema, bool pubviaroot)
static void AlterPublicationOptions(ParseState *pstate, AlterPublicationStmt *stmt, Relation rel, HeapTuple tup)
static void AlterPublicationTables(AlterPublicationStmt *stmt, HeapTuple tup, List *tables, const char *queryString, bool publish_schema)
static void LockSchemaList(List *schemalist)
static bool check_simple_rowfilter_expr_walker(Node *node, ParseState *pstate)
#define MAX_RELCACHE_INVAL_MSGS
void * stringToNode(const char *str)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
#define RelationGetNamespace(relation)
Bitmapset * RelationGetIndexAttrBitmap(Relation relation, IndexAttrBitmapKind attrKind)
@ INDEX_ATTR_BITMAP_IDENTITY_KEY
Node * expand_generated_columns_in_expr(Node *node, Relation rel, int rt_index)
#define ERRCODE_DUPLICATE_OBJECT
const char * p_sourcetext
PublicationObjSpecType pubobjtype
PublicationTable * pubtable
bool has_generated_virtual
bool has_generated_stored
Bitmapset * bms_replident
bool superuser_arg(Oid roleid)
#define FirstLowInvalidHeapAttributeNumber
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
#define SearchSysCacheCopy1(cacheId, key1)
#define SearchSysCacheExists1(cacheId, key1)
#define GetSysCacheOid1(cacheId, oidcol, key1)
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode)
#define FirstNormalObjectId
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
void CommandCounterIncrement(void)