Parameterised queries
On Wed, Feb 11, 2015 at 3:07 PM, Hadley Wickham <h.wickham at gmail.com> wrote:
I think the API should be as safe as possible by default, and sacrificing safety for speed should only be done explicitly when the user asks for it.
My use cases are not so sensitive, but I agree with the general idea.
Also,
you really do not gain much over regular looping as inserts are really
slow,
at least in postgresql.
Yes, I'm just working on that for RPostgres. Parameterised inserts are actually slower than sending one giant SQL string. RPostgreSQL uses COPY ... FROM STDIN (and manually converts the data frame into a single c string) for better performance
I put copy_from and copy_to in rpg. I punted on the C interface and simply shell out to psql in that case. Works fine with read.csv. and write.csv. THK
Hadley -- http://had.co.nz/
_______________________________________________ R-sig-DB mailing list -- R Special Interest Group R-sig-DB at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-db
http://www.keittlab.org/ [[alternative HTML version deleted]]