yueshengu / rpostgresql

Automatically exported from code.google.com/p/rpostgresql
0 stars 0 forks source link

dbWriteTable on Windows not escaping path properly #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
0.  Have a home directory on windows like C:\Users\richard,
    where \r is part of the pathname.
1.  Make a table in postgres with 'create table foo ...'
2.  Make a compatible data frame in R.
3.  As the superuser postgres account ("postgres"),
    try to write the data frame to the table.

What is the expected output? What do you see instead?

Should write data to table.

Actual output is this:

Error in postgresqlExecStatement(conn, statement, ...) : 
  RS-DBI driver: (could not Retrieve the result : ERROR:  could not open
file "C:Users
eitmrAppDataLocalTempRtmpmXy6xu
sdbi52db525b" for reading: Invalid argument
)
[1] FALSE
Warning message:
In postgresqlWriteTable(conn, name, value, ...) :
  could not load data into table

This very much looks like a call to get a temporary filename,
which picks C:\Users\richard\.... and then a subsequent passing
of that filename without escaping \ characters in it.

If there was a way to avoid using a filename at all and adopt
stdin, that might fit better with how postgres works.  Current
implementation error messages suggest the current approach
won't work well for remote connections.

ps.  Thank you for creating / working on RPOstgreSQL.  It's
very nice to be able to use two good tools together.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by rareitme...@gmail.com on 1 Nov 2009 at 5:31

GoogleCodeExporter commented 9 years ago
I hope this is fixed with r144 but happy to hear any report.  I don't have 
tested on windows.

Original comment by tomoa...@kenroku.kanazawa-u.ac.jp on 13 Oct 2010 at 2:47

GoogleCodeExporter commented 9 years ago
Change the status to fixed as no new error is reported on this issue.

Original comment by tomoa...@kenroku.kanazawa-u.ac.jp on 24 Sep 2011 at 10:51