PostgreSQL Source Code  git master
pg_publication.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_publication.h
4  * definition of the "publication" system catalog (pg_publication)
5  *
6  * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/catalog/pg_publication.h
10  *
11  * NOTES
12  * The Catalog.pm module reads this file and derives schema
13  * information.
14  *
15  *-------------------------------------------------------------------------
16  */
17 #ifndef PG_PUBLICATION_H
18 #define PG_PUBLICATION_H
19 
20 #include "catalog/genbki.h"
21 #include "catalog/pg_publication_d.h"
22 
23 #include "catalog/objectaddress.h"
24 
25 /* ----------------
26  * pg_publication definition. cpp turns this into
27  * typedef struct FormData_pg_publication
28  * ----------------
29  */
30 CATALOG(pg_publication,6104,PublicationRelationId)
31 {
32  NameData pubname; /* name of the publication */
33 
34  Oid pubowner; /* publication owner */
35 
36  /*
37  * indicates that this is special publication which should encompass all
38  * tables in the database (except for the unlogged and temp ones)
39  */
40  bool puballtables;
41 
42  /* true if inserts are published */
43  bool pubinsert;
44 
45  /* true if updates are published */
46  bool pubupdate;
47 
48  /* true if deletes are published */
49  bool pubdelete;
50 
51  /* true if truncates are published */
52  bool pubtruncate;
53 
55 
56 /* ----------------
57  * Form_pg_publication corresponds to a pointer to a tuple with
58  * the format of pg_publication relation.
59  * ----------------
60  */
62 
63 typedef struct PublicationActions
64 {
65  bool pubinsert;
66  bool pubupdate;
67  bool pubdelete;
70 
71 typedef struct Publication
72 {
74  char *name;
75  bool alltables;
77 } Publication;
78 
79 extern Publication *GetPublication(Oid pubid);
80 extern Publication *GetPublicationByName(const char *pubname, bool missing_ok);
81 extern List *GetRelationPublications(Oid relid);
82 extern List *GetPublicationRelations(Oid pubid);
83 extern List *GetAllTablesPublications(void);
85 
86 extern bool is_publishable_relation(Relation rel);
87 extern ObjectAddress publication_add_relation(Oid pubid, Relation targetrel,
88  bool if_not_exists);
89 
90 extern Oid get_publication_oid(const char *pubname, bool missing_ok);
91 extern char *get_publication_name(Oid pubid);
92 
94 
95 #endif /* PG_PUBLICATION_H */
PublicationActions pubactions
Oid get_publication_oid(const char *pubname, bool missing_ok)
ObjectAddress publication_add_relation(Oid pubid, Relation targetrel, bool if_not_exists)
List * GetAllTablesPublications(void)
struct Publication Publication
char * get_publication_name(Oid pubid)
Datum pg_get_publication_tables(PG_FUNCTION_ARGS)
bool is_publishable_relation(Relation rel)
unsigned int Oid
Definition: postgres_ext.h:31
FormData_pg_publication
Definition: c.h:570
List * GetRelationPublications(Oid relid)
struct PublicationActions PublicationActions
uintptr_t Datum
Definition: postgres.h:367
List * GetAllTablesPublicationRelations(void)
Publication * GetPublicationByName(const char *pubname, bool missing_ok)
CATALOG(pg_publication, 6104, PublicationRelationId)
#define PG_FUNCTION_ARGS
Definition: fmgr.h:163
FormData_pg_publication * Form_pg_publication
Definition: pg_list.h:45
List * GetPublicationRelations(Oid pubid)
Publication * GetPublication(Oid pubid)