Comments (5)
Thanks. Can you use dbAppendTable()
or the like to create a temporary table on the database, and then use rows_append(copy = FALSE)
to copy to the persistent table?
In the dbplyr issue, I see that dbWriteTable()
has the same problem as rows_append()
. Can you please provide more detail in how dbWriteTable()
compares to dbAppendTable()
? What happens if the table is created with dbCreateTable()
and then data is appended with dbAppendTable()
?
What does dbDataType()
return for your data?
from rpostgres.
dbAppendTable()
actually works fine already for appending data to a Redshift table with the appropriate datatype. This is why I thought the issue might be a dplyr or dbplyr issue instead. dplyr::rows_append()
is broken for me and should work, but it's not my main concern at the moment since I can use the dbAppendTable()
workaround.
What I'm really after is dplyr::rows_update()
which is a really simple way to update rows of a database. I haven't found a good workaround for this. I am having trouble tracing what dplyr::rows_update()
is doing and how the ecosystem of RPostgres, dbplyr, and dplyr work together.
from rpostgres.
Thanks. I'm typically using separate steps for bringing data into the database and updating a live data model:
- Copy data as temporary table
- Use
rows_xxx(copy = FALSE)
(the default)
This is a bit more tedious, but gives the best control.
from rpostgres.
Realizing I didn't really answer your rows_update()
question.
rows_update()
and the other rows_*()
functions work best if the data is already in the database, e.g., in a temporary table. Then you can use update = FALSE
to avoid copying, this simplifies the procedure. You prepare a table that contains the keys and new values you want to update, copy it to the database, and call rows_update()
. Does that help?
from rpostgres.
We have moved to BigQuery so I am closing the issue. Thanks for all your help!
from rpostgres.
Related Issues (20)
- collation warning on Ubuntu 22.04 HOT 4
- Unable to create table with logical column HOT 4
- relicense RPostgres as MIT HOT 2
- using databases.pacha.dev for testing HOT 4
- Curious bug with transaction and `dbSendQuery()` HOT 6
- Schema with DBI::Id appears not to work with `dbListTables` HOT 4
- Redshift: dbWriteTable() with larger DFs and CSVs HOT 3
- Bigints in dbQuoteLiteral HOT 4
- Polygon/multipolygon columns: incorrect write, correct read HOT 7
- Something wrong with the 1.4.5 Mac binary on CRAN with Redshift HOT 33
- How to deal with `pq__varchar` columns HOT 11
- vendoring cpp11 headers HOT 1
- RPostgres should respect system timezone rather than default to UTC HOT 9
- unnamed `Id()` breaks `dbQuoteIdentifier()` HOT 10
- Option to convert "enum" types to factor or character? HOT 11
- Memory leak when querying from a packaged function HOT 3
- RPostgres dbConnect crashes with segfault in R 4.2.3 running on RHEL 8 HOT 1
- Configuration failed because libpq was not found. HOT 7
- dbGetQuery failing due to stale Redshift OIDs HOT 6
- `dbAppendTable()` is incompatible with PostgreSQL row-level security enabled (COPY FROM not supported) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpostgres.