|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/commit_ts.h"#include "access/htup_details.h"#include "access/table.h"#include "access/twophase.h"#include "access/xact.h"#include "catalog/catalog.h"#include "catalog/dependency.h"#include "catalog/indexing.h"#include "catalog/namespace.h"#include "catalog/objectaccess.h"#include "catalog/objectaddress.h"#include "catalog/pg_authid_d.h"#include "catalog/pg_database_d.h"#include "catalog/pg_subscription.h"#include "catalog/pg_subscription_rel.h"#include "catalog/pg_type.h"#include "commands/defrem.h"#include "commands/event_trigger.h"#include "commands/subscriptioncmds.h"#include "executor/executor.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "pgstat.h"#include "replication/logicallauncher.h"#include "replication/logicalworker.h"#include "replication/origin.h"#include "replication/slot.h"#include "replication/walreceiver.h"#include "replication/walsender.h"#include "replication/worker_internal.h"#include "storage/lmgr.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/guc.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/pg_lsn.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | SubOpts |
| struct | PublicationRelKind |
Macros | |
| #define | SUBOPT_CONNECT 0x00000001 |
| #define | SUBOPT_ENABLED 0x00000002 |
| #define | SUBOPT_CREATE_SLOT 0x00000004 |
| #define | SUBOPT_SLOT_NAME 0x00000008 |
| #define | SUBOPT_COPY_DATA 0x00000010 |
| #define | SUBOPT_SYNCHRONOUS_COMMIT 0x00000020 |
| #define | SUBOPT_REFRESH 0x00000040 |
| #define | SUBOPT_BINARY 0x00000080 |
| #define | SUBOPT_STREAMING 0x00000100 |
| #define | SUBOPT_TWOPHASE_COMMIT 0x00000200 |
| #define | SUBOPT_DISABLE_ON_ERR 0x00000400 |
| #define | SUBOPT_PASSWORD_REQUIRED 0x00000800 |
| #define | SUBOPT_RUN_AS_OWNER 0x00001000 |
| #define | SUBOPT_FAILOVER 0x00002000 |
| #define | SUBOPT_RETAIN_DEAD_TUPLES 0x00004000 |
| #define | SUBOPT_MAX_RETENTION_DURATION 0x00008000 |
| #define | SUBOPT_LSN 0x00010000 |
| #define | SUBOPT_ORIGIN 0x00020000 |
| #define | IsSet(val, bits) (((val) & (bits)) == (bits)) |
Typedefs | |
| typedef struct SubOpts | SubOpts |
| typedef struct PublicationRelKind | PublicationRelKind |
Functions | |
| static List * | fetch_relation_list (WalReceiverConn *wrconn, List *publications) |
| static void | check_publications_origin_tables (WalReceiverConn *wrconn, List *publications, bool copydata, bool retain_dead_tuples, char *origin, Oid *subrel_local_oids, int subrel_count, char *subname) |
| static void | check_publications_origin_sequences (WalReceiverConn *wrconn, List *publications, bool copydata, char *origin, Oid *subrel_local_oids, int subrel_count, char *subname) |
| static void | check_pub_dead_tuple_retention (WalReceiverConn *wrconn) |
| static void | check_duplicates_in_publist (List *publist, Datum *datums) |
| static List * | merge_publications (List *oldpublist, List *newpublist, bool addpub, const char *subname) |
| static void | ReportSlotConnectionError (List *rstates, Oid subid, char *slotname, char *err) |
| static void | CheckAlterSubOption (Subscription *sub, const char *option, bool slot_needs_update, bool isTopLevel) |
| static void | parse_subscription_options (ParseState *pstate, List *stmt_options, bits32 supported_opts, SubOpts *opts) |
| static void | check_publications (WalReceiverConn *wrconn, List *publications) |
| static Datum | publicationListToArray (List *publist) |
| ObjectAddress | CreateSubscription (ParseState *pstate, CreateSubscriptionStmt *stmt, bool isTopLevel) |
| static void | AlterSubscription_refresh (Subscription *sub, bool copy_data, List *validate_publications) |
| static void | AlterSubscription_refresh_seq (Subscription *sub) |
| ObjectAddress | AlterSubscription (ParseState *pstate, AlterSubscriptionStmt *stmt, bool isTopLevel) |
| void | DropSubscription (DropSubscriptionStmt *stmt, bool isTopLevel) |
| void | ReplicationSlotDropAtPubNode (WalReceiverConn *wrconn, char *slotname, bool missing_ok) |
| static void | AlterSubscriptionOwner_internal (Relation rel, HeapTuple tup, Oid newOwnerId) |
| ObjectAddress | AlterSubscriptionOwner (const char *name, Oid newOwnerId) |
| void | AlterSubscriptionOwner_oid (Oid subid, Oid newOwnerId) |
| void | CheckSubDeadTupleRetention (bool check_guc, bool sub_disabled, int elevel_for_sub_disabled, bool retain_dead_tuples, bool retention_active, bool max_retention_set) |
| static bool | list_member_rangevar (const List *list, RangeVar *rv) |
| char | defGetStreamingMode (DefElem *def) |
Definition at line 80 of file subscriptioncmds.c.
| #define SUBOPT_BINARY 0x00000080 |
Definition at line 67 of file subscriptioncmds.c.
| #define SUBOPT_CONNECT 0x00000001 |
Definition at line 60 of file subscriptioncmds.c.
| #define SUBOPT_COPY_DATA 0x00000010 |
Definition at line 64 of file subscriptioncmds.c.
| #define SUBOPT_CREATE_SLOT 0x00000004 |
Definition at line 62 of file subscriptioncmds.c.
| #define SUBOPT_DISABLE_ON_ERR 0x00000400 |
Definition at line 70 of file subscriptioncmds.c.
| #define SUBOPT_ENABLED 0x00000002 |
Definition at line 61 of file subscriptioncmds.c.
| #define SUBOPT_FAILOVER 0x00002000 |
Definition at line 73 of file subscriptioncmds.c.
| #define SUBOPT_LSN 0x00010000 |
Definition at line 76 of file subscriptioncmds.c.
| #define SUBOPT_MAX_RETENTION_DURATION 0x00008000 |
Definition at line 75 of file subscriptioncmds.c.
| #define SUBOPT_ORIGIN 0x00020000 |
Definition at line 77 of file subscriptioncmds.c.
| #define SUBOPT_PASSWORD_REQUIRED 0x00000800 |
Definition at line 71 of file subscriptioncmds.c.
| #define SUBOPT_REFRESH 0x00000040 |
Definition at line 66 of file subscriptioncmds.c.
| #define SUBOPT_RETAIN_DEAD_TUPLES 0x00004000 |
Definition at line 74 of file subscriptioncmds.c.
| #define SUBOPT_RUN_AS_OWNER 0x00001000 |
Definition at line 72 of file subscriptioncmds.c.
| #define SUBOPT_SLOT_NAME 0x00000008 |
Definition at line 63 of file subscriptioncmds.c.
| #define SUBOPT_STREAMING 0x00000100 |
Definition at line 68 of file subscriptioncmds.c.
| #define SUBOPT_SYNCHRONOUS_COMMIT 0x00000020 |
Definition at line 65 of file subscriptioncmds.c.
| #define SUBOPT_TWOPHASE_COMMIT 0x00000200 |
Definition at line 69 of file subscriptioncmds.c.
| typedef struct PublicationRelKind PublicationRelKind |
| ObjectAddress AlterSubscription | ( | ParseState * | pstate, |
| AlterSubscriptionStmt * | stmt, | ||
| bool | isTopLevel | ||
| ) |
Definition at line 1331 of file subscriptioncmds.c.
References AccessExclusiveLock, aclcheck_error(), ACLCHECK_NOT_OWNER, ALTER_SUBSCRIPTION_ADD_PUBLICATION, ALTER_SUBSCRIPTION_CONNECTION, ALTER_SUBSCRIPTION_DROP_PUBLICATION, ALTER_SUBSCRIPTION_ENABLED, ALTER_SUBSCRIPTION_OPTIONS, ALTER_SUBSCRIPTION_REFRESH_PUBLICATION, ALTER_SUBSCRIPTION_REFRESH_SEQUENCES, ALTER_SUBSCRIPTION_SET_PUBLICATION, ALTER_SUBSCRIPTION_SKIP, AlterSubscription_refresh(), AlterSubscription_refresh_seq(), ApplyLauncherWakeupAtCommit(), Assert(), BoolGetDatum(), CatalogTupleUpdate(), CharGetDatum(), check_pub_dead_tuple_retention(), check_publications_origin_tables(), CheckAlterSubOption(), CheckSubDeadTupleRetention(), Subscription::conninfo, CStringGetDatum(), CStringGetTextDatum, DirectFunctionCall1, elog, Subscription::enabled, ereport, err(), errcode(), errhint(), errmsg(), ERROR, GETSTRUCT(), GetSubscription(), GetUserId(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, if(), Int32GetDatum(), InvalidOid, InvokeObjectPostAlterHook, IsSet, load_file(), LockSharedObject(), logicalrep_workers_find(), LogicalRepWorkersWakeupAtCommit(), LookupGXactBySubid(), LSN_FORMAT_ARGS, LSNGetDatum(), Subscription::maxretention, merge_publications(), MyDatabaseId, Subscription::name, NAMEDATALEN, namein(), NOTICE, object_ownercheck(), OBJECT_SUBSCRIPTION, ObjectAddressSet, ObjectIdGetDatum(), opts, Subscription::origin, Subscription::ownersuperuser, parse_subscription_options(), Subscription::passwordrequired, PG_END_TRY, PG_FINALLY, pg_strcasecmp(), PG_TRY, PreventInTransactionBlock(), publicationListToArray(), Subscription::publications, RelationGetDescr, ReplicationOriginNameForLogicalRep(), replorigin_by_name(), replorigin_get_progress(), Subscription::retaindeadtuples, Subscription::retentionactive, RowExclusiveLock, SearchSysCacheCopy2, Subscription::slotname, stmt, SUBOPT_BINARY, SUBOPT_COPY_DATA, SUBOPT_DISABLE_ON_ERR, SUBOPT_ENABLED, SUBOPT_FAILOVER, SUBOPT_LSN, SUBOPT_MAX_RETENTION_DURATION, SUBOPT_ORIGIN, SUBOPT_PASSWORD_REQUIRED, SUBOPT_REFRESH, SUBOPT_RETAIN_DEAD_TUPLES, SUBOPT_RUN_AS_OWNER, SUBOPT_SLOT_NAME, SUBOPT_STREAMING, SUBOPT_SYNCHRONOUS_COMMIT, SUBOPT_TWOPHASE_COMMIT, superuser(), HeapTupleData::t_self, table_close(), table_open(), Subscription::twophasestate, values, walrcv_alter_slot, walrcv_check_conninfo, walrcv_connect, walrcv_disconnect, WARNING, wrconn, and XLogRecPtrIsInvalid.
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 917 of file subscriptioncmds.c.
References AccessExclusiveLock, AccessShareLock, AddSubscriptionRelState(), check_publications(), check_publications_origin_sequences(), check_publications_origin_tables(), CheckSubscriptionRelkind(), Subscription::conninfo, DEBUG1, ereport, err(), errcode(), errmsg(), errmsg_internal(), ERROR, fetch_relation_list(), foreach_ptr, get_namespace_name(), get_rel_name(), get_rel_namespace(), get_rel_relkind(), GetSubscriptionRelations(), GetSubscriptionRelState(), InvalidXLogRecPtr, lappend(), lfirst, list_length(), load_file(), logicalrep_worker_stop(), Subscription::name, NAMEDATALEN, NIL, NoLock, Subscription::oid, oid_cmp(), Subscription::origin, Subscription::ownersuperuser, palloc(), Subscription::passwordrequired, PG_END_TRY, PG_FINALLY, PG_TRY, Subscription::publications, qsort, RangeVarGetRelid, SubscriptionRelState::relid, RangeVar::relname, RemoveSubscriptionRel(), ReplicationOriginNameForLogicalRep(), ReplicationSlotDropAtPubNode(), ReplicationSlotNameForTablesync(), replorigin_drop_by_name(), Subscription::retaindeadtuples, RangeVar::schemaname, table_close(), table_open(), walrcv_connect, walrcv_disconnect, WORKERTYPE_TABLESYNC, and wrconn.
Referenced by AlterSubscription().
|
static |
Definition at line 1188 of file subscriptioncmds.c.
References check_publications_origin_sequences(), Subscription::conninfo, DEBUG1, ereport, err(), errcode(), errmsg(), errmsg_internal(), ERROR, foreach_ptr, get_namespace_name(), get_rel_name(), get_rel_namespace(), GetSubscriptionRelations(), InvalidXLogRecPtr, load_file(), Subscription::name, Subscription::oid, Subscription::origin, Subscription::ownersuperuser, Subscription::passwordrequired, PG_END_TRY, PG_FINALLY, PG_TRY, Subscription::publications, UpdateSubscriptionRelState(), walrcv_connect, walrcv_disconnect, and wrconn.
Referenced by AlterSubscription().
| ObjectAddress AlterSubscriptionOwner | ( | const char * | name, |
| Oid | newOwnerId | ||
| ) |
Definition at line 2412 of file subscriptioncmds.c.
References AlterSubscriptionOwner_internal(), CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, MyDatabaseId, name, ObjectAddressSet, ObjectIdGetDatum(), RowExclusiveLock, SearchSysCacheCopy2, table_close(), and table_open().
Referenced by ExecAlterOwnerStmt().
Definition at line 2352 of file subscriptioncmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_NOT_OWNER, ACLCHECK_OK, ApplyLauncherWakeupAtCommit(), CatalogTupleUpdate(), changeDependencyOnOwner(), check_can_set_role(), ereport, errcode(), errhint(), errmsg(), ERROR, get_database_name(), GETSTRUCT(), GetUserId(), InvokeObjectPostAlterHook, LogicalRepWorkersWakeupAtCommit(), MyDatabaseId, NameStr, object_aclcheck(), OBJECT_DATABASE, object_ownercheck(), OBJECT_SUBSCRIPTION, superuser(), and HeapTupleData::t_self.
Referenced by AlterSubscriptionOwner(), and AlterSubscriptionOwner_oid().
Definition at line 2448 of file subscriptioncmds.c.
References AlterSubscriptionOwner_internal(), ereport, errcode(), errmsg(), ERROR, heap_freetuple(), HeapTupleIsValid, ObjectIdGetDatum(), RowExclusiveLock, SearchSysCacheCopy1, table_close(), and table_open().
Referenced by shdepReassignOwned_Owner().
Definition at line 3045 of file subscriptioncmds.c.
References CStringGetTextDatum, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, j, lfirst, name, and strVal.
Referenced by merge_publications(), and publicationListToArray().
|
static |
Definition at line 2753 of file subscriptioncmds.c.
References DatumGetBool(), elog, ereport, WalRcvExecResult::err, errcode(), errmsg(), ERROR, ExecDropSingleTupleTableSlot(), MakeSingleTupleTableSlot(), slot_getattr(), WalRcvExecResult::status, TTSOpsMinimalTuple, WalRcvExecResult::tupledesc, WalRcvExecResult::tuplestore, tuplestore_gettupleslot(), walrcv_clear_result(), walrcv_exec, WALRCV_OK_TUPLES, walrcv_server_version, and wrconn.
Referenced by AlterSubscription(), and CreateSubscription().
|
static |
Definition at line 491 of file subscriptioncmds.c.
References appendStringInfoChar(), appendStringInfoString(), Assert(), StringInfoData::data, destroyStringInfo(), ereport, WalRcvExecResult::err, errcode(), errmsg(), errmsg_plural(), ERROR, ExecClearTuple(), ExecDropSingleTupleTableSlot(), GetPublicationsStr(), list_copy(), list_delete(), list_length(), MakeSingleTupleTableSlot(), makeString(), makeStringInfo(), NIL, slot_getattr(), WalRcvExecResult::status, TextDatumGetCString, TTSOpsMinimalTuple, WalRcvExecResult::tupledesc, WalRcvExecResult::tuplestore, tuplestore_gettupleslot(), walrcv_clear_result(), walrcv_exec, WALRCV_OK_TUPLES, WARNING, and wrconn.
Referenced by AlterSubscription_refresh(), and CreateSubscription().
|
static |
Definition at line 2639 of file subscriptioncmds.c.
References _, appendStringInfo(), appendStringInfoString(), Assert(), StringInfoData::data, ereport, WalRcvExecResult::err, errcode(), errdetail_plural(), errhint_internal(), errmsg(), errmsg_internal(), ERROR, ExecClearTuple(), ExecDropSingleTupleTableSlot(), get_namespace_name(), get_rel_name(), get_rel_namespace(), GetPublicationsStr(), i, initStringInfo(), list_append_unique(), list_length(), MakeSingleTupleTableSlot(), makeString(), makeStringInfo(), NIL, pfree(), pg_strcasecmp(), slot_getattr(), WalRcvExecResult::status, subname, TextDatumGetCString, TTSOpsMinimalTuple, WalRcvExecResult::tupledesc, WalRcvExecResult::tuplestore, tuplestore_gettupleslot(), walrcv_clear_result(), walrcv_exec, WALRCV_OK_TUPLES, WARNING, and wrconn.
Referenced by AlterSubscription_refresh(), AlterSubscription_refresh_seq(), and CreateSubscription().
|
static |
Definition at line 2493 of file subscriptioncmds.c.
References _, appendStringInfo(), appendStringInfoString(), Assert(), StringInfoData::data, ereport, WalRcvExecResult::err, errcode(), errdetail_plural(), errhint_internal(), errmsg(), errmsg_internal(), ERROR, ExecClearTuple(), ExecDropSingleTupleTableSlot(), get_namespace_name(), get_rel_name(), get_rel_namespace(), GetPublicationsStr(), i, initStringInfo(), list_append_unique(), list_length(), MakeSingleTupleTableSlot(), makeString(), makeStringInfo(), NIL, pfree(), pg_strcasecmp(), slot_getattr(), WalRcvExecResult::status, subname, TextDatumGetCString, TTSOpsMinimalTuple, WalRcvExecResult::tupledesc, WalRcvExecResult::tuplestore, tuplestore_gettupleslot(), walrcv_clear_result(), walrcv_exec, WALRCV_OK_TUPLES, WARNING, and wrconn.
Referenced by AlterSubscription(), AlterSubscription_refresh(), and CreateSubscription().
|
static |
Definition at line 1241 of file subscriptioncmds.c.
References appendStringInfo(), Assert(), StringInfoData::data, Subscription::enabled, ereport, errcode(), errmsg(), ERROR, initStringInfo(), pfree(), PreventInTransactionBlock(), and Subscription::slotname.
Referenced by AlterSubscription().
| void CheckSubDeadTupleRetention | ( | bool | check_guc, |
| bool | sub_disabled, | ||
| int | elevel_for_sub_disabled, | ||
| bool | retain_dead_tuples, | ||
| bool | retention_active, | ||
| bool | max_retention_set | ||
| ) |
Definition at line 2814 of file subscriptioncmds.c.
References Assert(), ereport, errcode(), errhint(), errmsg(), ERROR, NOTICE, track_commit_timestamp, wal_level, WAL_LEVEL_REPLICA, and WARNING.
Referenced by AlterSubscription(), CreateSubscription(), and DisableSubscriptionAndExit().
| ObjectAddress CreateSubscription | ( | ParseState * | pstate, |
| CreateSubscriptionStmt * | stmt, | ||
| bool | isTopLevel | ||
| ) |
Definition at line 584 of file subscriptioncmds.c.
References AccessShareLock, ACL_CREATE, aclcheck_error(), ACLCHECK_OK, AddSubscriptionRelState(), ApplyLauncherWakeupAtCommit(), Assert(), BoolGetDatum(), CatalogTupleInsert(), CharGetDatum(), check_pub_dead_tuple_retention(), check_publications(), check_publications_origin_sequences(), check_publications_origin_tables(), CheckSubDeadTupleRetention(), CheckSubscriptionRelkind(), CRS_NOEXPORT_SNAPSHOT, CStringGetDatum(), CStringGetTextDatum, DirectFunctionCall1, elog, ereport, err(), errcode(), ERRCODE_DUPLICATE_OBJECT, errdetail(), errhint(), errmsg(), ERROR, fetch_relation_list(), foreach_ptr, get_database_name(), get_rel_relkind(), GetNewOidWithIndex(), GetSysCacheOid2, GetUserId(), has_privs_of_role(), heap_form_tuple(), heap_freetuple(), Int32GetDatum(), InvalidOid, InvalidXLogRecPtr, InvokeObjectPostCreateHook, IsSet, load_file(), LSNGetDatum(), MyDatabaseId, NAMEDATALEN, namein(), NOTICE, object_aclcheck(), OBJECT_DATABASE, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, opts, parse_subscription_options(), PG_END_TRY, PG_FINALLY, PG_TRY, pgstat_create_subscription(), PreventInTransactionBlock(), publicationListToArray(), RangeVarGetRelid, recordDependencyOnOwner(), RelationGetDescr, RangeVar::relname, ReplicationOriginNameForLogicalRep(), replorigin_create(), RowExclusiveLock, RangeVar::schemaname, stmt, SUBOPT_BINARY, SUBOPT_CONNECT, SUBOPT_COPY_DATA, SUBOPT_CREATE_SLOT, SUBOPT_DISABLE_ON_ERR, SUBOPT_ENABLED, SUBOPT_FAILOVER, SUBOPT_MAX_RETENTION_DURATION, SUBOPT_ORIGIN, SUBOPT_PASSWORD_REQUIRED, SUBOPT_RETAIN_DEAD_TUPLES, SUBOPT_RUN_AS_OWNER, SUBOPT_SLOT_NAME, SUBOPT_STREAMING, SUBOPT_SYNCHRONOUS_COMMIT, SUBOPT_TWOPHASE_COMMIT, superuser(), superuser_arg(), table_close(), table_open(), UpdateTwoPhaseState(), values, walrcv_check_conninfo, walrcv_connect, walrcv_create_slot, walrcv_disconnect, WARNING, and wrconn.
Referenced by ProcessUtilitySlow().
| char defGetStreamingMode | ( | DefElem * | def | ) |
Definition at line 3144 of file subscriptioncmds.c.
References DefElem::arg, defGetString(), DefElem::defname, ereport, errcode(), errmsg(), ERROR, intVal, nodeTag, and pg_strcasecmp().
Referenced by parse_output_parameters(), and parse_subscription_options().
| void DropSubscription | ( | DropSubscriptionStmt * | stmt, |
| bool | isTopLevel | ||
| ) |
Definition at line 2008 of file subscriptioncmds.c.
References AccessExclusiveLock, aclcheck_error(), ACLCHECK_NOT_OWNER, ApplyLauncherForgetWorkerStartTime(), CatalogTupleDelete(), CStringGetDatum(), DatumGetName(), deleteSharedDependencyRecordsFor(), ereport, err(), errcode(), errmsg(), ERROR, EventTriggerSQLDropAddObject(), GETSTRUCT(), GetSubscriptionRelations(), GetUserId(), HeapTupleIsValid, InvalidOid, InvokeObjectDropHook, lfirst, list_free(), load_file(), LockSharedObject(), logicalrep_worker_stop(), logicalrep_workers_find(), MyDatabaseId, NAMEDATALEN, NameStr, NIL, NoLock, NOTICE, object_ownercheck(), OBJECT_SUBSCRIPTION, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, PG_END_TRY, PG_FINALLY, PG_TRY, pgstat_drop_subscription(), PreventInTransactionBlock(), pstrdup(), ReleaseSysCache(), SubscriptionRelState::relid, LogicalRepWorker::relid, RemoveSubscriptionRel(), ReplicationOriginNameForLogicalRep(), ReplicationSlotDropAtPubNode(), ReplicationSlotNameForTablesync(), replorigin_drop_by_name(), ReportSlotConnectionError(), RowExclusiveLock, SearchSysCache2(), SubscriptionRelState::state, stmt, LogicalRepWorker::subid, subname, superuser_arg(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), HeapTupleData::t_self, table_close(), table_open(), TextDatumGetCString, LogicalRepWorker::type, walrcv_connect, walrcv_disconnect, and wrconn.
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 2878 of file subscriptioncmds.c.
References appendStringInfo(), appendStringInfoString(), Assert(), CppAsString2, StringInfoData::data, DatumGetChar(), destroyStringInfo(), ereport, WalRcvExecResult::err, errcode(), errmsg(), ERROR, ExecClearTuple(), ExecDropSingleTupleTableSlot(), GetPublicationsStr(), initStringInfo(), InvalidOid, lappend(), list_member_rangevar(), makeRangeVar(), MakeSingleTupleTableSlot(), makeStringInfo(), NIL, palloc_object, pfree(), PublicationRelKind::relkind, relname, PublicationRelKind::rv, server_version, slot_getattr(), WalRcvExecResult::status, TextDatumGetCString, TTSOpsMinimalTuple, WalRcvExecResult::tupledesc, WalRcvExecResult::tuplestore, tuplestore_gettupleslot(), walrcv_clear_result(), walrcv_exec, WALRCV_OK_TUPLES, walrcv_server_version, and wrconn.
Referenced by AlterSubscription_refresh(), and CreateSubscription().
Definition at line 2857 of file subscriptioncmds.c.
References equal(), foreach_ptr, and sort-test::list.
Referenced by fetch_relation_list().
|
static |
Definition at line 3085 of file subscriptioncmds.c.
References check_duplicates_in_publist(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, foreach_delete_current, lappend(), lfirst, list_copy(), makeString(), name, strVal, and subname.
Referenced by AlterSubscription().
|
static |
Definition at line 147 of file subscriptioncmds.c.
References Assert(), CStringGetDatum(), DatumGetLSN(), defGetBoolean(), defGetInt32(), defGetStreamingMode(), defGetString(), DefElem::defname, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, errorConflictingDefElem(), GUC_ACTION_SET, InvalidXLogRecPtr, IsSet, lfirst, opts, pfree(), pg_lsn_in(), pg_strcasecmp(), PGC_BACKEND, PGC_S_TEST, pstrdup(), ReplicationSlotValidateName(), set_config_option(), SUBOPT_BINARY, SUBOPT_CONNECT, SUBOPT_COPY_DATA, SUBOPT_CREATE_SLOT, SUBOPT_DISABLE_ON_ERR, SUBOPT_ENABLED, SUBOPT_FAILOVER, SUBOPT_LSN, SUBOPT_MAX_RETENTION_DURATION, SUBOPT_ORIGIN, SUBOPT_PASSWORD_REQUIRED, SUBOPT_REFRESH, SUBOPT_RETAIN_DEAD_TUPLES, SUBOPT_RUN_AS_OWNER, SUBOPT_SLOT_NAME, SUBOPT_STREAMING, SUBOPT_SYNCHRONOUS_COMMIT, SUBOPT_TWOPHASE_COMMIT, and XLogRecPtrIsInvalid.
Referenced by AlterSubscription(), and CreateSubscription().
Definition at line 554 of file subscriptioncmds.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, check_duplicates_in_publist(), construct_array_builtin(), CurrentMemoryContext, list_length(), MemoryContextDelete(), MemoryContextSwitchTo(), palloc(), and PointerGetDatum().
Referenced by AlterSubscription(), and CreateSubscription().
| void ReplicationSlotDropAtPubNode | ( | WalReceiverConn * | wrconn, |
| char * | slotname, | ||
| bool | missing_ok | ||
| ) |
Definition at line 2297 of file subscriptioncmds.c.
References appendStringInfo(), Assert(), StringInfoData::data, ereport, WalRcvExecResult::err, errcode(), errmsg(), ERROR, initStringInfo(), load_file(), LOG, NOTICE, pfree(), PG_END_TRY, PG_FINALLY, PG_TRY, quote_identifier(), WalRcvExecResult::sqlstate, WalRcvExecResult::status, walrcv_clear_result(), WALRCV_ERROR, walrcv_exec, WALRCV_OK_COMMAND, and wrconn.
Referenced by AlterSubscription_refresh(), DropSubscription(), LogicalRepSyncTableStart(), and ProcessSyncingTablesForSync().
|
static |
Definition at line 3001 of file subscriptioncmds.c.
References elog, ereport, err(), errcode(), errhint(), errmsg(), ERROR, lfirst, NAMEDATALEN, OidIsValid, SubscriptionRelState::relid, ReplicationSlotNameForTablesync(), SubscriptionRelState::state, and WARNING.
Referenced by DropSubscription().