Comments (6)
The proposed change will only solve the problem on single unified systems that
have
both the database and R running on the same machine. I'm running into this same
error when I try and load a dataframe from R running on one linux box and
PostGreSQL
running on another linux box.... permissions are only part of the problem in
this
case... the main one is availabililty of that local /tmp dir on the database
machine.
Original comment by [email protected]
on 13 May 2010 at 3:33
from rpostgresql.
For the case of the multiple systems, I created a shared folder on the host
computer
that was mounted to the same directory on the client computers via samba. I then
changed the tempfiles to save there. Very kludgy, but solved my limited needs
with
limited work.
The best solution would probably use the same syntax as pg_dump and pg_dumpall,
with
data coming from stdin all at once, e.g.:
INSERT INTO table FROM stdin VALUES (...)
That solution should be even faster than the copy method because the file
doesn't
have to be saved to disk twice (first as a tempfile, second into Postgres).
However,
the whole upload would need to occur in one transaction.
Original comment by [email protected]
on 15 May 2010 at 1:14
from rpostgresql.
A mutually mounted shared folder seems like it could work. I could just use a
temporary directory in the user's home dir like /home/fred/tmp/ ... might be
nice to
have "/tmp" in the code above read from an environmental variable or a new
parameter
(say something like 'tmp.dir') to dbWriteTable() instead.
Original comment by [email protected]
on 17 May 2010 at 8:11
from rpostgresql.
For example, the following edit works for me:
[someuser@linuxmachine]$ diff PostgreSQLSupport.R PostgreSQLSupport-edit.R
633,636c633,640
< if(as.character(Sys.info()["sysname"]) %in% c("Linux", "Darwin"))
< fn <- tempfile("rsdbi","/tmp")
< else
< fn <- tempfile("rsdbi")
---
> tmp.dir <- Sys.getenv('R_DB_TMP')
> if(tmp.dir == '')
> tmp.dir <- '/tmp'
> if(!file.exists(tmp.dir))
> dir.create(tmp.dir)
> fn <- tempfile("rsdbi",tmp.dir)
> Sys.chmod(fn, mode="0744")
as long as I'm sure to assign this environmental variable before I make a call
to
WriteTable:
Sys.setenv(R_DB_TMP= '/home/someuser/tmp')
Original comment by [email protected]
on 17 May 2010 at 9:12
from rpostgresql.
As stated in the comment of the source and TODO file, the bulk copy operation
should be done over the socket rather than passing the pathname.
How to achieve this? There is a hint in the psql \copy operation that does
most similar to what we want to do.
The essence is to use "COPY tablename from STDIN"
and send the data using repeated PQputCopyData()
terminated with a single call to PQputCopyEnd()
A proof of concept code without sufficient error handling is attached.
(The patch is relative to RPostgreSQL_0.1-6.).
Also, I believe the issue 9 is the same problem.
Original comment by [email protected]
on 11 Sep 2010 at 7:19
Attachments:
from rpostgresql.
This should have been fixed as of r144
Original comment by [email protected]
on 13 Oct 2010 at 2:45
- Changed state: Fixed
from rpostgresql.
Related Issues (20)
- Get autogenerated keys
- Bug linker flag when build with/link to exist postgresql library in custom path HOT 3
- Usage of internal libpq distribution is broken
- Outdated config.guess and config.sub HOT 2
- Error connecting to postgres 13 using RPostgres package in R. “authentication method 10 not supported” HOT 6
- Error loading RPostgreSQL HOT 6
- 'dbWriteTable()' does not write data out of public schema HOT 4
- configure: error: cannot guess build type; you must specify one in [install.packages("RPostgreSQL")] HOT 2
- Issue installing RPostgreSQL on linux HOT 6
- Unable to install in R HOT 6
- Create Roles and users from RPostgreSQL HOT 4
- dbSendQuery segfault on bad SQL query HOT 1
- How to find headers in /usr/include/psql? HOT 2
- How to pass binary_parameters="yes"? HOT 1
- please support PQconnectdb() interface HOT 2
- `dbConnect()` crashes R Studio instead of erroring HOT 4
- CRAN NEWS and Changelog are out of date
- libpq version 10 or above required for authentication HOT 6
- Old problem: libpg version problems HOT 5
- RPostgreSQL 0.7-4 isn't working with libpq 15.1? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpostgresql.