|
PostgreSQL Source Code git master
|
#include "catalog/genbki.h"#include "catalog/objectaddress.h"#include "catalog/pg_publication_d.h"

Go to the source code of this file.
Data Structures | |
| struct | PublicationActions |
| struct | PublicationDesc |
| struct | Publication |
| struct | PublicationRelInfo |
Typedefs | |
| typedef FormData_pg_publication * | Form_pg_publication |
| typedef struct PublicationActions | PublicationActions |
| typedef struct PublicationDesc | PublicationDesc |
| typedef struct Publication | Publication |
| typedef struct PublicationRelInfo | PublicationRelInfo |
| typedef enum PublicationPartOpt | PublicationPartOpt |
Enumerations | |
| enum | PublicationPartOpt { PUBLICATION_PART_ROOT , PUBLICATION_PART_LEAF , PUBLICATION_PART_ALL } |
Functions | |
| CATALOG (pg_publication, 6104, PublicationRelationId) | |
| DECLARE_UNIQUE_INDEX_PKEY (pg_publication_oid_index, 6110, PublicationObjectIndexId, pg_publication, btree(oid oid_ops)) | |
| DECLARE_UNIQUE_INDEX (pg_publication_pubname_index, 6111, PublicationNameIndexId, pg_publication, btree(pubname name_ops)) | |
| MAKE_SYSCACHE (PUBLICATIONOID, pg_publication_oid_index, 8) | |
| MAKE_SYSCACHE (PUBLICATIONNAME, pg_publication_pubname_index, 8) | |
| Publication * | GetPublication (Oid pubid) |
| Publication * | GetPublicationByName (const char *pubname, bool missing_ok) |
| List * | GetRelationPublications (Oid relid) |
| List * | GetPublicationRelations (Oid pubid, PublicationPartOpt pub_partopt) |
| List * | GetAllTablesPublications (void) |
| List * | GetAllPublicationRelations (char relkind, bool pubviaroot) |
| List * | GetPublicationSchemas (Oid pubid) |
| List * | GetSchemaPublications (Oid schemaid) |
| List * | GetSchemaPublicationRelations (Oid schemaid, PublicationPartOpt pub_partopt) |
| List * | GetAllSchemaPublicationRelations (Oid pubid, PublicationPartOpt pub_partopt) |
| List * | GetPubPartitionOptionRelations (List *result, PublicationPartOpt pub_partopt, Oid relid) |
| Oid | GetTopMostAncestorInPublication (Oid puboid, List *ancestors, int *ancestor_level) |
| bool | is_publishable_relation (Relation rel) |
| bool | is_schema_publication (Oid pubid) |
| bool | check_and_fetch_column_list (Publication *pub, Oid relid, MemoryContext mcxt, Bitmapset **cols) |
| ObjectAddress | publication_add_relation (Oid pubid, PublicationRelInfo *pri, bool if_not_exists) |
| Bitmapset * | pub_collist_validate (Relation targetrel, List *columns) |
| ObjectAddress | publication_add_schema (Oid pubid, Oid schemaid, bool if_not_exists) |
| Bitmapset * | pub_collist_to_bitmapset (Bitmapset *columns, Datum pubcols, MemoryContext mcxt) |
| Bitmapset * | pub_form_cols_map (Relation relation, PublishGencolsType include_gencols_type) |
Variables | |
| FormData_pg_publication | |
Definition at line 76 of file pg_publication.h.
| typedef struct Publication Publication |
| typedef struct PublicationActions PublicationActions |
| typedef struct PublicationDesc PublicationDesc |
| typedef enum PublicationPartOpt PublicationPartOpt |
| typedef struct PublicationRelInfo PublicationRelInfo |
| enum PublicationPartOpt |
| Enumerator | |
|---|---|
| PUBLICATION_PART_ROOT | |
| PUBLICATION_PART_LEAF | |
| PUBLICATION_PART_ALL | |
Definition at line 164 of file pg_publication.h.
| CATALOG | ( | pg_publication | , |
| 6104 | , | ||
| PublicationRelationId | |||
| ) |
Definition at line 29 of file pg_publication.h.
References BKI_LOOKUP.
| bool check_and_fetch_column_list | ( | Publication * | pub, |
| Oid | relid, | ||
| MemoryContext | mcxt, | ||
| Bitmapset ** | cols | ||
| ) |
Definition at line 271 of file pg_publication.c.
References Publication::alltables, HeapTupleIsValid, ObjectIdGetDatum(), Publication::oid, pub_collist_to_bitmapset(), ReleaseSysCache(), SearchSysCache2(), and SysCacheGetAttr().
Referenced by check_and_init_gencol(), pgoutput_column_list_init(), and pub_contains_invalid_column().
| DECLARE_UNIQUE_INDEX | ( | pg_publication_pubname_index | , |
| 6111 | , | ||
| PublicationNameIndexId | , | ||
| pg_publication | , | ||
| btree(pubname name_ops) | |||
| ) |
| DECLARE_UNIQUE_INDEX_PKEY | ( | pg_publication_oid_index | , |
| 6110 | , | ||
| PublicationObjectIndexId | , | ||
| pg_publication | , | ||
| btree(oid oid_ops) | |||
| ) |
| List * GetAllPublicationRelations | ( | char | relkind, |
| bool | pubviaroot | ||
| ) |
Definition at line 869 of file pg_publication.c.
References AccessShareLock, Assert(), BTEqualStrategyNumber, CharGetDatum(), ForwardScanDirection, GETSTRUCT(), heap_getnext(), is_publishable_class(), sort-test::key, lappend_oid(), NIL, ScanKeyInit(), table_beginscan_catalog(), table_close(), table_endscan(), and table_open().
Referenced by pg_get_publication_sequences(), and pg_get_publication_tables().
| List * GetAllSchemaPublicationRelations | ( | Oid | pubid, |
| PublicationPartOpt | pub_partopt | ||
| ) |
Definition at line 1053 of file pg_publication.c.
References GetPublicationSchemas(), GetSchemaPublicationRelations(), lfirst_oid, list_concat(), and NIL.
Referenced by AlterPublicationOptions(), InvalidatePubRelSyncCache(), and pg_get_publication_tables().
| List * GetAllTablesPublications | ( | void | ) |
Definition at line 826 of file pg_publication.c.
References AccessShareLock, BoolGetDatum(), BTEqualStrategyNumber, GETSTRUCT(), HeapTupleIsValid, InvalidOid, lappend_oid(), NIL, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by RelationBuildPublicationDesc().
| Publication * GetPublication | ( | Oid | pubid | ) |
Definition at line 1077 of file pg_publication.c.
References Publication::allsequences, Publication::alltables, elog, ERROR, GETSTRUCT(), HeapTupleIsValid, Publication::name, NameStr, ObjectIdGetDatum(), Publication::oid, palloc(), pstrdup(), Publication::pubactions, PublicationActions::pubdelete, Publication::pubgencols_type, PublicationActions::pubinsert, PublicationActions::pubtruncate, PublicationActions::pubupdate, Publication::pubviaroot, ReleaseSysCache(), and SearchSysCache1().
Referenced by GetPublicationByName(), pg_get_publication_tables(), pub_contains_invalid_column(), publication_add_relation(), and publication_add_schema().
| Publication * GetPublicationByName | ( | const char * | pubname, |
| bool | missing_ok | ||
| ) |
Definition at line 1110 of file pg_publication.c.
References get_publication_oid(), GetPublication(), and OidIsValid.
Referenced by get_object_address_publication_rel(), get_object_address_publication_schema(), LoadPublications(), pg_get_publication_sequences(), and pg_get_publication_tables().
| List * GetPublicationRelations | ( | Oid | pubid, |
| PublicationPartOpt | pub_partopt | ||
| ) |
Definition at line 783 of file pg_publication.c.
References AccessShareLock, BTEqualStrategyNumber, GetPubPartitionOptionRelations(), GETSTRUCT(), HeapTupleIsValid, list_deduplicate_oid(), list_oid_cmp(), list_sort(), NIL, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterPublicationOptions(), AlterPublicationSchemas(), AlterPublicationTables(), InvalidatePubRelSyncCache(), and pg_get_publication_tables().
Definition at line 932 of file pg_publication.c.
References AccessShareLock, BTEqualStrategyNumber, GETSTRUCT(), HeapTupleIsValid, lappend_oid(), NIL, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterPublicationSchemas(), and GetAllSchemaPublicationRelations().
| List * GetPubPartitionOptionRelations | ( | List * | result, |
| PublicationPartOpt | pub_partopt, | ||
| Oid | relid | ||
| ) |
Definition at line 313 of file pg_publication.c.
References Assert(), find_all_inheritors(), get_rel_relkind(), lappend_oid(), lfirst_oid, list_concat(), NoLock, PUBLICATION_PART_ALL, PUBLICATION_PART_LEAF, and PUBLICATION_PART_ROOT.
Referenced by AlterPublicationOptions(), GetPublicationRelations(), GetSchemaPublicationRelations(), publication_add_relation(), and RemovePublicationRelById().
Definition at line 754 of file pg_publication.c.
References GETSTRUCT(), i, lappend_oid(), catclist::members, catclist::n_members, NIL, ObjectIdGetDatum(), ReleaseSysCacheList, SearchSysCacheList1, and catctup::tuple.
Referenced by ATExecSetExpression(), ATPrepChangePersistence(), get_rel_sync_entry(), GetTopMostAncestorInPublication(), and RelationBuildPublicationDesc().
| List * GetSchemaPublicationRelations | ( | Oid | schemaid, |
| PublicationPartOpt | pub_partopt | ||
| ) |
Definition at line 996 of file pg_publication.c.
References AccessShareLock, Assert(), BTEqualStrategyNumber, ForwardScanDirection, get_rel_relkind(), GetPubPartitionOptionRelations(), GETSTRUCT(), heap_getnext(), is_publishable_class(), sort-test::key, lappend_oid(), list_concat_unique_oid(), NIL, ObjectIdGetDatum(), OidIsValid, ScanKeyInit(), table_beginscan_catalog(), table_close(), table_endscan(), and table_open().
Referenced by GetAllSchemaPublicationRelations(), publication_add_schema(), and RemovePublicationSchemaById().
Definition at line 970 of file pg_publication.c.
References GETSTRUCT(), i, lappend_oid(), catclist::members, catclist::n_members, NIL, ObjectIdGetDatum(), ReleaseSysCacheList, SearchSysCacheList1, and catctup::tuple.
Referenced by get_rel_sync_entry(), GetTopMostAncestorInPublication(), and RelationBuildPublicationDesc().
Definition at line 357 of file pg_publication.c.
References get_rel_namespace(), GetRelationPublications(), GetSchemaPublications(), InvalidOid, lfirst_oid, list_free(), list_member_oid(), and NIL.
Referenced by get_rel_sync_entry(), pub_contains_invalid_column(), and pub_rf_contains_invalid_column().
| bool is_publishable_relation | ( | Relation | rel | ) |
Definition at line 150 of file pg_publication.c.
References is_publishable_class(), RelationData::rd_rel, and RelationGetRelid.
Referenced by pgoutput_change(), pgoutput_truncate(), and RelationBuildPublicationDesc().
| bool is_schema_publication | ( | Oid | pubid | ) |
Definition at line 236 of file pg_publication.c.
References AccessShareLock, BTEqualStrategyNumber, HeapTupleIsValid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), and table_open().
Referenced by AlterPublicationOwner_internal(), and AlterPublicationTables().
| MAKE_SYSCACHE | ( | PUBLICATIONNAME | , |
| pg_publication_pubname_index | , | ||
| 8 | |||
| ) |
| MAKE_SYSCACHE | ( | PUBLICATIONOID | , |
| pg_publication_oid_index | , | ||
| 8 | |||
| ) |
| Bitmapset * pub_collist_to_bitmapset | ( | Bitmapset * | columns, |
| Datum | pubcols, | ||
| MemoryContext | mcxt | ||
| ) |
Definition at line 608 of file pg_publication.c.
References ARR_DATA_PTR, ARR_DIMS, bms_add_member(), DatumGetArrayTypeP, i, and MemoryContextSwitchTo().
Referenced by AlterPublicationTables(), and check_and_fetch_column_list().
Definition at line 559 of file pg_publication.c.
References attnum, AttrNumberIsForUserDefinedAttr, bms_add_member(), bms_is_member(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, get_attnum(), InvalidAttrNumber, lfirst, RelationGetDescr, RelationGetRelationName, RelationGetRelid, strVal, and TupleDescAttr().
Referenced by AlterPublicationTables(), and publication_add_relation().
Definition at line 640 of file pg_publication.c.
References bms_add_member(), i, TupleDescData::natts, RelationGetDescr, and TupleDescAttr().
Referenced by pgoutput_column_list_init().
| ObjectAddress publication_add_relation | ( | Oid | pubid, |
| PublicationRelInfo * | pri, | ||
| bool | if_not_exists | ||
| ) |
Definition at line 431 of file pg_publication.c.
References attnumstoint2vector(), bms_next_member(), CatalogTupleInsert(), check_publication_add_relation(), PublicationRelInfo::columns, CStringGetTextDatum, DEPENDENCY_AUTO, DEPENDENCY_NORMAL, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, GetNewOidWithIndex(), GetPublication(), GetPubPartitionOptionRelations(), heap_form_tuple(), heap_freetuple(), i, InvalidatePublicationRels(), InvalidObjectAddress, Publication::name, NIL, nodeToString(), ObjectAddressSet, ObjectAddressSubSet, ObjectIdGetDatum(), PointerGetDatum(), pub_collist_validate(), PUBLICATION_PART_ALL, recordDependencyOn(), recordDependencyOnSingleRelExpr(), PublicationRelInfo::relation, RelationGetDescr, RelationGetRelationName, RelationGetRelid, RowExclusiveLock, SearchSysCacheExists2, table_close(), table_open(), values, and PublicationRelInfo::whereClause.
Referenced by PublicationAddTables().
| ObjectAddress publication_add_schema | ( | Oid | pubid, |
| Oid | schemaid, | ||
| bool | if_not_exists | ||
| ) |
Definition at line 673 of file pg_publication.c.
References CatalogTupleInsert(), check_publication_add_schema(), DEPENDENCY_AUTO, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, get_namespace_name(), GetNewOidWithIndex(), GetPublication(), GetSchemaPublicationRelations(), heap_form_tuple(), heap_freetuple(), InvalidatePublicationRels(), InvalidObjectAddress, Publication::name, NIL, ObjectAddressSet, ObjectIdGetDatum(), PUBLICATION_PART_ALL, recordDependencyOn(), RelationGetDescr, RowExclusiveLock, SearchSysCacheExists2, table_close(), table_open(), and values.
Referenced by PublicationAddSchemas().
| FormData_pg_publication |
Definition at line 69 of file pg_publication.h.