Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct error in 5.2.0 update file #713

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
5.2.1
=====
BUG FIXES
---------
- Corrected a syntax error in the 5.1.0 to 5.2.0 update file. There are no problems with a direct install of 5.2.0 and there is no technical need to update to 5.2.1. The issue was encountered only when updating from any prior version to 5.2.0. New release was tagged to ease rolling out the fix for package managers.


5.2.0
=====
Expand Down
6 changes: 3 additions & 3 deletions META.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pg_partman",
"abstract": "Extension to manage partitioned tables by time or ID",
"version": "5.2.0",
"version": "5.2.1",
"maintainer": [
"Keith Fiske <[email protected]>"
],
Expand All @@ -20,9 +20,9 @@
},
"provides": {
"pg_partman": {
"file": "sql/pg_partman--5.2.0.sql",
"file": "sql/pg_partman--5.2.1.sql",
"docfile": "doc/pg_partman.md",
"version": "5.2.0",
"version": "5.2.1",
"abstract": "Extension to manage partitioned tables by time or ID"
}
},
Expand Down
2 changes: 1 addition & 1 deletion pg_partman.control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_version = '5.2.0'
default_version = '5.2.1'
comment = 'Extension to manage partitioned tables by time or ID'
relocatable = false
superuser = false
8 changes: 4 additions & 4 deletions test/test-time-monthly.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
BEGIN;
SELECT set_config('search_path','partman, public',false);

SELECT plan(122);
SELECT plan(121);
CREATE SCHEMA partman_test;
CREATE SCHEMA partman_retention_test;

Expand Down Expand Up @@ -167,9 +167,9 @@ SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(date_trunc('mon
'Check time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'3 month'::interval, 'YYYYMMDD')||' exists');
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'4 month'::interval, 'YYYYMMDD'),
'Check time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'4 month'::interval, 'YYYYMMDD')||' exists');
-- For some reason, edge case of re-creating child tables goes one beyond premake. Not too worried about why or how in this situation
SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'5 month'::interval, 'YYYYMMDD'),
'Check time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'5 month'::interval, 'YYYYMMDD')||' exists');
-- For some reason, edge case of re-creating child tables sometimes goes one beyond premake. Investigate when time. Should not create one 2 beyond premake
--SELECT has_table('partman_test', 'time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'5 month'::interval, 'YYYYMMDD'),
-- 'Check time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'5 month'::interval, 'YYYYMMDD')||' exists');
SELECT hasnt_table('partman_test', 'time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'6 month'::interval, 'YYYYMMDD'),
'Check time_taptest_table_p'||to_char(date_trunc('month', CURRENT_TIMESTAMP)+'6 month'::interval, 'YYYYMMDD')||' does not exist');

Expand Down
9 changes: 5 additions & 4 deletions updates/pg_partman--5.1.0--5.2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AND routine_name = 'create_parent'
AND grantee != 'PUBLIC';

INSERT INTO partman_preserve_privs_temp
SELECT 'GRANT EXECUTE ON FUNCTION @extschema@. TO '||array_to_string(array_agg('"'||grantee::text||'"'), ',')||';'
SELECT 'GRANT EXECUTE ON FUNCTION @extschema@.create_sub_parent(text, text, text, text, boolean, text, text[], int, text, text, boolean, text, boolean, text, text) TO '||array_to_string(array_agg('"'||grantee::text||'"'), ',')||';'
FROM information_schema.routine_privileges
WHERE routine_schema = '@extschema@'
AND routine_name = 'create_sub_parent'
Expand Down Expand Up @@ -4250,6 +4250,10 @@ END LOOP;

EXECUTE format('ANALYZE %I.%I', v_parent_schema, v_parent_tablename);

PERFORM pg_advisory_unlock(hashtext('pg_partman reapply_constraints'));
END
$$;


CREATE FUNCTION @[email protected]_time_encoder(ts TIMESTAMPTZ)
RETURNS UUID
Expand Down Expand Up @@ -4287,9 +4291,6 @@ BEGIN
RETURN to_timestamp(ts_millis / 1000.0);
END;
$$;
PERFORM pg_advisory_unlock(hashtext('pg_partman reapply_constraints'));
END
$$;


-- Restore dropped object privileges
Expand Down
1 change: 1 addition & 0 deletions updates/pg_partman--5.2.0--5.2.1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- NOTE: No changes to the sql extension code contained in this update. This file is only here for version upgrade continuity.
Loading