Answer the question
In order to leave comments, you need to log in
Must be superuser or a member of the pg_write_server_files role to COPY to a file, how to decide?
When trying to copy the database to your folder:
COPY (SELECT ROW_TO_JSON(t)
FROM (SELECT * FROM item) t)
TO '/project/database';
Must be superuser or a member of the pg_write_server_files role to COPY to a file
Answer the question
In order to leave comments, you need to log in
This is not an error, but a reminder that superusers and members of the corresponding role can upload something to files. Are you sure that's what you want, and not, for example, redirecting the result of a query to a file on the client?
you must be a superuser
or a member of the group
pg_write_server_files role Solved
by adding your role to this group and giving it rights to the
/project/database folder at the OS level
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question