Skip to content

Commit

Permalink
Fix exception detail passing in compression_policy_execute
Browse files Browse the repository at this point in the history
In 2 instances of the exception handling _message and _detail were
not properly set in compression_policy_execute leading to empty
message and detail being reported.
  • Loading branch information
svenklemm committed Nov 1, 2023
1 parent 48f4296 commit 22b556d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .unreleased/pr_6254
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixes: #6254 Fix exception detail passing in compression_policy_execute

Thanks: @fetchezar for reporting an issue with compression policy error messages
6 changes: 6 additions & 0 deletions sql/policy_internal.sql
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ BEGIN
BEGIN
PERFORM @[email protected]_chunk(chunk_rec.oid, if_compressed => true);
EXCEPTION WHEN OTHERS THEN
GET STACKED DIAGNOSTICS
_message = MESSAGE_TEXT,
_detail = PG_EXCEPTION_DETAIL;
RAISE WARNING 'decompressing chunk "%" failed when compression policy is executed', chunk_rec.oid::regclass::text
USING DETAIL = format('Message: (%s), Detail: (%s).', _message, _detail),
ERRCODE = sqlstate;
Expand All @@ -122,6 +125,9 @@ BEGIN
BEGIN
PERFORM @[email protected]_chunk(chunk_rec.oid);
EXCEPTION WHEN OTHERS THEN
GET STACKED DIAGNOSTICS
_message = MESSAGE_TEXT,
_detail = PG_EXCEPTION_DETAIL;
RAISE WARNING 'compressing chunk "%" failed when compression policy is executed', chunk_rec.oid::regclass::text
USING DETAIL = format('Message: (%s), Detail: (%s).', _message, _detail),
ERRCODE = sqlstate;
Expand Down

0 comments on commit 22b556d

Please sign in to comment.