Skip to content

Commit 1c1dfff

Browse files
committed
make output of function get_pathman_lib_version() more user-friendly
1 parent f0bd367 commit 1c1dfff

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: expected/pathman_calamity.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SELECT debug_capture();
1313
SELECT get_pathman_lib_version();
1414
get_pathman_lib_version
1515
-------------------------
16-
10410
16+
1.4.10
1717
(1 row)
1818

1919
set client_min_messages = NOTICE;

Diff for: src/pl_funcs.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1606,5 +1606,9 @@ debug_capture(PG_FUNCTION_ARGS)
16061606
Datum
16071607
get_pathman_lib_version(PG_FUNCTION_ARGS)
16081608
{
1609-
PG_RETURN_CSTRING(psprintf("%x", CURRENT_LIB_VERSION));
1609+
uint8 ver_major = (CURRENT_LIB_VERSION & 0xFF0000) >> 16,
1610+
ver_minor = (CURRENT_LIB_VERSION & 0xFF00) >> 8,
1611+
ver_patch = (CURRENT_LIB_VERSION & 0xFF);
1612+
1613+
PG_RETURN_CSTRING(psprintf("%x.%x.%x", ver_major, ver_minor, ver_patch));
16101614
}

0 commit comments

Comments
 (0)