r-dbi / RPostgres

A DBI-compliant interface to PostgreSQL
https://rpostgres.r-dbi.org
Other
334 stars 78 forks source link

Cannot use DBI::dbWriteTable to save temporary table to Redshift #410

Closed ghost closed 1 year ago

ghost commented 1 year ago

When trying to write a simple temporary table to Redshift, I run into an error.

connection <- DBI::dbConnect(drv = RPostgres::Postgres(), 
                             host = host, 
                             port = port, 
                             dbname = dbname, 
                             user = user, 
                             password = password)
DBI::dbWriteTable(conn = connection, name = "iris", value = iris)
Screenshot 2022-11-04 at 9 27 44 AM

Any idea what could be causing this issue? A similar code (substituting name by DBI::Id(schema, table)) works fine for writing permanent tables.

krlmlr commented 1 year ago

Thanks. Can you try RPostgres::Redshift() instead of RPostgres::Postgres() ?

ghost commented 1 year ago

It works using Redshift instead of Postgres. Thanks for helping @krlmlr.