Re: Inline non-SQL SRFs using SupportRequestSimplify

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: zengman <zengman(at)halodbtech(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Inline non-SQL SRFs using SupportRequestSimplify
Date: 2025-12-20 11:36:11
Message-ID: CAFj8pRB05eVCRsgTTxzDCtx4G9YLB3D4AKeY7Wp7D6D5gEkP9g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

so 20. 12. 2025 v 11:53 odesílatel zengman <zengman(at)halodbtech(dot)com> napsal:

> I share this opinion. In fact, in the existing tests, if
> test_inline_in_from_support_func is triggered,
> the input parameters are necessarily of type TEXT—so there’s no need for
> an additional type check.
>
> How about changing it to the following?
> ```
> diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
> index b7a926c6f01..adb8b9793ba 100644
> --- a/src/test/regress/regress.c
> +++ b/src/test/regress/regress.c
> @@ -849,9 +849,9 @@ test_inline_in_from_support_func(PG_FUNCTION_ARGS)
> }
>
> c = (Const *) node;
> - if (c->consttype != TEXTOID || c->constisnull)
> + if (c->constisnull)
> {
> - ereport(WARNING,
> (errmsg("test_inline_in_from_support_func called with non-TEXT
> parameters")));
> + ereport(WARNING,
> (errmsg("test_inline_in_from_support_func called with null parameter for
> colname")));
> PG_RETURN_POINTER(NULL);
> }
> colname = TextDatumGetCString(c->constvalue);
> @@ -865,9 +865,9 @@ test_inline_in_from_support_func(PG_FUNCTION_ARGS)
> }
>
> c = (Const *) node;
> - if (c->consttype != TEXTOID || c->constisnull)
> + if (c->constisnull)
> {
> - ereport(WARNING,
> (errmsg("test_inline_in_from_support_func called with non-TEXT
> parameters")));
> + ereport(WARNING,
> (errmsg("test_inline_in_from_support_func called with null parameter for
> tablename")));
> PG_RETURN_POINTER(NULL);
> }
> tablename = TextDatumGetCString(c->constvalue);
>

+1

Pavel

> ```
>
> Regards
> Man Zeng

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2025-12-20 11:37:57 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Previous Message Alexander Korotkov 2025-12-20 11:26:59 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands