Export query result from pgadmin to excel file

saltlife31496 picture saltlife31496 · Mar 29, 2016 · Viewed 9.3k times · Source

I am trying to export the result from a query in pgadmin to a excel file i have tried:

COPY (Select * From SYSTEMS) To '/tmp/test.csv' With CSV;

but it returns the error:

ERROR: must be superuser to COPY to or from a file

Answer

nayaganov picture nayaganov · Feb 27, 2020

pgadmin, running under "pgadmin system user" can't accese to /tmp/ catalog. You need to grant access for postgres user or all users for /tmp/ catalog.