Skip to content

Can't use rows_*() for Postgres inside a transaction #1183

Description

@mgirlich
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions