New topic: 

PostgreSQL - COPY TO - permissions - Mac OS

<http://forums.realsoftware.com/viewtopic.php?t=46597>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        Goofie          Post subject: PostgreSQL - COPY TO - permissions 
- Mac OSPosted: Thu Jan 17, 2013 2:09 pm                         
Joined: Tue Nov 13, 2007 11:48 am
Posts: 183
Location: Belgium                I'm converting my 'skills'  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. 

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             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to