Permission Denied error when using PostgreSQL's COPY FROM/TO command

Getting a permission denied error when using COPY? Here's why and how to fix it.

Neil Sainsbury

2 minute read

COPY FROM is commonly used to import data from a file (CSV, plain text, etc.) in to PostgreSQL. Likewise, COPY TO is used to export data from a table or a query result to a file. When you’re using these commands if you’re getting a “Permission Denied” error, here’s the likely reason why and how to fix it.