summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_publication.h26
-rw-r--r--src/include/commands/publicationcmds.h2
-rw-r--r--src/include/replication/logicalproto.h11
4 files changed, 30 insertions, 11 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 28de0c83342..586b83f2f4d 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202501171
+#define CATALOG_VERSION_NO 202501231
#endif
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
index 3c2ae2a960c..9e6cddcac4c 100644
--- a/src/include/catalog/pg_publication.h
+++ b/src/include/catalog/pg_publication.h
@@ -55,8 +55,11 @@ CATALOG(pg_publication,6104,PublicationRelationId)
/* true if partition changes are published using root schema */
bool pubviaroot;
- /* true if generated columns data should be published */
- bool pubgencols;
+ /*
+ * 'n'(none) if generated column data should not be published. 's'(stored)
+ * if stored generated column data should be published.
+ */
+ char pubgencols_type;
} FormData_pg_publication;
/* ----------------
@@ -107,13 +110,27 @@ typedef struct PublicationDesc
bool gencols_valid_for_delete;
} PublicationDesc;
+#ifdef EXPOSE_TO_CLIENT_CODE
+
+typedef enum PublishGencolsType
+{
+ /* Generated columns present should not be replicated. */
+ PUBLISH_GENCOLS_NONE = 'n',
+
+ /* Generated columns present should be replicated. */
+ PUBLISH_GENCOLS_STORED = 's',
+
+} PublishGencolsType;
+
+#endif /* EXPOSE_TO_CLIENT_CODE */
+
typedef struct Publication
{
Oid oid;
char *name;
bool alltables;
bool pubviaroot;
- bool pubgencols;
+ PublishGencolsType pubgencols_type;
PublicationActions pubactions;
} Publication;
@@ -171,6 +188,7 @@ extern ObjectAddress publication_add_schema(Oid pubid, Oid schemaid,
extern Bitmapset *pub_collist_to_bitmapset(Bitmapset *columns, Datum pubcols,
MemoryContext mcxt);
-extern Bitmapset *pub_form_cols_map(Relation relation, bool include_gencols);
+extern Bitmapset *pub_form_cols_map(Relation relation,
+ PublishGencolsType include_gencols_type);
#endif /* PG_PUBLICATION_H */
diff --git a/src/include/commands/publicationcmds.h b/src/include/commands/publicationcmds.h
index 170c5ce00f0..e11a942ea0f 100644
--- a/src/include/commands/publicationcmds.h
+++ b/src/include/commands/publicationcmds.h
@@ -35,7 +35,7 @@ extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
List *ancestors, bool pubviaroot);
extern bool pub_contains_invalid_column(Oid pubid, Relation relation,
List *ancestors, bool pubviaroot,
- bool pubgencols,
+ char pubgencols_type,
bool *invalid_column_list,
bool *invalid_gen_col);
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 7012247825d..b261c60d3fa 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -225,19 +225,20 @@ extern char *logicalrep_read_origin(StringInfo in, XLogRecPtr *origin_lsn);
extern void logicalrep_write_insert(StringInfo out, TransactionId xid,
Relation rel, TupleTableSlot *newslot,
bool binary, Bitmapset *columns,
- bool include_gencols);
+ PublishGencolsType include_gencols_type);
extern LogicalRepRelId logicalrep_read_insert(StringInfo in, LogicalRepTupleData *newtup);
extern void logicalrep_write_update(StringInfo out, TransactionId xid,
Relation rel, TupleTableSlot *oldslot,
TupleTableSlot *newslot, bool binary,
- Bitmapset *columns, bool include_gencols);
+ Bitmapset *columns,
+ PublishGencolsType include_gencols_type);
extern LogicalRepRelId logicalrep_read_update(StringInfo in,
bool *has_oldtuple, LogicalRepTupleData *oldtup,
LogicalRepTupleData *newtup);
extern void logicalrep_write_delete(StringInfo out, TransactionId xid,
Relation rel, TupleTableSlot *oldslot,
bool binary, Bitmapset *columns,
- bool include_gencols);
+ PublishGencolsType include_gencols_type);
extern LogicalRepRelId logicalrep_read_delete(StringInfo in,
LogicalRepTupleData *oldtup);
extern void logicalrep_write_truncate(StringInfo out, TransactionId xid,
@@ -249,7 +250,7 @@ extern void logicalrep_write_message(StringInfo out, TransactionId xid, XLogRecP
bool transactional, const char *prefix, Size sz, const char *message);
extern void logicalrep_write_rel(StringInfo out, TransactionId xid,
Relation rel, Bitmapset *columns,
- bool include_gencols);
+ PublishGencolsType include_gencols_type);
extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
extern void logicalrep_write_typ(StringInfo out, TransactionId xid,
Oid typoid);
@@ -274,6 +275,6 @@ extern void logicalrep_read_stream_abort(StringInfo in,
extern const char *logicalrep_message_type(LogicalRepMsgType action);
extern bool logicalrep_should_publish_column(Form_pg_attribute att,
Bitmapset *columns,
- bool include_gencols);
+ PublishGencolsType include_gencols_type);
#endif /* LOGICAL_PROTO_H */