LMSouq
server-admin Open

How to allow permission to access CSV file using postgres in Ubuntu

US
user3946530
1 month ago
3 views
Problem Description
I am using the following command : copy (select so.name, so.date_order, sol.name, sol.product_Id, sol.product_uom_qty , ai.number, ai.date_invoice , so.amount_total , so.amount_tax from sale_order so , sale_order_line sol , account_invoice ai where so.id = sol.order_id and so.name = ai.origin and ai.state='open') to '/home/ekodev/Documents/test1.csv' delimiter ',' csv header; However, it gives the following error : ********** Error ********** ERROR: must be superuser to COPY to or from a file SQL state: 42501 Hint: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone. Even when I changed the permission `ekodev@partner:~/Documents$ sudo chmod a+rwX /home/ekodev/ /home/ekodev/Documents/ /home/ekodev/Documents/test1.csv` It still does not work for me. Does anybody know what the problem is?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base