[R-sig-DB] dbWriteTable permission problem on Mac OSX

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Nov 3 23:14:49 CET 2009


On 3 November 2009 at 16:35, McGehee, Robert wrote:
| I'm getting a 'Permission denied' error when trying to use the
| 'dbWriteTable' function (RPostgreSQL\DBI package) to access PostgreSQL
| on my Mac OSX. I saw that this error appears to have been documented in
| the README file as affecting versions of Linux running SELinux. However,

(That was an educated guess by Sameer at the time. He had other issues too...)

| since my OSX Server is not running SELinux, I wanted to see if anyone
| else has had success using 'dbWriteTable' on a Mac with RPostgreSQL.
| 
| I can update a database using INSERT commands, but am looking for a
| faster solution. Also RODBC crashes my R session when executing the
| 'sqlTables' function--presumably due to an ODBC driver problem--so
| switching packages won't easily help.
| 
| Thanks, Robert
| 
| ---------------------
| > dbWriteTable(pcon, "test", data)
| Error in postgresqlExecStatement(conn, statement, ...) : 
|   RS-DBI driver: (could not Retrieve the result : ERROR:  could not open
| file "/tmp/RtmprNh2yy/rsdbi60b7acd9" for reading: Permission denied
| )
| Warning in postgresqlWriteTable(conn, name, value, ...) :
|   could not load data into table

That looks straightforward. Me thinks that

  a) R creates its tempdir, so R owns /tmp/RtmprNh2yy/

  b) we're talking to Pg so the default Pg user will need to read that
     file -- my guess right now is that the default postgres user running
     the db is simply prohibited from reading inside that directory.

This gives you an idea of how to fix it short term -- maybe by using another
tempdir, maybe by using another fudge.   Alternatively, dump your data
outside of R and use Pg's native bulk copy tools ...   That said, I don't
quite recall by this doesn't bite us on Linux.

RPostgreSQL, I should add, is in a state of graceful unmaintainedness.  I
sort-of look after it as I once suggested for R's participation in the Google
Summer of Code as feel attached. But as I don;t currently run much code
against it, so my usage is light at best.  I have Neil helping me OS X
specific issue (ie he repaired/enhanced the build), Joe helps with real Pg
nitty gritty and Jeff offers some general database / DBI smart.

So with that:  if anyone knows and loves Postgresql and wants to help, please
do not hold back. We'd love to have you on the team.

Dirk

-- 
Three out of two people have difficulties with fractions.




More information about the R-sig-DB mailing list