You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But then I have a hard time figuring out how to write an R object to this large object.
For example, how would I write mtcars as a large object in Postgres using {DBI} and {RPostgres}?
And then, how do I read it back again in R?
The text was updated successfully, but these errors were encountered:
df <- DBI::dbGetQuery(conn, "select lo_get(1234) as image")
But those functions only work on the server side, i.e, the file must be on the same server as PostgreSQL. Also, the user must be a superuser. There would be great if someone an R package to work on the client side: client interfaces.
Cross-posted with https://stackoverflow.com/questions/70271590/read-write-postgres-large-objects-with-dbi-rpostgres
I'm trying to use the large object feature from Postgres https://www.postgresql.org/docs/10/largeobjects.html but I have a hard time wrapping my head around converting R object and writing them to the db.
Here is what I have tried so far:
# Getting the db docker run --rm --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5433:5432 postgres
Creation works :
But then I have a hard time figuring out how to write an R object to this large object.
For example, how would I write
mtcars
as a large object in Postgres using{DBI}
and{RPostgres}
?And then, how do I read it back again in R?
The text was updated successfully, but these errors were encountered: