Atomic rename feature for Windows. - Mailing list pgsql-hackers

From Victor Spirin
Subject Atomic rename feature for Windows.
Date
Msg-id a529b660-da15-5b62-21a0-9936768210fd@postgrespro.ru
Whole thread Raw
Responses Re: Atomic rename feature for Windows.  (Michael Paquier <michael@paquier.xyz>)
Re: Atomic rename feature for Windows.  (Victor Spirin <v.spirin@postgrespro.ru>)
Re: Atomic rename feature for Windows.  (Victor Spirin <v.spirin@postgrespro.ru>)
Re: Atomic rename feature for Windows.  (Victor Spirin <v.spirin@postgrespro.ru>)
Re: Atomic rename feature for Windows.  (Victor Spirin <v.spirin@postgrespro.ru>)
List pgsql-hackers
Hi

I used the SetFileInformationByHandle function with the 
FILE_RENAME_FLAG_POSIX_SEMANTICS flag for the file rename function..

1) The _WIN32_WINNT variable needs to be increased to 0x0A00 (Windows 
10).  Fixed conflict with #undef CHECKSUM_TYPE_NONE

2) The SetFileInformationByHandle function works correctly only on 
Windows 10 and higher.

The app must have a manifest to check the Windows version using the 
IsWindows10OrGreater() function. I added a manifest to all postgres 
projects and disabled the GenerateManifest option on windows projects.

This patch related to this post: 
https://www.postgresql.org/message-id/CAEepm%3D0FV-k%2B%3Dd9z08cW%3DZXoR1%3Dkw9wdpkP6WAuOrKJdz-8ujg%40mail.gmail.com


-- 
Victor Spirin
Postgres Professional:http://www.postgrespro.com
The Russian Postgres Company


Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Removed extra memory allocations from create_list_bounds
Next
From: Stephen Frost
Date:
Subject: Re: Disable WAL logging to speed up data loading