Re: Permissions on file created by COPY TO - Mailing list pgsql-general

From Tom Lane
Subject Re: Permissions on file created by COPY TO
Date
Msg-id 24758.1014675462@sss.pgh.pa.us
Whole thread Raw
In response to Permissions on file created by COPY TO  (Joel Shellman <joel@ikestrel.com>)
List pgsql-general
Joel Shellman <joel@ikestrel.com> writes:
> Of I run a COPY TO command it creates a file. What determines the
> permissions of that file? The created file is owned by postgres, but I
> need a different user to be able to manipulate it (actually, I just want
> to delete it). So I thought to make it group writable so the other user
> could be in postgres group and delete the file.

Uh, deletion has nothing to do with writability of the file, and
everything to do with writability of the directory it's in.   So you
could solve the stated problem without touching the Postgres code.

However, the answer to your question is that the mode is hardwired to
644 (rw-r--r--) by the umask call in src/backend/commands/copy.c.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Wierdness using SUM to add results of custom C function.
Next
From: "Steve Wolfe"
Date:
Subject: Re: scaling a database