Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Sep 22, 2019 10:06 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: PostgreSQL - COPY TO - permissions - Mac OS
PostPosted: Thu Jan 17, 2013 2:09 pm 
Offline

Joined: Tue Nov 13, 2007 11:48 am
Posts: 189
Location: Belgium
I'm converting my 'skills' 8) from MySql to Postgres (for a new project).

In previous projects to generate a weekly report the application ran a query and then iterated all the records and fields of a recordset to construct a CSV-file, which was then automatically emailed. I know it's not 'clean', but it did what it had to do, and everybody was happy with the way the program worked.

In a way to enhance this process- for my new project- i found the following sqlexecutestatement:
"COPY (Select * from myTable where my_condition) TO '/tmp/export.csv' DELIMITER ',' CSV HEADER;" .
This works like magic to generate the report i need. :D

However i keep stumbling on a permissions-problem...
I can't dump the export.csv on ~/Desktop . It seems i'm only allowed to write to this tmp-location, which is fine if you only want to launch the file. I can't move the file from tmp to another location because of permissions.

Any safe way around?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group