graphile / graphile/graphile.github.io
[Solved] Error: "Prepared statement ... already exists" when repeating query
- Ngôn ngữ chính
- SCSS
- Star
- 27
- Fork
- 126
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I just tried the default docker image with Digital Ocean's hosted Postgres (which recommends using connection pools), and ran into the error "Prepared statement ... already exists" when repeating the same query.
@benjie quickly pointed out the following on Discord:
> PostGraphile uses prepared statements as a minor performance optimisation, but this causes issues if you’re running external connection pools in addition to PostGraphile’s native connection pooling. You can disable prepared statements by setting the environment variable POSTGRAPHILE_PREPARED_STATEMENT_CACHE_SIZE=0
In my case, since PostGraphile already has connection pools built-in, I just connected directly to the database rather than the Postgres connection pool, and everything works fine.
I wasn't sure where this might go in the documentation, so just quickly posting this as an issue in case it helps anyone.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với nội dung issue, trong đó ghi lại lỗi prepared statement khi sử dụng connection pool Postgres bên ngoài cùng với PostGraphile. Không có tệp tài liệu hoặc bài kiểm thử nào được nêu tên, vì vậy trước tiên hãy xác định tài liệu liên quan đến connection pooling hoặc cấu hình. Công việc được xem là hoàn tất khi workaround sử dụng POSTGRAPHILE_PREPARED_STATEMENT_CACHE_SIZE=0 và hướng dẫn kết nối trực tiếp tới cơ sở dữ liệu được ghi lại rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker, postgresql
- Lĩnh vực
- databases, documentation
- Loại issue
- Tài liệu
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100