]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_publication.h
Phase 2 of pgindent updates.
[postgresql] / src / include / catalog / pg_publication.h
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 all
39          * 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
52 } FormData_pg_publication;
53
54 /* ----------------
55  *              Form_pg_publication corresponds to a pointer to a tuple with
56  *              the format of pg_publication relation.
57  * ----------------
58  */
59 typedef FormData_pg_publication *Form_pg_publication;
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;
79 } PublicationActions;
80
81 typedef struct Publication
82 {
83         Oid                     oid;
84         char       *name;
85         bool            alltables;
86         PublicationActions pubactions;
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);
94 extern List *GetAllTablesPublicationRelations(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
102 extern Datum pg_get_publication_tables(PG_FUNCTION_ARGS);
103
104 #endif                                                  /* PG_PUBLICATION_H */