postgresql:prepared statement "S_1" already exists

Source: Internet
Author: User
Tags postgresql



Recently due to business needs and some JSON storage query needs, the new application cut to pgsql up, just cut, can be normal use, but occasionally will come


Java Connection Pgsql occasionally this error occurs.org.postgresql.util.PSQLException:ERROR:prepared Statement "S_1" already existsCheck SQL statements, almost no problem, and look at the settings, really can't find where there is a problem Baidu online information is too little, simply I write an article, convenient to meet this problem of friends to solve problems, do not have to look over and over again Pgbouncer official documents found the method disabling Prepared statements in JDBC


The proper-to-do it for JDBC are adding prepareThreshold=0 parameter to connect string.



On the configuration file, add


Jdbc.url=jdbc:postgresql://xxxxx:6432/finance_log? preparethreshold=0

Start again, s_1 such errors are almost impossible to find. Ok

Attached official note
https://pgbouncer.github.io/faq.html#what-should-my-serverresetquery-be

Https://jdbc.postgresql.org/documentation/head/connect.html 


postgresql:prepared statement "S_1" already exists


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.