Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbExecute(immediate = TRUE) after dbAppendTable() fails #382

Closed
krlmlr opened this issue Dec 21, 2021 · 1 comment · Fixed by #383
Closed

dbExecute(immediate = TRUE) after dbAppendTable() fails #382

krlmlr opened this issue Dec 21, 2021 · 1 comment · Fixed by #383
Labels

Comments

@krlmlr
Copy link
Member

krlmlr commented Dec 21, 2021

The problem shows after 4e90a00.

library(RPostgres)

con <- postgresDefault()
dbCreateTable(con, "test", data.frame(a = integer()), temporary = TRUE)
dbAppendTable(con, "test", data.frame(a = 1:3), copy = TRUE)
#> [1] 3
Sys.sleep(1)
dbExecute(con, "DROP TABLE pg_temp.test", immediate = TRUE)
#> Error: Failed to send query: another command is already in progress

Created on 2021-12-21 by the reprex package (v2.0.1)

Non-failures:

library(RPostgres)

con <- postgresDefault()
dbCreateTable(con, "test", data.frame(a = integer()), temporary = TRUE)
dbAppendTable(con, "test", data.frame(a = 1:3), copy = FALSE)
#> [1] 3
dbExecute(con, "DROP TABLE pg_temp.test", immediate = TRUE)
#> [1] 0

Created on 2021-12-21 by the reprex package (v2.0.1)

library(RPostgres)

con <- postgresDefault()
dbCreateTable(con, "test", data.frame(a = integer()), temporary = TRUE)
dbExecute(con, "DROP TABLE pg_temp.test", immediate = TRUE)
#> [1] 0

Created on 2021-12-21 by the reprex package (v2.0.1)

library(RPostgres)

con <- postgresDefault()
dbCreateTable(con, "test", data.frame(a = integer()), temporary = TRUE)
dbAppendTable(con, "test", data.frame(a = 1:3))
#> [1] 3
dbExecute(con, "DROP TABLE pg_temp.test")
#> [1] 0

Created on 2021-12-21 by the reprex package (v2.0.1)

@krlmlr krlmlr added the bug label Dec 21, 2021
krlmlr added a commit that referenced this issue Jan 3, 2022
- Fix `dbExecute(immediate = TRUE)` after `dbAppendTable()` (#382, #384).
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant