graphile / graphile/graphile.github.io

[Solved] Error: "Prepared statement ... already exists" when repeating query

Open
#280 2 comments 5 reactions 0 assignees View on GitHub
Dominant language
SCSS
Stars
27
Forks
126
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.