Skip to content

Commit

Permalink
simplify 1.8--1.8.1 and 1.8.2-1.8.3 sqls (#114)
Browse files Browse the repository at this point in the history
* simplify 1.8-1.8.1

* simplify 1.8.2-1.8.3
  • Loading branch information
visill authored Feb 21, 2025
1 parent b357ca2 commit f4122ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 35 deletions.
29 changes: 10 additions & 19 deletions yezzey--1.8--1.8.1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CREATE OR REPLACE FUNCTION yezzey_vacuum_garbage(
confirm BOOLEAN DEFAULT FALSE,
crazyDrop BOOLEAN DEFAULT FALSE
) RETURNS void
) RETURNS VOID
AS 'MODULE_PATHNAME'
VOLATILE
EXECUTE ON ALL SEGMENTS
Expand All @@ -13,7 +13,7 @@ CREATE OR REPLACE FUNCTION yezzey_vacuum_relation(
reloid OID,
confirm BOOLEAN DEFAULT FALSE,
crazyDrop BOOLEAN DEFAULT FALSE
) RETURNS void
) RETURNS VOID
AS 'MODULE_PATHNAME'
VOLATILE
EXECUTE ON ALL SEGMENTS
Expand All @@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION yezzey_vacuum_relation(
relname TEXT,
confirm BOOLEAN DEFAULT FALSE,
crazyDrop BOOLEAN DEFAULT FALSE
) RETURNS void
) RETURNS VOID
AS $$ SELECT yezzey_vacuum_relation(relname::regclass::oid, confirm, crazyDrop) $$
LANGUAGE SQL;

Expand All @@ -33,7 +33,7 @@ CREATE OR REPLACE FUNCTION yezzey_vacuum_garbage_relation(
i_offload_relname TEXT,
confirm BOOLEAN DEFAULT FALSE,
crazyDrop BOOLEAN DEFAULT FALSE
) RETURNS void
) RETURNS VOID
AS $$
DECLARE
v_reloid OID;
Expand Down Expand Up @@ -68,26 +68,17 @@ $$
LANGUAGE PLPGSQL;


CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_to_1_8_1() RETURNS void
AS 'MODULE_PATHNAME'
VOLATILE
EXECUTE ON ALL SEGMENTS
LANGUAGE C STRICT;


CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_to_1_8_1_m() RETURNS void
CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_to_1_8_1_m() RETURNS VOID
AS 'MODULE_PATHNAME','yezzey_binary_upgrade_1_8_to_1_8_1'
VOLATILE
EXECUTE ON MASTER
LANGUAGE C STRICT;
LANGUAGE C STRICT
EXECUTE ON MASTER;


CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_to_1_8_1_seg()
RETURNS VOID AS
$$
SELECT yezzey.yezzey_binary_upgrade_1_8_to_1_8_1();
$$
LANGUAGE SQL
RETURNS VOID AS 'MODULE_PATHNAME','yezzey_binary_upgrade_1_8_to_1_8_1'
VOLATILE
LANGUAGE C STRICT
EXECUTE ON ALL SEGMENTS;

SET allow_segment_dml TO ON;
Expand Down
22 changes: 6 additions & 16 deletions yezzey--1.8.2--1.8.3.sql
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@


CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3() RETURNS void
AS 'MODULE_PATHNAME'
CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3_m() RETURNS VOID
AS 'MODULE_PATHNAME','yezzey_binary_upgrade_1_8_2_to_1_8_3'
VOLATILE
EXECUTE ON ALL SEGMENTS
LANGUAGE C STRICT;
LANGUAGE C STRICT
EXECUTE ON MASTER;


CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3_m() RETURNS void
CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3_seg() RETURNS VOID
AS 'MODULE_PATHNAME','yezzey_binary_upgrade_1_8_2_to_1_8_3'
VOLATILE
EXECUTE ON MASTER
LANGUAGE C STRICT;


CREATE OR REPLACE FUNCTION yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3_seg()
RETURNS VOID AS
$$
SELECT yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3();
$$
LANGUAGE SQL
LANGUAGE C STRICT
EXECUTE ON ALL SEGMENTS;

SELECT yezzey.yezzey_binary_upgrade_1_8_2_to_1_8_3_seg();
Expand Down

0 comments on commit f4122ee

Please sign in to comment.