diff --git a/pgrx-macros/src/lib.rs b/pgrx-macros/src/lib.rs
index 0087efe9a..f80652a70 100644
--- a/pgrx-macros/src/lib.rs
+++ b/pgrx-macros/src/lib.rs
@@ -1596,13 +1596,13 @@ pub fn pg_guc_hook(attr: TokenStream, item: TokenStream) -> TokenStream {
quote! {
#[::pgrx::pg_guard]
#vis unsafe extern "C-unwind" fn #original_ident(
- newval: <#arg_type as ::pgrx::guc::GucValue>::Raw,
+ newval: <#arg_type as ::pgrx::guc::GucValue>::RawConst,
extra: *mut ::core::ffi::c_void,
) {
#[inline(always)]
#inner_func
- let value = unsafe { <#arg_type as ::pgrx::guc::GucValue>::from_raw(newval) };
+ let value = unsafe { <#arg_type as ::pgrx::guc::GucValue>::from_raw_const(newval) };
#inner_ident(value);
}
}
diff --git a/pgrx-unit-tests/src/tests/guc_tests.rs b/pgrx-unit-tests/src/tests/guc_tests.rs
index 00b74a9c2..488b8c8a9 100644
--- a/pgrx-unit-tests/src/tests/guc_tests.rs
+++ b/pgrx-unit-tests/src/tests/guc_tests.rs
@@ -109,7 +109,7 @@ mod tests {
static GUC: GucSetting