Re: postgres_fdw: Emit message when batch_size is reduced

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw: Emit message when batch_size is reduced
Date: 2026-06-09 20:00:49
Message-ID: CADkLM=c+ZQQ-jd_tAe+i-SoOQk5rrCqf2mFd1FwGXwnz_mkw4A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 9, 2026 at 7:38 AM Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
wrote:

>
>
> On Fri, 5 Jun 2026 at 19:52, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
> wrote:
>
>>
>>>>> - In the test case, choosing a batch_size > PQ_QUERY_PARAM_MAX_LIMIT
>>>>> seems a bit artificial, in that it's a value that can't work for any query
>>>>> with parameters, and someone might add sanity checks to batch_size in
>>>>> option.c, which would in turn invalidate the test case. A test case with a
>>>>> 2-column table should be able to get the same effect any batch_size greater
>>>>> than half of 65535, yes?
>>>>>
>>>>
>>>>
>>>>
>>>
>> Thinking some more on this part, I think it would be worthwhile to check
>> on assignments to batch_size, and issue a NOTICE or WARNING that the set
>> value exceeds PQ_QUERY_PARAM_MAX_LIMIT, but does not reject the change
>> because this value could theoretically (but very unlikely) get smaller in
>> the future and we don't want to mess up any pg_restores or pg_upgrades.
>>
>>
>
> I am not able to understand this clearly, are you saying there should be a
> new check for this NOTICE/WARNING or should the DEBUG1 message (in the
> patch upthread) be a NOTICE/WARNING?
> --
> Regards,
> Rafia Sabih
> CYBERTEC PostgreSQL International GmbH
>

I'm saying that we may want a separate check when the batch_size option is
SET (via CREATE/ALTER TABLE/SERVER) to test the value against
PQ_QUERY_PARAM_MAX_LIMIT
and issue a NOTICE/WARNING that the chosen value will always have to be set
at or below $PQ_QUERY_PARAM_MAX_LIMIT - but still let them store the values
as-is.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2026-06-09 20:22:07 Re: postgres_fdw: Emit message when batch_size is reduced
Previous Message Greg Burd 2026-06-09 19:46:19 RFC: A constraint-enforcement layer, decoupling cross-partition constraints from indexing