*
* pg_subscription.h
* definition of the "subscription" system catalog (pg_subscription)
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_subscription.h
*
* NOTES
* The Catalog.pm module reads this file and derives schema
* information.
*
* -------------------------------------------------------------------------
*/
#ifndef PG_SUBSCRIPTION_H
#define PG_SUBSCRIPTION_H
#include "catalog/genbki.h"
* pg_subscription definition. cpp turns this into
* typedef struct FormData_pg_subscription
* ----------------
*/
* Technically, the subscriptions live inside the database, so a shared catalog
* seems weird, but the replication launcher process needs to access all of
* them to be able to start the workers, so we have to put them in a shared,
* nailed catalog.
*
* NOTE: When adding a column, also update system_views.sql.
*/
#define SubscriptionRelationId 6126
#define SubscriptionRelation_Rowtype_Id 6128
CATALOG(pg_subscription,6126) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6128) BKI_SCHEMA_MACRO
{
Oid subdbid;
NameData subname;
Oid subowner;
bool subenabled;
* worker should be running) */
#ifdef CATALOG_VARLEN
text subconninfo;
NameData subslotname;
text subsynccommit;
text subpublications[1];
bool subbinary;
* publisher to send data in binary */
text subskiplsn;
* skipped */
bool submatchddlowner;
* should match the original owner on the publisher */
bool subsyncconninfo;
#endif
}
FormData_pg_subscription;
typedef FormData_pg_subscription *Form_pg_subscription;
#define Natts_pg_subscription 12
#define Anum_pg_subscription_subdbid 1
#define Anum_pg_subscription_subname 2
#define Anum_pg_subscription_subowner 3
#define Anum_pg_subscription_subenabled 4
#define Anum_pg_subscription_subconninfo 5
#define Anum_pg_subscription_subslotname 6
#define Anum_pg_subscription_subsynccommit 7
#define Anum_pg_subscription_subpublications 8
#define Anum_pg_subscription_subbinary 9
#define Anum_pg_subscription_subskiplsn 10
#define Anum_pg_subscription_submatchddlowner 11
#define Anum_pg_subscription_subsyncconninfo 12
typedef struct Subscription {
Oid oid;
Oid dbid;
char *name;
Oid owner;
bool enabled;
char *conninfo;
char *slotname;
char *synccommit;
List *publications;
bool binary;
XLogRecPtr skiplsn;
* skipped */
bool matchddlowner;
* shold match the original owner on th publisher */
bool subsyncconninfo;
} Subscription;
extern Subscription *GetSubscription(Oid subid, bool missing_ok);
extern void FreeSubscription(Subscription *sub);
extern Oid get_subscription_oid(const char *subname, bool missing_ok);
extern char *get_subscription_name(Oid subid, bool missing_ok);
extern int CountDBSubscriptions(Oid dbid);
extern void ClearListContent(List *list);
extern Datum LsnGetTextDatum(XLogRecPtr lsn);
extern XLogRecPtr TextDatumGetLsn(Datum datum);
#endif