Hi all,
Ayush Tiwari <ayushtiwari.slg01@gmail.com> 于2026年5月27日周三 15:16写道:
>
> Hi,
>
> On Wed, 27 May 2026 at 09:20, Tender Wang <tndrwang@gmail.com> wrote:
>>
>> Hi, all
>>
>> I find an easier way as follows:
>> diff --git a/contrib/pg_plan_advice/pgpa_trove.c
>> b/contrib/pg_plan_advice/pgpa_trove.c
>> index ca69f3bd3df..64af4b1435b 100644
>> --- a/contrib/pg_plan_advice/pgpa_trove.c
>> +++ b/contrib/pg_plan_advice/pgpa_trove.c
>> @@ -179,7 +179,6 @@ pgpa_build_trove(List *advice_items)
>> * but in the future this
>> might not be true, e.g. a custom
>> * scan could replace a join.
>> */
>> - Assert(target->ttype ==
>> PGPA_TARGET_IDENTIFIER);
>> pgpa_trove_add_to_slice(&trove->scan,
>>
>> item->tag, target);
>> }
>
>
> Thanks for checking this.
>
> I agree that removing the assertion looks like the better approach.
I attached a patch to fix this issue.
In syntax.sql, I saw this:
"
-- Tags like SEQ_SCAN and NO_GATHER don't allow sublists at all; other tags,
-- except for JOIN_ORDER, allow at most one level of sublist. Hence, these
-- examples should error out.
"
So 'DO_NOT_SCAN((x))' is valid syntax. The original codes in
pgpa_build_trove() may
forget about this case. I added this syntax case to the syntax.sql.
I also added the query to scan.sql and adjusted the original comments.
--
Thanks,
Tender Wang