Skip to content

RPostgreSQL - dbWriteTable

2 messages · Chris Long, Sean Davis

#
What's the best way to coax RPostgreSQL into writing a table to a
schema other than "public"? I've tried dbWriteTable("schema.foo",data),
setting search_path to "schema" etc. Nothing's worked; it's either
create "foo" in public, or the table "schema.foo" in public (!).
It will also refuse to write the table if it exists in any schema (!).

Using Ubuntu 10.10 64-bit,
'http://cran.stat.ucla.edu/src/contrib/RPostgreSQL_0.1-7.tar.gz'
R version 2.12.2 (2011-02-25)
#
On Tue, Mar 1, 2011 at 6:40 AM, Chris Long <galizur at gmail.com> wrote:

            
Hi, Chris.  I think one needs to set the search_path prior to running the
dbWriteTable command.  See the Postgresql docs:

http://www.postgresql.org/docs/current/static/ddl-schemas.html

You'll want to do something like:

set search_path to 'barschema'

Then everything you do will go into barschema rather than public.

Sean