1 /*-------------------------------------------------------------------------
4 * definition of the relation sets relation (pg_publication)
6 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/catalog/pg_publication.h
12 * the genbki.pl script reads this file and generates .bki
13 * information from the DATA() statements.
15 *-------------------------------------------------------------------------
17 #ifndef PG_PUBLICATION_H
18 #define PG_PUBLICATION_H
20 #include "catalog/genbki.h"
21 #include "catalog/objectaddress.h"
24 * pg_publication definition. cpp turns this into
25 * typedef struct FormData_pg_publication
29 #define PublicationRelationId 6104
31 CATALOG(pg_publication,6104)
33 NameData pubname; /* name of the publication */
35 Oid pubowner; /* publication owner */
38 * indicates that this is special publication which should encompass all
39 * tables in the database (except for the unlogged and temp ones)
43 /* true if inserts are published */
46 /* true if updates are published */
49 /* true if deletes are published */
52 } FormData_pg_publication;
55 * Form_pg_publication corresponds to a pointer to a tuple with
56 * the format of pg_publication relation.
59 typedef FormData_pg_publication *Form_pg_publication;
62 * compiler constants for pg_publication
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
74 typedef struct PublicationActions
81 typedef struct Publication
86 PublicationActions pubactions;
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);
96 extern ObjectAddress publication_add_relation(Oid pubid, Relation targetrel,
99 extern Oid get_publication_oid(const char *pubname, bool missing_ok);
100 extern char *get_publication_name(Oid pubid);
102 extern Datum pg_get_publication_tables(PG_FUNCTION_ARGS);
104 #endif /* PG_PUBLICATION_H */