Extracting postgreSQL data to file

0

I'm trying to extract the data from a table to a file with the following command:

COPY historico TO '/home/jessica/teste.txt';

But the following error occurs:

  

ERROR: could not open file "/home/jessica/teste.txt" for writing:   Permission Denied

    
asked by anonymous 14.03.2016 / 15:12

1 answer

0

The user you are accessing the database does not have permission to create the file in / home / jessica /

You can do the following command:

COPY historico TO '/tmp/teste.txt';

In the / tmp directory all system users can access it normally and from there, you manipulate your file.

I hope I have helped.

    
22.04.2016 / 20:53