copy (select * from TABLE_NAME) TO '/home/name/teste.csv';
This is the command line, it seems pretty simple I've read the documentation on this link (https://www.postgresql.org/docs/9.6/sql-copy.html), checked my postgresql version and when I run the code it gives me this error
ERROR: could not open file "/home/name/teste.csv" for writing: No such file or directory
********** Error **********
ERROR: could not open file "/home/name/teste.csv" for writing: No such file or directory
SQL state: 58P01
The file is there, checked with 'pwd' the path an everything seems ok, also tried the code with "WITH CSV" in the end and nothing. Anyone seeing something I'm not?