[PATCH] Use access() to check file existence in GetNewRelFileNode().

From: Paul Guo <paulguo(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] Use access() to check file existence in GetNewRelFileNode().
Date: 2018-05-17 08:09:27
Message-ID: CABQrizcUtiHaquxK=d4etBX8GF9kbZB50Nt1gO9_aN-e9SptyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Use-access-to-check-file-existence-in-GetNewRelFileN.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2018-05-17 08:15:51 Re: Removing unneeded self joins
Previous Message Konstantin Knizhnik 2018-05-17 07:45:44 Possible bug in logical replication.