postgresql/src/include/catalog/pg_publication.h

106 lines
2.8 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* pg_publication.h
* definition of the relation sets relation (pg_publication)
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_publication.h
*
* NOTES
* the genbki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_PUBLICATION_H
#define PG_PUBLICATION_H
#include "catalog/genbki.h"
#include "catalog/objectaddress.h"
/* ----------------
* pg_publication definition. cpp turns this into
* typedef struct FormData_pg_publication
*
* ----------------
*/
#define PublicationRelationId 6104
CATALOG(pg_publication,6104)
{
NameData pubname; /* name of the publication */
Oid pubowner; /* publication owner */
/*
* indicates that this is special publication which should encompass all
* tables in the database (except for the unlogged and temp ones)
*/
bool puballtables;
/* true if inserts are published */
bool pubinsert;
/* true if updates are published */
bool pubupdate;
/* true if deletes are published */
bool pubdelete;
} FormData_pg_publication;
/* ----------------
* Form_pg_publication corresponds to a pointer to a tuple with
* the format of pg_publication relation.
* ----------------
*/
typedef FormData_pg_publication *Form_pg_publication;
/* ----------------
* compiler constants for pg_publication
* ----------------
*/
#define Natts_pg_publication 6
#define Anum_pg_publication_pubname 1
#define Anum_pg_publication_pubowner 2
#define Anum_pg_publication_puballtables 3
#define Anum_pg_publication_pubinsert 4
#define Anum_pg_publication_pubupdate 5
#define Anum_pg_publication_pubdelete 6
typedef struct PublicationActions
{
bool pubinsert;
bool pubupdate;
bool pubdelete;
} PublicationActions;
typedef struct Publication
{
Oid oid;
char *name;
bool alltables;
PublicationActions pubactions;
} Publication;
extern Publication *GetPublication(Oid pubid);
extern Publication *GetPublicationByName(const char *pubname, bool missing_ok);
extern List *GetRelationPublications(Oid relid);
extern List *GetPublicationRelations(Oid pubid);
extern List *GetAllTablesPublications(void);
extern List *GetAllTablesPublicationRelations(void);
extern bool is_publishable_relation(Relation rel);
extern ObjectAddress publication_add_relation(Oid pubid, Relation targetrel,
bool if_not_exists);
extern Oid get_publication_oid(const char *pubname, bool missing_ok);
extern char *get_publication_name(Oid pubid);
extern Datum pg_get_publication_tables(PG_FUNCTION_ARGS);
Phase 2 of pgindent updates. Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
#endif /* PG_PUBLICATION_H */