From 7358d615a2f79f6a123aa06cfb652ddfef1b4229 Mon Sep 17 00:00:00 2001 From: Zhang Hao Date: Fri, 25 Aug 2023 16:47:04 +0800 Subject: [PATCH] fix creating extension with global option appendonly=true. (#366) All tables in diskquota use primary keys. Unique index tables are created for primary keys. Unique index tables can not be created for tables with the option appendonly=true. This issue only occurs in gp6 since `set gp_default_storage_options='appendonly=true';` is disabled in gp7. Solution: add `appendonly=false` to each table with the primary key. Co-authored-by: Evgeniy Ratkov --- control/ddl/diskquota--2.3.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/control/ddl/diskquota--2.3.sql b/control/ddl/diskquota--2.3.sql index 8be7749f..bf2e7411 100644 --- a/control/ddl/diskquota--2.3.sql +++ b/control/ddl/diskquota--2.3.sql @@ -11,7 +11,7 @@ CREATE TABLE diskquota.quota_config( quotalimitMB int8, segratio float4 DEFAULT 0, PRIMARY KEY(targetOid, quotatype) -) DISTRIBUTED BY (targetOid, quotatype); +) WITH (appendonly=false) DISTRIBUTED BY (targetOid, quotatype); CREATE TABLE diskquota.target ( rowId serial, @@ -19,19 +19,19 @@ CREATE TABLE diskquota.target ( primaryOid oid, tablespaceOid oid, --REFERENCES pg_tablespace.oid, PRIMARY KEY (primaryOid, tablespaceOid, quotatype) -); +) WITH (appendonly=false); CREATE TABLE diskquota.table_size( tableid oid, size bigint, segid smallint, PRIMARY KEY(tableid, segid) -) DISTRIBUTED BY (tableid, segid); +) WITH (appendonly=false) DISTRIBUTED BY (tableid, segid); CREATE TABLE diskquota.state( state int, PRIMARY KEY(state) -) DISTRIBUTED BY (state); +) WITH (appendonly=false) DISTRIBUTED BY (state); -- diskquota.quota_config AND diskquota.target is dump-able, other table can be generate on fly SELECT pg_catalog.pg_extension_config_dump('diskquota.quota_config', '');