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

No xact callback for spi mutability #1104

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

eeeebbbbrrrr
Copy link
Contributor

pgx probably shouldn't use register_xact_callback to help track a transaction's mutability. This can cause problems if for some reason the pgx extension is unloaded from a running postgres backend as Postgres will still have a pointer to the transaction hook function that has now been unloaded.

Instead, we can easily use the current TransactionId to determine if the transaction has been mutated yet, which still allows us (more correctly, even), to ensure Spi sets the read_only flag appropriately when executing a statement.

This also gets rid of the need for a pgx-specific static.

… transaction's mutability. This can cause problems if for some reason the pgx extension is unloaded from a running postgres backend as Postgres will still have a pointer to the transaction hook function that has now been unloaded.

Instead, we can easily use the current `TransactionId` to determine if the transaction has been mutated yet, which still allows us (more correctly, even), to ensure Spi sets the `read_only` flag appropriately when executing a statement.

This also gets rid of the need for a pgx-specific static.
@eeeebbbbrrrr eeeebbbbrrrr force-pushed the no-xact-callback-for-spi-mutability branch from 7098dd4 to 2f4f3b2 Compare April 18, 2023 19:49
@eeeebbbbrrrr eeeebbbbrrrr merged commit a9f248a into develop Apr 19, 2023
@eeeebbbbrrrr eeeebbbbrrrr deleted the no-xact-callback-for-spi-mutability branch June 20, 2023 17:59
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

Successfully merging this pull request may close these issues.

1 participant