Re: Atomic rename feature for Windows.

2022-04-05 Thread Victor Spirin
Hi Updated patch: we use the posix semantic features in Windows build 17763 and up. We found an issue with this feature on Windows Server 2016 without updates (Windows 1607 Build 14393) Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 05.07.2021 16

Re: Atomic rename feature for Windows.

2021-11-30 Thread Victor Spirin
Hi The flags for calling the CreateFile function have been changed. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 05.07.2021 16:53, Victor Spirin пишет: Hi I used the SetFileInformationByHandle function with the FILE_RENAME_FLAG_POSIX_SEMANTICS

Re: Atomic rename feature for Windows.

2021-11-14 Thread Victor Spirin
Hi Added the pgunlink_windows_posix_semantics function and modified the pgunlink function I used FILE_DISPOSITION_POSIX_SEMANTICS flag for unlink files on Windows 10 (1607) and above. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 05.07.2021

Re: Atomic rename feature for Windows.

2021-11-03 Thread Victor Spirin
Hi Added a small fix for calling the GetFileAttributes function Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 05.07.2021 16:53, Victor Spirin пишет: Hi I used the SetFileInformationByHandle function with the FILE_RENAME_FLAG_POSIX_SEMANTICS flag

Re: Atomic rename feature for Windows.

2021-10-04 Thread Victor Spirin
function. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 01.10.2021 15:37, Juan José Santamaría Flecha пишет: On Thu, Sep 30, 2021 at 11:00 PM Victor Spirin mailto:v.spi...@postgrespro.ru>> wrote: IsWindowsVersionOrGreater(10,0,1607)

Re: Atomic rename feature for Windows.

2021-09-30 Thread Victor Spirin
Windows. I heard that Microsoft does not support older versions of Windows 10 and requires a mandatory update. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 23.09.2021 14:18, Juan José Santamaría Flecha пишет: On Tue, Sep 7, 2021 at 11:40 PM

Re: Atomic rename feature for Windows.

2021-09-30 Thread Victor Spirin
Thank you, Fixed FILE_RENAME_INFO structure I prepared 2 versions of the patch: 1) with manifest and IsWindows10OrGreater() function 2) without manifest and RtlGetVersion function from ntdll.dll What's better? Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian

Re: Atomic rename feature for Windows.

2021-09-07 Thread Victor Spirin
e better? Maybe there is another correct method? I checked the pgrename_windows_posix_semantics() function on Windows 7. It returns error 87: Parameter is incorrect. Hence, it is necessary to check the Windows version and call the old pgrename function for old Windows. Victor

Re: Atomic rename feature for Windows.

2021-09-06 Thread Victor Spirin
Hello. I have changed the way I add the manifest to projects. I used the AdditionalManifestFiles option for a VS project. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 08.07.2021 1:32, Victor Spirin пишет: Thanks! In this version of the patch

Re: Atomic rename feature for Windows.

2021-07-07 Thread Victor Spirin
uire that. Those extra files make the long-term maintenance harder. Function IsWindows10OrGreater() working properly if there is manifest with Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> "Applications not manifested for Windows 10 return false, even if the current operating system versio

Atomic rename feature for Windows.

2021-07-05 Thread Victor Spirin
: 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 diff --git a/src/include/common/checksum_helper.h b/src/include/common

Re: Sometimes the output to the stdout in Windows disappears

2020-08-31 Thread Victor Spirin
I only found that calling WSACleanup instead of PQfinish has the same effect. I don't see any big performance issues due to the extra fflush call in this place. I will be glad to find a more elegant solution. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres

Sometimes the output to the stdout in Windows disappears

2020-08-31 Thread Victor Spirin
on any console program using PQconnectdbParams and PQfinish. I am attaching a patch and a script for testing. -- Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company diff --git a/src/port/snprintf.c b/src/port/snprintf.c index 83a8103..17dc505 100644

Re: psql tab-complete

2019-10-25 Thread Victor Spirin
This patch resolved one problem in the tab-complete.c on MSVC. The VA_ARGS_NARGS macros now work correctly on Windows. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 25.10.2019 0:53, Victor Spirin пишет: Yes, I found, that VA_ARGS_NARGS

Re: psql tab-complete

2019-10-24 Thread Victor Spirin
Yes, I found, that VA_ARGS_NARGS(__ VA_ARGS__) macros always return 1 on Windows. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 25.10.2019 0:48, Tom Lane пишет: Victor Spirin writes: I found some problem with tab-complete in the 12 version.  I

Re: psql tab-complete

2019-10-24 Thread Victor Spirin
Sorry for wrong place and contents of my message. It seems that the VA_ARGS_NARGS (__ VA_ARGS__) macros always return 1 on Windows. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 24.10.2019 19:11, Victor Spirin пишет: I found some problem with tab

psql tab-complete

2019-10-24 Thread Victor Spirin
I found some problem with tab-complete in the 12 version.  I checked this in the Windows. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index e00dbab5aa..5d7f24e57a 100644

Re: PostgreSQL does not start when max_files_per_process> 1200 on Windows 7

2018-09-05 Thread Victor Spirin
m. Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company 05.09.2018 19:24, Andres Freund пишет: Hi, On 2018-09-05 13:06:06 +0300, Victor Spirin wrote: I have a bug in Windows 7 with max_files_per_process> 1200. Using dup (0) in the  function count_us

PostgreSQL does not start when max_files_per_process> 1200 on Windows 7

2018-09-05 Thread Victor Spirin
urs. In the patch I check the file postgresql.conf -- Victor Spirin Postgres Professional:http://www.postgrespro.com The Russian Postgres Company diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 8dd51f1..79054e5 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/stor