From 8c6bbd674ed810df9af5ec42f6b38c205e3ad365 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 3 Dec 2025 08:52:28 +0100 Subject: [PATCH] Use more appropriate DatumGet* function Use DatumGetCString() instead of DatumGetPointer() for returning a C string. Right now, they are the same, but that doesn't always have to be so. Reviewed-by: Chao Li Reviewed-by: Bertrand Drouvot Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd01-1235cc50e933%40eisentraut.org --- src/test/modules/test_resowner/test_resowner_basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/modules/test_resowner/test_resowner_basic.c b/src/test/modules/test_resowner/test_resowner_basic.c index 8f794996371..b84ec2cb299 100644 --- a/src/test/modules/test_resowner/test_resowner_basic.c +++ b/src/test/modules/test_resowner/test_resowner_basic.c @@ -35,13 +35,13 @@ static const ResourceOwnerDesc string_desc = { static void ReleaseString(Datum res) { - elog(NOTICE, "releasing string: %s", DatumGetPointer(res)); + elog(NOTICE, "releasing string: %s", DatumGetCString(res)); } static char * PrintString(Datum res) { - return psprintf("test string \"%s\"", DatumGetPointer(res)); + return psprintf("test string \"%s\"", DatumGetCString(res)); } /* demonstrates phases and priorities between a parent and child context */ -- 2.39.5