How do I change the effective user of psql?
- by gvkv
I'm using psql to run a simple set of COPY statements contained in a file:
psql -d mydb -f 'wbf_queries.data.sql'
where wbf_queries.data.sql contains lines:
copy <my_query> to '/home/gvkv/mydata' delimiter ',' null '';
...
but I get a permission denied error:
... ERROR: could not open file ... for writing: Permission denied
I'm connecting under my user account (gvkv) which is also a superuser in PostgreSQL. Obviously, psql is running under a different (effective) user but I don't know how to change this. Can it be done within psql or do I need some unix-fu?