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

Cursor is not fetched when executing insert/update/delete/copy into #57

Open
rad-pat opened this issue Feb 7, 2025 · 0 comments
Open

Comments

@rad-pat
Copy link
Contributor

rad-pat commented Feb 7, 2025

When using SQLAlchemy classes to build and execute queries, the cursor is not fetched to ensure completion of the statement.
For example, we have an insert statement similar to the basic example shown below, it takes a long time to execute because it is acting on 270M row table. The query returned success fairly quickly, but inspection of the target table shows that the rows have not been populated and database logs show that the query was still executing. It turns out that was because the cursor was not fetched.

source = source_table.select()
connection.execute(
    target.table.insert().from_select(
        source.selected_columns, source
    )
)

I am currently working on a fix for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant