pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: More consistent behavior of GetDataDirectoryCreatePerm on Window
Date: Sun, 05 Nov 2023 21:13:51 +0000
Message-ID: <E1qzkRL-0046HF-BX@gemulon.postgresql.org> (raw)

More consistent behavior of GetDataDirectoryCreatePerm on Windows

On Windows, GetDataDirectoryCreatePerm() just did nothing.  The way
the code in some callers is structured, this is the first function
that tries to access the data directory.  So it also ends up the place
that is responsible for reporting that a data directory does not exist
or similar.  Therefore, on Windows, these scenarios end up on
potentially completely different code paths.

To unify this, to make testing more consistent across platforms, have
GetDataDirectoryCreatePerm() run the stat() call on Windows as well,
even though it won't do anything with the result.  That way, file
system errors are reporting to callers in the same way as on
non-Windows.

Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Discussion: https://www.postgresql.org/message-id/15a59bca-0383-183c-9383-0446da9b87e1%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2c7c6c417fe655ab3fd4ca7f68ec22c913a2fe80

Modified Files
--------------
src/common/file_perm.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)



Message-ID: <E1qzkRL-0046HF-BX@gemulon.postgresql.org>
Permalink:  ../E1qzkRL-0046HF-BX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qzkRL-0046HF-BX@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: More consistent behavior of GetDataDirectoryCreatePerm on Window
  In-Reply-To: <E1qzkRL-0046HF-BX@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox