library(dbplyr, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)
con <- DBI::dbConnect(RPostgres::Postgres())
# the table must be big enough to trigger this issue...
DBI::dbWriteTable(
con,
"df_x",
tibble(a = 1:100e3, b = 2, x = "a"),
temporary = TRUE
)
DBI::dbWithTransaction(
con, {
dbplyr:::get_col_types(con, "df_x", rlang::current_env())
DBI::dbGetQuery(con, "SELECT * FROM df_x LIMIT 1")
}
)
#> Error: Failed to prepare query: ERROR: current transaction is aborted, commands ignored until end of transaction block
Created on 2023-03-09 with reprex v2.0.2
Created on 2023-03-09 with reprex v2.0.2