PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pg_publication.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_publication.h
4  * definition of the relation sets relation (pg_publication)
5  *
6  * Portions Copyright (c) 1996-2017, 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 genbki.pl script reads this file and generates .bki
13  * information from the DATA() statements.
14  *
15  *-------------------------------------------------------------------------
16  */
17 #ifndef PG_PUBLICATION_H
18 #define PG_PUBLICATION_H
19 
20 #include "catalog/genbki.h"
21 #include "catalog/objectaddress.h"
22 
23 /* ----------------
24  * pg_publication definition. cpp turns this into
25  * typedef struct FormData_pg_publication
26  *
27  * ----------------
28  */
29 #define PublicationRelationId 6104
30 
31 CATALOG(pg_publication,6104)
32 {
33  NameData pubname; /* name of the publication */
34 
35  Oid pubowner; /* publication owner */
36 
37  /*
38  * indicates that this is special publication which should encompass
39  * all tables in the database (except for the unlogged and temp ones)
40  */
41  bool puballtables;
42 
43  /* true if inserts are published */
44  bool pubinsert;
45 
46  /* true if updates are published */
47  bool pubupdate;
48 
49  /* true if deletes are published */
50  bool pubdelete;
51 
53 
54 /* ----------------
55  * Form_pg_publication corresponds to a pointer to a tuple with
56  * the format of pg_publication relation.
57  * ----------------
58  */
60 
61 /* ----------------
62  * compiler constants for pg_publication
63  * ----------------
64  */
65 
66 #define Natts_pg_publication 6
67 #define Anum_pg_publication_pubname 1
68 #define Anum_pg_publication_pubowner 2
69 #define Anum_pg_publication_puballtables 3
70 #define Anum_pg_publication_pubinsert 4
71 #define Anum_pg_publication_pubupdate 5
72 #define Anum_pg_publication_pubdelete 6
73 
74 typedef struct PublicationActions
75 {
76  bool pubinsert;
77  bool pubupdate;
78  bool pubdelete;
80 
81 typedef struct Publication
82 {
84  char *name;
85  bool alltables;
87 } Publication;
88 
89 extern Publication *GetPublication(Oid pubid);
90 extern Publication *GetPublicationByName(const char *pubname, bool missing_ok);
91 extern List *GetRelationPublications(Oid relid);
92 extern List *GetPublicationRelations(Oid pubid);
93 extern List *GetAllTablesPublications(void);
95 
96 extern ObjectAddress publication_add_relation(Oid pubid, Relation targetrel,
97  bool if_not_exists);
98 
99 extern Oid get_publication_oid(const char *pubname, bool missing_ok);
100 extern char *get_publication_name(Oid pubid);
101 
103 
104 #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)
unsigned int Oid
Definition: postgres_ext.h:31
CATALOG(pg_publication, 6104)
FormData_pg_publication
Definition: c.h:489
List * GetRelationPublications(Oid relid)
struct PublicationActions PublicationActions
uintptr_t Datum
Definition: postgres.h:374
List * GetAllTablesPublicationRelations(void)
Publication * GetPublicationByName(const char *pubname, bool missing_ok)
#define PG_FUNCTION_ARGS
Definition: fmgr.h:150
FormData_pg_publication * Form_pg_publication
Definition: pg_list.h:45
List * GetPublicationRelations(Oid pubid)
Publication * GetPublication(Oid pubid)