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

From: Paul Guo <paulguo(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Use access() to check file existence in GetNewRelFileNode().
Date: 2018-05-18 06:42:08
Message-ID: CABQrizdbarF1NZ7tYbv7R=iM1S5zkAiUG28CuLBfM3jbuSBkpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-05-17 21:18 GMT+08:00 Michael Paquier <michael(at)paquier(dot)xyz>:

> On Thu, May 17, 2018 at 05:23:28PM +0800, Paul Guo wrote:
> > F_OK seems to be better than R_OK because we want to check file existence
> > (not read permission) before creating the relation file with the path
> > later.
>
> Please do not top-post, this breaks the discussion logic of the thread.
>
> Perhaps Tom remembers why things have been done this way in 721e537. At
> the end, on second-thoughts, the current coding looks a bit
> over-engineered as there is no check for any error codes other than
> ENOENT so using only F_OK would be OK. Note that access cannot complain
> about EPERM at least on Linux, so you'd want to actually modify this
> comment block.

Thanks. Agreed. Attached is the new patch.

> You should also add this patch to the next commit fest, development of
> v11 is done and it is a stabilization period now, so no new patches are
> merged. Here is where you can register the patch:
> https://commitfest.postgresql.org/18/

Submitted.

-Paul

> --
> Michael
>

Attachment Content-Type Size
0001-Use-access-to-check-file-existence-in-GetNewRelFileN.v2.patch application/octet-stream 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2018-05-18 07:33:32 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.
Previous Message Kato, Sho 2018-05-18 06:03:59 [doc fix] Add operation of freeing output SQLDA