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

It seems that PostgreSQL transactional pool mode is not supported yet. #1195

Open
ChrisXuzhou opened this issue Dec 5, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@ChrisXuzhou
Copy link

ChrisXuzhou commented Dec 5, 2024

Describe the bug

Problem:
Using pgbouncer's transaction mode (port 6543) instead of session mode causes critical issues:

Parameter Binding Error

Error message "bind message supplies 4 parameters, but prepared statement requires 1" typically occurs when pgbouncer creates new connections for each query.

This breaks XORM's parameter binding mechanism, causing a mismatch in the number of parameters expected by the query statement. (It seems session states are being used and lost.)

Example error:

bind message supplies 4 parameters, but prepared statement requires 1

For the Query: "SELECT "id", "created_at", "updated_at", "user_id", "invite_user_id", "last_edit_user_id", "title", "original_text", "parsed_text", "pin", "show", "status", "view_count", "unique_view_count", "vote_count", "answer_count", "hot_score", "collection_count", "follow_count", "accepted_answer_id", "last_answer_id", "post_update_time", "revision_id" FROM "question" WHERE "question"."status" IN ($1,$2) AND (question.show = $3) AND (question.created_at > $4) ORDER BY question.pin desc,question.hot_score DESC LIMIT 6"

To Reproduce

Steps to reproduce the behavior:

  1. With a brand new system being set up with an transaction mode postgresdb, you can get the error everytime.

Expected behavior

5xx error report

@ChrisXuzhou ChrisXuzhou added the bug Something isn't working label Dec 5, 2024
@LinkinStars
Copy link
Member

Thanks for the feedback. At this point, I'm not sure if the exact cause of the issue is due to the ORM framework or the driver itself. 🤔

@ChrisXuzhou
Copy link
Author

Thanks for the feedback. At this point, I'm not sure if the exact cause of the issue is due to the ORM framework or the driver itself. 🤔

Anyway, this is a great project. From browsing the code, I can see it’s REALY well-designed and organized. Thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants