I have a script with multiple queries I am triying to write to a csv file:
copy ( select /* very long query */ ) to '/tmp/report.csv' with csv header;
And I run the script like this
psql -d mydb -f produce_reports.sql
The script seems to work but nothing is written to /tmp.
I usually use
\copy but I am unable to use this in a script. From what I understand using
\copy require having all the command on the same line which is not a viable option for me.
Any idea why COPY report success but don`t write anything?
P.S tried runnig with sudo, with psql, and tries granting mydb user superuser.
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
99,9% servers uptime
No usage restrictions
Perfect for SEO
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!