From 1d4e6e7ed08a52339ba8d776fef0b79b451cdc72 Mon Sep 17 00:00:00 2001 From: Steven Lee Date: Tue, 16 Feb 2021 12:16:34 +0800 Subject: [PATCH] Support pg14 --- .travis.yml | 1 + Makefile | 4 ++-- cstore_fdw.c | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 734a9b5..07c7e7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ env: - PGVERSION=11 - PGVERSION=12 - PGVERSION=13 + - PGVERSION=14 before_install: - git clone -b v0.7.13 --depth 1 https://github.com/citusdata/tools.git diff --git a/Makefile b/Makefile index a329d79..0b69b8b 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,8 @@ ifndef MAJORVERSION MAJORVERSION := $(basename $(VERSION)) endif -ifeq (,$(findstring $(MAJORVERSION), 9.3 9.4 9.5 9.6 10 11 12 13)) - $(error PostgreSQL 9.3 to 13 is required to compile this extension) +ifeq (,$(findstring $(MAJORVERSION), 9.3 9.4 9.5 9.6 10 11 12 13 14)) + $(error PostgreSQL 9.3 to 14 is required to compile this extension) endif cstore.pb-c.c: cstore.proto diff --git a/cstore_fdw.c b/cstore_fdw.c index 7bfac28..5ee7681 100644 --- a/cstore_fdw.c +++ b/cstore_fdw.c @@ -717,7 +717,13 @@ CopyOutCStoreTable(CopyStmt* copyStatement, const char* queryString) static void CStoreProcessAlterTableCommand(AlterTableStmt *alterStatement) { + + #if PG_VERSION_NUM >= 140000 + ObjectType objectType = alterStatement->objtype; + #else ObjectType objectType = alterStatement->relkind; + #endif + RangeVar *relationRangeVar = alterStatement->relation; Oid relationId = InvalidOid; List *commandList = alterStatement->cmds;