Skip to content

dbWriteTable on virtual linux box

1 message · Lee Hachadoorian

#
On 02/28/2011 07:20 PM, Tomoaki NISHIYAMA wrote:
Tomoaki,

You were right, I was using version 0.1-6. I upgraded to 0.1-7, and now
it, but with the additional complication, as you describe, that table
names are quoted. I can't figure out how to write to the desired schema.
In SQL I would use

SET search_path = myschema;

But when I

dbSendQuery(conn, "SET search_path = myschema;")
dbGetQuery(conn, "SHOW search_path")

     search_path
1 "$user",public

because the search_path only applies to the current session, and the
session ends when dbSendQuery returns a result.

On the other hand

dbGetQuery(connLocalhost, "SET search_path = myschema; SHOW search_path;")

  search_path
1        myschema

but since dbWriteTable takes a table name (which it quotes) rather than
a SQL statement, this approach can't be followed. So is there a way to
write to anything other than the public schema in version 0.1-7?

Thanks,
--Lee