pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix replay of create database records on standby

2022-07-27 Thread Alvaro Herrera
Fix replay of create database records on standby Crash recovery on standby may encounter missing directories when replaying database-creation WAL records. Prior to this patch, the standby would fail to recover in such a case; however, the directories could be legitimately missing. Consider the fo

pgsql: Fix comment in procarray.c.

2022-07-27 Thread Fujii Masao
Fix comment in procarray.c. Commit fea10a6434 renamed VariableCacheData.nextFullXid to nextXid. But commit dc7420c2c9 introduced the comment mentioning nextFullXid. This commit changes"nextFullXid" to "nextXid" in the comment. Author: Zhang Mingli Discussion: https://postgr.es/m/642ba615-4b28-4b0

pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS.

2022-07-27 Thread Thomas Munro
Fix get_dirent_type() for symlinks on MinGW/MSYS. On Windows with MSVC, get_dirent_type() was recently made to return DT_LNK for junction points by commit 9d3444dc, which fixed some defective dirent.c code. On Windows with Cygwin, get_dirent_type() already worked for symlinks, as it does on POSIX

pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS.

2022-07-27 Thread Thomas Munro
Fix get_dirent_type() for symlinks on MinGW/MSYS. On Windows with MSVC, get_dirent_type() was recently made to return DT_LNK for junction points by commit 9d3444dc, which fixed some defective dirent.c code. On Windows with Cygwin, get_dirent_type() already worked for symlinks, as it does on POSIX

pgsql: Fix get_dirent_type() for symlinks on MinGW/MSYS.

2022-07-27 Thread Thomas Munro
Fix get_dirent_type() for symlinks on MinGW/MSYS. On Windows with MSVC, get_dirent_type() was recently made to return DT_LNK for junction points by commit 9d3444dc, which fixed some defective dirent.c code. On Windows with Cygwin, get_dirent_type() already worked for symlinks, as it does on POSIX

pgsql: Fix new auto_explain test case for Windows.

2022-07-27 Thread Tom Lane
Fix new auto_explain test case for Windows. In commit 7c34555f8, I overlooked the need to configure SSPI on Windows to allow login as the non-superuser role. Fix that by adding auth_extra/--create-role incantation (which, oddly enough, doesn't actually create the role). Per buildfarm. While here,

pgsql: Fix new auto_explain test case for Windows.

2022-07-27 Thread Tom Lane
Fix new auto_explain test case for Windows. In commit 7c34555f8, I overlooked the need to configure SSPI on Windows to allow login as the non-superuser role. Fix that by adding auth_extra/--create-role incantation (which, oddly enough, doesn't actually create the role). Per buildfarm. While here,

pgsql: Bump catversion for commit d8cd0c6c95c0120168df93aae095df4e0682a

2022-07-27 Thread Robert Haas
Bump catversion for commit d8cd0c6c95c0120168df93aae095df4e0682a08a. The catalog contents haven't changed, but it's good to make clear that initdb is required. Changing RELMAPPER_FILEMAGIC would be more appropriate, but that doesn't actually produce a useful diagnostic, so cheat by doing this inst

pgsql: Convert macros to static inline functions (buf_internals.h)

2022-07-27 Thread Robert Haas
Convert macros to static inline functions (buf_internals.h) Dilip Kumar, reviewed by Vignesh C, Ashutosh Sharma, and me. Discussion: http://postgr.es/m/cafitn-tybm7d+2uginc2kafmsqta5fteyvmg-vj2hvpdvw2...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdi

pgsql: Add missing PGDLLEXPORT markings in contrib/pg_prewarm.

2022-07-27 Thread Tom Lane
Add missing PGDLLEXPORT markings in contrib/pg_prewarm. After commit 089480c07, it's necessary for background worker entry points to be marked PGDLLEXPORT, else they aren't findable by LookupBackgroundWorkerFunction(). Since pg_prewarm lacks any regression tests, it's not surprising its worker en

Re: pgsql: Remove the restriction that the relmap must be 512 bytes.

2022-07-27 Thread Robert Haas
On Wed, Jul 27, 2022 at 6:25 AM Michael Paquier wrote: > Right. The whole write_relmap_file() already happens while taking > RelationMappingLock, so that seems like a good idea for consistency at > the end (even if I remember that there is a patch floating around to > improve the concurrency of p

pgsql: Fix read_relmap_file() concurrency on Windows.

2022-07-27 Thread Robert Haas
Fix read_relmap_file() concurrency on Windows. Commit d8cd0c6c95c0120168df93aae095df4e0682a08a introduced a file rename that could fail on Windows, probably due to other backends having an open file handle to the old file of the same name. Re-arrange the locking slightly to prevent that, by making

pgsql: Refactor code in charge of grabbing the relations of a subscript

2022-07-27 Thread Michael Paquier
Refactor code in charge of grabbing the relations of a subscription GetSubscriptionRelations() and GetSubscriptionNotReadyRelations() share mostly the same code, which scans pg_subscription_rel and fetches all the relations of a given subscription. The only difference is that the second routine l

Re: pgsql: Remove the restriction that the relmap must be 512 bytes.

2022-07-27 Thread Michael Paquier
On Wed, Jul 27, 2022 at 06:21:07PM +1200, Thomas Munro wrote: > Erm, let me try that again, this time with the CloseTransientFile() > also under the lock, so that we never have a file handle without a > lock. Right. The whole write_relmap_file() already happens while taking RelationMappingLock, s