Enzo
Enzo

Reputation: 2611

Connection with a PostgreSQL foreign table

I'm using citus columnar extension cstore_fdw for PostgreSQL (I'm on 9.4.1).

I create the foreign table without any problem.

The problem starts in R when I try to write into it.

A normal dbWriteTable command does not work:

cba <- dbWriteTable(conpg, name=dataDt1_, value=df, row.names=FALSE, overwrite=TRUE)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘dbWriteTable’ for signature ‘"PostgreSQLConnection", "db.table", "data.frame"’

Considering that for PostgreSQL a foreign table can be a csv, a table on another server, a columnar store etc., does anybody have experience accessing any of the above with R?

Upvotes: 2

Views: 336

Answers (1)

Hadi Moshayedi
Hadi Moshayedi

Reputation: 886

cstore_fdw doesn't support UPDATE and DELETE. version 1.2 added support for INSERT INTO cstore_table SELECT ..., but the support for single row inserts is still missing.

Currently you can append data to a cstore table in one of the following ways:

  • Use the COPY command
  • Use INSERT INTO cstore_table SELECT ...

Upvotes: 2

Related Questions