Re: [PATCH] check kernel version for io_method

Steven Niu <niushiji@gmail.com>

From: Steven Niu <niushiji@gmail.com>
To: Andreas Karlsson <andreas@proxel.se>, Pierre <pierre.forstmann@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-14T07:31:09Z
Lists: pgsql-hackers
From: Andreas Karlsson <andreas@proxel.se>
Sent: Wednesday, January 14, 2026 15:27
To: Steven Niu <niushiji@gmail.com>; Pierre <pierre.forstmann@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] check kernel version for io_method


On 1/14/26 8:22 AM, Steven Niu wrote:
> I agree that you are correct for now. But in future, the IoMethod may have new member. Then we have to process it.
> 
> How about change to like this:
>   + #else
>   +     if (*newval == IOMETHOD_IO_URING)
>   +     {
>   +             GUC_check_errdetail("io_uring not enabled.");
>   +             return false;
>   +     }

No, that would be incorrect. It would not even compile. 
IOMETHOD_IO_URING is not even defined if we do not compile with liburing 
enabled. You can try it out yourself by compiling PostgreSQL without 
io_uring support and then try to enable it. You will get an error and 
that code will never be reached.

Andreas




________________________________________  


Yes, you are definitely correct. 
I'd like to withdwar my proposal.