pgsql: Remove trace_recovery_messages

2023-12-11 Thread Michael Paquier
Remove trace_recovery_messages This GUC was intended as a debugging help in the 9.0 area when hot standby and streaming replication were being developped, able to offer more information at LOG level rather than DEBUGn. There are more tools available these days that are able to offer rather equiva

pgsql: Simplify productions for FORMAT JSON [ ENCODING name ]

2023-12-11 Thread Alvaro Herrera
Simplify productions for FORMAT JSON [ ENCODING name ] This removes the production json_encoding_clause_opt, instead merging it into json_format_clause. Also remove the auxiliary makeJsonEncoding() function. Reviewed-by: Amit Langote Discussion: https://postgr.es/m/202312071841.u2gueb5dsrbk%40a

pgsql: jit: Create void type in the right context

2023-12-11 Thread Daniel Gustafsson
jit: Create void type in the right context Commit 3b991f81c45 introduced a specific context for types such that all no longer referenced types can be dropped periodically rather than leaking. One void pointer type creation was however missed leading to an assertion failure in LLVM Debug builds. P

pgsql: Be more wary about OpenSSL not setting errno on error.

2023-12-11 Thread Tom Lane
Be more wary about OpenSSL not setting errno on error. OpenSSL will sometimes return SSL_ERROR_SYSCALL without having set errno; this is apparently a reflection of recv(2)'s habit of not setting errno when reporting EOF. Ensure that we treat such cases the same as read EOF. Previously, we'd freq

pgsql: Be more wary about OpenSSL not setting errno on error.

2023-12-11 Thread Tom Lane
Be more wary about OpenSSL not setting errno on error. OpenSSL will sometimes return SSL_ERROR_SYSCALL without having set errno; this is apparently a reflection of recv(2)'s habit of not setting errno when reporting EOF. Ensure that we treat such cases the same as read EOF. Previously, we'd freq

pgsql: Be more wary about OpenSSL not setting errno on error.

2023-12-11 Thread Tom Lane
Be more wary about OpenSSL not setting errno on error. OpenSSL will sometimes return SSL_ERROR_SYSCALL without having set errno; this is apparently a reflection of recv(2)'s habit of not setting errno when reporting EOF. Ensure that we treat such cases the same as read EOF. Previously, we'd freq

pgsql: Be more wary about OpenSSL not setting errno on error.

2023-12-11 Thread Tom Lane
Be more wary about OpenSSL not setting errno on error. OpenSSL will sometimes return SSL_ERROR_SYSCALL without having set errno; this is apparently a reflection of recv(2)'s habit of not setting errno when reporting EOF. Ensure that we treat such cases the same as read EOF. Previously, we'd freq

pgsql: Be more wary about OpenSSL not setting errno on error.

2023-12-11 Thread Tom Lane
Be more wary about OpenSSL not setting errno on error. OpenSSL will sometimes return SSL_ERROR_SYSCALL without having set errno; this is apparently a reflection of recv(2)'s habit of not setting errno when reporting EOF. Ensure that we treat such cases the same as read EOF. Previously, we'd freq

pgsql: Be more wary about OpenSSL not setting errno on error.

2023-12-11 Thread Tom Lane
Be more wary about OpenSSL not setting errno on error. OpenSSL will sometimes return SSL_ERROR_SYSCALL without having set errno; this is apparently a reflection of recv(2)'s habit of not setting errno when reporting EOF. Ensure that we treat such cases the same as read EOF. Previously, we'd freq

Re: pgsql: llvmjit: Use explicit LLVMContextRef for inlining

2023-12-11 Thread Daniel Gustafsson
> On 8 Dec 2023, at 14:38, Daniel Gustafsson wrote: > I will apply that to v12 shortly after a little more testing. Done, and canebrake/urutu has since turned green. -- Daniel Gustafsson

pgsql: Define unconstify() and unvolatize() for C++.

2023-12-11 Thread Thomas Munro
Define unconstify() and unvolatize() for C++. These two macros wouldn't work if used in an inline function definition in a header seen by g++, because __builtin_types_compatible_p is only available in C. Redirect to standard C++ const_cast (which also adds/removes volatile despite its name). Per

pgsql: Provide helper for retrying partial vectored I/O.

2023-12-11 Thread Thomas Munro
Provide helper for retrying partial vectored I/O. compute_remaining_iovec() is a re-usable routine for retrying after pg_readv() or pg_writev() reports a short transfer. This will gain new users in a later commit, but can already replace the open-coded equivalent code in the existing pg_pwritev_w

pgsql: Provide vectored variants of FileRead() and FileWrite().

2023-12-11 Thread Thomas Munro
Provide vectored variants of FileRead() and FileWrite(). FileReadV() and FileWriteV() adapt pg_preadv() and pg_pwritev() for fd.c's virtual file descriptors. The simple FileRead() and FileWrite() functions are now implemented in terms of the vectored functions, to avoid code duplication, and they