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

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

Open
saintsal opened this issue Jul 3, 2021 · 2 comments

Comments

@saintsal
Copy link

saintsal commented Jul 3, 2021

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.

@saintsal saintsal changed the title Error: "Prepared statement ... already exists" when repeating query [Solved] Error: "Prepared statement ... already exists" when repeating query Jul 3, 2021
@IMalaniak
Copy link

@saintsal is that is the same as setting queryCacheMaxSize in the PostGraphileOptions?

@benjie
Copy link
Member

benjie commented Aug 11, 2022

I don’t think so

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

No branches or pull requests

3 participants