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

McGehee, Robert Robert@McGehee @end|ng |rom geodec@p|t@|@com
Thu Nov 5 21:12:10 CET 2009


I think the running hypothesis is that, for Macs, RPostgreSQL saves its
data into an R temp directory that may or may not be readable by the
account that runs the postgres database. If it is, then the test will
run fine (presumably in Neil's case). If it is not, then you will get a
permission error. I don't think there's anything wrong with the test
case, it just won't work for everyone's configuration. With the 'bug
fix', I believe the test will work for more configurations--though still
not all if either there is a Mac system that does not use /tmp, or if
/tmp is not readable by the Postgres user. In Neil's case, I'll guess
that either he runs Postgres out of his user account, or his R temp
directories are group or world readable--mine are not.

Another gotcha not addressed that I think could bite either a Linux or
Mac users is that the user's umask settings can influence whether the
bulk copy works. For instance, (I'm almost certain that) for anyone that
runs R and postgres from different accounts, the bulk import will fail
if their umask is set to 0077, since R temp files seem to follow umask
settings. 

As mentioned before, a better solution, in theory, will likely involve a
direct binary transfer.
--Robert

-----Original Message-----
From: Dirk Eddelbuettel [mailto:edd using debian.org] 
Sent: Thursday, November 05, 2009 2:43 PM
To: Neil Tiffin
Cc: McGehee, Robert; Prasenjit Kapat; r-sig-db using stat.math.ethz.ch
Subject: Re: [R-sig-DB] dbWriteTable permission problem on Mac OSX


Neil,

On 5 November 2009 at 11:43, Neil Tiffin wrote:
| "Darwin" is correct for Mac OS X.

Cool, thanks.

| The test dbWriteTableTest.R works for me without this change.  Is the

| test not robust enough?

Can you maybe follow-up with Robert about other possible cause of this?
As I
(as a non-Mac-user) understand it, there are numerous ways to install R
(and
presumably Pg) onto OS X and the bug may bite only in some.  His
suggested
fix strikes me as correct, though, as $TEMPDIR permissions are a general
Unixy way of doing things.

Dirk

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




More information about the R-sig-DB mailing list