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

Plugins! #420

Merged
merged 11 commits into from
May 3, 2023
Merged

Plugins! #420

merged 11 commits into from
May 3, 2023

Conversation

levkk
Copy link
Contributor

@levkk levkk commented May 2, 2023

Feature

Introducing plugins.

The idea is to perform an action based on a query.

Currently, the actions I'm thinking of could be:

  • let the query go through unharmed
  • block the query and return an error immediately
  • intercept the query and return a fake result
  • rewrite the query (like pgbouncer-rr-patch)

The last one isn't supported yet, but maybe someone with a use case could contribute a PR.

Why

Well, a couple reasons. First, I want to block users from querying certain system tables. Postgres doesn't let me do that, and that's fine. The query planner may need them, but the user doesn't need to explicitly query them, so that solves that problem.

Another reason, I just discovered the joy of using IDEs like DataGrip (IntelliJ), and they get pretty upset when they are talking to a pooler. The included fool_datagrip function returns fake information about the "database" It's connected to, so DataGrip doesn't complain.

Bug fixes

Increase default pool reaper rate to match min(idle_timeout, server_lifetime).

@levkk levkk force-pushed the levkk-block-some-tables branch from e161f37 to 54e9865 Compare May 2, 2023 22:08
@levkk levkk merged commit 09e54e1 into main May 3, 2023
@levkk levkk deleted the levkk-block-some-tables branch May 3, 2023 16:13
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