Re: Linux file permission for COPY TO SQL command

Rob Sargent <robjsargent@gmail.com>

From: Rob Sargent <robjsargent@gmail.com>
To: Krzysztof <kj@limes.com.pl>
Cc: pgsql-sql@lists.postgresql.org
Date: 2025-10-28T23:03:07Z
Lists: pgsql-sql

> On Oct 28, 2025, at 9:39 AM, Krzysztof <kj@limes.com.pl> wrote:
> 
> 
> I try to use COPY TO command to copy results of a SELECT but I get this message:
> 
> ERROR:  could not open file "a file" for writing: Permission denied
> 
> 

Is there really a space in the actual file name. That might get tricky. You’re suggesting the file already exists: is that true? Directory permissions?
> User, group and other are granted full permission to this file. What should I do more to get this working?
> 
> -- 
> Pozdrawiam
> Krzysztof Jasieński