pgsql: Use access() to check file existence in GetNewRelFileNode()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use access() to check file existence in GetNewRelFileNode()
Date: 2018-07-08 10:00:23
Message-ID: E1fc6UR-0002RF-GF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2018-07-08 14:05:53 Re: pgsql: Use access() to check file existence in GetNewRelFileNode()
Previous Message Peter Eisentraut 2018-07-07 09:42:57 pgsql: Add separate error message for procedure does not exist