Skip to content

Commit

Permalink
fix creating extension with global option appendonly=true. (#366)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
zhrt123 and red1452 authored Aug 25, 2023
1 parent c7acb6b commit 7358d61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions control/ddl/diskquota--2.3.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ 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,
quotatype int, --REFERENCES disquota.quota_config.quotatype,
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', '');
Expand Down

0 comments on commit 7358d61

Please sign in to comment.