Re: Atomic rename feature for Windows.

From: Victor Spirin <v(dot)spirin(at)postgrespro(dot)ru>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Atomic rename feature for Windows.
Date: 2021-09-30 20:49:22
Message-ID: 538e7640-da86-8e84-b990-0889736b31a0@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 Postgres Company

23.09.2021 14:46, Thomas Munro пишет:
> On Wed, Sep 8, 2021 at 9:40 AM Victor Spirin <v(dot)spirin(at)postgrespro(dot)ru> wrote:
>> Is this code better? Maybe there is another correct method?
> Hmm, if we want to use the system header's struct definition, add some
> space for a path at the end, and avoid heap allocation, perhaps we
> could do something like:
>
> struct {
> FILE_RENAME_INFO fri;
> WCHAR extra_space[MAX_PATH];
> } x;
>
>

Attachment Content-Type Size
rename_with_manifest.patch text/plain 7.2 KB
rename_without_manifest.patch text/plain 5.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-09-30 20:59:18 Re: [Patch] ALTER SYSTEM READ ONLY
Previous Message Andres Freund 2021-09-30 20:31:36 Re: 002_types.pl fails on some timezones on windows