Re: Permissions on file created by COPY TO

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joel Shellman <joel(at)ikestrel(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Permissions on file created by COPY TO
Date: 2002-02-25 22:17:42
Message-ID: 24758.1014675462@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joel Shellman <joel(at)ikestrel(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Wolfe 2002-02-25 22:25:19 Re: scaling a database
Previous Message Tom Lane 2002-02-25 22:09:55 Re: Wierdness using SUM to add results of custom C function.