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

Extend Spi's understanding of "readonly" to transaction #992

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

eeeebbbbrrrr
Copy link
Contributor

Mucking with the pushing a new Snapshot if we think we've modified the database isn't correct. It can cause problems elsewhere within Postgres where Postgres expects the Portal's snapshot to be the same as when the Portal was created.

The best I can see to do is just track "readonly" (renamed to MUTABLE_MODE) for the duration of the current transaction.

This problem appeared while working on plrust, upgrading it to the pgx 'develop' branch.

I've spent almost 2 hours trying to come up with a test case for this, but as best I can tell, without actually implementing an actual language handler in pgx' test suite I can't see how to expose the underlying problem.

For now, the fact plrust works will have to be the test.

Mucking with the pushing a new Snapshot if we *think* we've modified the database isn't correct.  It can cause problems elsewhere within Postgres where Postgres expects the Portal's snapshot to be the same as when the Portal was created.

The best I can see to do is just track "readonly" (renamed to `MUTABLE_MODE`) for the duration of the current transaction.
@eeeebbbbrrrr
Copy link
Contributor Author

This is more followup to PR #984, which came about from issue #983. No good deed goes unpunished.

@eeeebbbbrrrr eeeebbbbrrrr merged commit d7dd218 into develop Jan 4, 2023
@eeeebbbbrrrr eeeebbbbrrrr deleted the fix-spi-readonly branch June 20, 2023 17:58
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