PG15: Handle different ways to get publication actions.

Account for PG commit 52e4f0cd47.
pull/5920/head
Jeff Davis 2022-04-09 10:57:26 -07:00 committed by jeff-davis
parent 1c1ef7ab8d
commit 9915fe8a1a
1 changed files with 13 additions and 1 deletions

View File

@ -2292,18 +2292,30 @@ detoast_values(TupleDesc tupleDesc, Datum *orig_values, bool *isnull)
static void
ColumnarCheckLogicalReplication(Relation rel)
{
bool pubActionInsert = false;
if (!is_publishable_relation(rel))
{
return;
}
#if PG_VERSION_NUM >= PG_VERSION_15
{
PublicationDesc pubdesc;
RelationBuildPublicationDesc(rel, &pubdesc);
pubActionInsert = pubdesc.pubactions.pubinsert;
}
#else
if (rel->rd_pubactions == NULL)
{
GetRelationPublicationActions(rel);
Assert(rel->rd_pubactions != NULL);
}
pubActionInsert = rel->rd_pubactions->pubinsert;
#endif
if (rel->rd_pubactions->pubinsert)
if (pubActionInsert)
{
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg(