Skip to content

Commit

Permalink
Merge pull request #5 from arenadata/ADBDEV-1255
Browse files Browse the repository at this point in the history
implement extension upgrade
  • Loading branch information
Stolb27 committed Apr 19, 2021
2 parents 059608e + 5e385ff commit 23d9dc9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
MODULE_big = diskquota

EXTENSION = diskquota
DATA = diskquota--1.0.sql
EXTENSION_VERSION = 1.0.3

DATA = \
diskquota--1.0.sql \
diskquota--1.0--1.0.3.sql \

DATA_built = diskquota--$(EXTENSION_VERSION).sql

SRCDIR = ./
FILES = diskquota.c enforcement.c quotamodel.c gp_activetable.c diskquota_utility.c
OBJS = diskquota.o enforcement.o quotamodel.o gp_activetable.o diskquota_utility.o
Expand All @@ -18,3 +25,6 @@ REGRESS_OPTS = --schedule=diskquota_schedule --init-file=init_file
endif
PGXS := $(shell pg_config --pgxs)
include $(PGXS)

diskquota--$(EXTENSION_VERSION).sql:
cat $(DATA) > diskquota--$(EXTENSION_VERSION).sql
8 changes: 8 additions & 0 deletions diskquota--1.0--1.0.3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\echo use "alter extension diskquota update to '1.0.3'" to load this file. \quit

SELECT gp_segment_id, pg_catalog.pg_extension_config_dump('diskquota.quota_config', '') from gp_dist_random('gp_id');

CREATE FUNCTION diskquota.update_diskquota_db_list(oid, int4)
RETURNS void STRICT
AS 'MODULE_PATHNAME'
LANGUAGE C;
6 changes: 0 additions & 6 deletions diskquota--1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ CREATE SCHEMA diskquota;
CREATE TABLE diskquota.quota_config (targetOid oid, quotatype int, quotalimitMB int8, PRIMARY KEY(targetOid, quotatype));

SELECT pg_catalog.pg_extension_config_dump('diskquota.quota_config', '');
SELECT gp_segment_id, pg_catalog.pg_extension_config_dump('diskquota.quota_config', '') from gp_dist_random('gp_id');

CREATE FUNCTION diskquota.set_schema_quota(text, text)
RETURNS void STRICT
Expand All @@ -21,11 +20,6 @@ RETURNS void STRICT
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE FUNCTION diskquota.update_diskquota_db_list(oid, int4)
RETURNS void STRICT
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE TABLE diskquota.table_size (tableid oid, size bigint, PRIMARY KEY(tableid));

CREATE TABLE diskquota.state (state int, PRIMARY KEY(state));
Expand Down
2 changes: 1 addition & 1 deletion diskquota.control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# diskquota extension
comment = 'Disk Quota Main Program'
default_version = '1.0'
default_version = '1.0.3'
module_pathname = '$libdir/diskquota'
relocatable = true

0 comments on commit 23d9dc9

Please sign in to comment.