pgsql: Use access() to check file existence in GetNewRelFileNode() - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Use access() to check file existence in GetNewRelFileNode()
Date
Msg-id E1fc6UR-0002RF-GF@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Use access() to check file existence inGetNewRelFileNode()
List pgsql-committers
Use access() to check file existence in GetNewRelFileNode()

Previous code used BasicOpenFile() and close() just to check for a file
collision, while there is no need to hold open a file descriptor but
that's an overkill here.

Author: Paul Guo
Reviewed-by: Peter Eisentraut, Michael Paquier
Discussion: https://postgr.es/m/CABQrizcUtiHaquxK=d4etBX8GF9kbZB50Nt1gO9_aN-e9SptyQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/677da8c15d19c11465d78f18bfd5ceb5d6fc3af1

Modified Files
--------------
src/backend/catalog/catalog.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Add separate error message for procedure does not exist
Next
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Use access() to check file existence inGetNewRelFileNode()