Skip to content

Commit 4e8efb7

Browse files
authored
Merge pull request #256 from postgrespro/PGPRO-7397
Fix build due to new checks in PostgreSQL 16
2 parents 7a24403 + 2680eee commit 4e8efb7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/pl_funcs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ get_partition_cooked_key_pl(PG_FUNCTION_ARGS)
179179
pfree(expr_cstr);
180180
pfree(expr);
181181

182-
PG_RETURN_TEXT_P(CStringGetTextDatum(cooked_cstr));
182+
PG_RETURN_DATUM(CStringGetTextDatum(cooked_cstr));
183183
}
184184

185185
/*
@@ -199,7 +199,7 @@ get_cached_partition_cooked_key_pl(PG_FUNCTION_ARGS)
199199
res = CStringGetTextDatum(nodeToString(prel->expr));
200200
close_pathman_relation_info(prel);
201201

202-
PG_RETURN_TEXT_P(res);
202+
PG_RETURN_DATUM(res);
203203
}
204204

205205
/*
@@ -688,7 +688,7 @@ validate_expression(PG_FUNCTION_ARGS)
688688

689689
if (!PG_ARGISNULL(1))
690690
{
691-
expression = TextDatumGetCString(PG_GETARG_TEXT_P(1));
691+
expression = TextDatumGetCString(PG_GETARG_DATUM(1));
692692
}
693693
else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
694694
errmsg("'expression' should not be NULL")));
@@ -818,7 +818,7 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
818818

819819
if (!PG_ARGISNULL(1))
820820
{
821-
expression = TextDatumGetCString(PG_GETARG_TEXT_P(1));
821+
expression = TextDatumGetCString(PG_GETARG_DATUM(1));
822822
}
823823
else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
824824
errmsg("'expression' should not be NULL")));
@@ -1203,7 +1203,7 @@ is_operator_supported(PG_FUNCTION_ARGS)
12031203
{
12041204
Oid opid,
12051205
typid = PG_GETARG_OID(0);
1206-
char *opname = TextDatumGetCString(PG_GETARG_TEXT_P(1));
1206+
char *opname = TextDatumGetCString(PG_GETARG_DATUM(1));
12071207

12081208
opid = compatible_oper_opid(list_make1(makeString(opname)),
12091209
typid, typid, true);

src/pl_hash_funcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Datum
119119
build_hash_condition(PG_FUNCTION_ARGS)
120120
{
121121
Oid expr_type = PG_GETARG_OID(0);
122-
char *expr_cstr = TextDatumGetCString(PG_GETARG_TEXT_P(1));
122+
char *expr_cstr = TextDatumGetCString(PG_GETARG_DATUM(1));
123123
uint32 part_count = PG_GETARG_UINT32(2),
124124
part_idx = PG_GETARG_UINT32(3);
125125

src/pl_range_funcs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ create_single_range_partition_pl(PG_FUNCTION_ARGS)
156156
/* Fetch 'tablespace' */
157157
if (!PG_ARGISNULL(4))
158158
{
159-
tablespace = TextDatumGetCString(PG_GETARG_TEXT_P(4));
159+
tablespace = TextDatumGetCString(PG_GETARG_DATUM(4));
160160
}
161161
else tablespace = NULL; /* default */
162162

@@ -429,7 +429,7 @@ validate_interval_value(PG_FUNCTION_ARGS)
429429
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
430430
errmsg("'expression' should not be NULL")));
431431
}
432-
else expr_cstr = TextDatumGetCString(PG_GETARG_TEXT_P(ARG_EXPRESSION));
432+
else expr_cstr = TextDatumGetCString(PG_GETARG_DATUM(ARG_EXPRESSION));
433433

434434
if (PG_ARGISNULL(ARG_PARTTYPE))
435435
{
@@ -1086,7 +1086,7 @@ build_range_condition(PG_FUNCTION_ARGS)
10861086

10871087
if (!PG_ARGISNULL(1))
10881088
{
1089-
expression = TextDatumGetCString(PG_GETARG_TEXT_P(1));
1089+
expression = TextDatumGetCString(PG_GETARG_DATUM(1));
10901090
}
10911091
else ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10921092
errmsg("'expression' should not be NULL")));;

0 commit comments

Comments
 (0)