[PATCH] Use access() to check file existence in GetNewRelFileNode(). - Mailing list pgsql-hackers

From Paul Guo
Subject [PATCH] Use access() to check file existence in GetNewRelFileNode().
Date
Msg-id CABQrizcUtiHaquxK=d4etBX8GF9kbZB50Nt1gO9_aN-e9SptyQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Use access() to check file existence inGetNewRelFileNode().  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Previous code uses BasicOpenFile() + close().

access() should be faster than BasicOpenFile()+close() and access()
should be more correct since BasicOpenFile() could fail for various
cases (e.g. due to file permission, etc) even the file exists.

access() is supported on Linux/Unix. I do not have a Windows dev environment, but MSDN tells me that access() is supported on Windows also and there have been access() call in the workspace, so I assume there is no portability issue.

Thanks.
Attachment

pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Possible bug in logical replication.
Next
From: Konstantin Knizhnik
Date:
Subject: Re: Removing unneeded self joins