[R-sig-DB] RPostgreSQL - dbWriteTable

Sean Davis @d@v|@2 @end|ng |rom m@||@n|h@gov
Tue Mar 1 12:55:13 CET 2011


On Tue, Mar 1, 2011 at 6:40 AM, Chris Long <galizur using gmail.com> wrote:

> 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 (!).
>
>
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

	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list