小编dan*_*stx的帖子

准备好的声明不存在

目前运行一个简单的sinatra应用程序,使用乘客,并使用pgbouncer连接池到与应用程序在同一服务器上的数据库.目前我间歇性地得到PG错误,准备好的声明"a\d"不存在.

A PG::Error occurred in #: 
ERROR: prepared statement "a2" does not exist 

在错误之前执行的ruby代码

def self.get_ownership_record(id, key)
  self.where("user_id=? AND key=?", id, key ).first 
end

pgbouncer配置

; #########################################################
; ############# SECTION HEADER [DATABASES] ################
; #########################################################

[databases]

fakedatabase=fake

[pgbouncer]

; ----- Generic Settings --------------------------
; -------------------------------------------------
logfile=/opt/local/var/log/pgbouncer/pgbouncer.log
pidfile=/opt/local/var/run/pgbouncer/pgbouncer.pid
listen_addr=*
listen_port=5444

; unix_socket_dir=/tmp
user=_webuser
auth_file=/Users/Shared/data/global/pg_auth
auth_type=trust
pool_mode=transaction
; max_client_conn=100
; default_pool_size=20
; reserve_pool_size=0
; reserve_pool_timeout=5
; server_round_robin=0

; ----- Log Settings ------------------------------
; -------------------------------------------------
; syslog=0
; syslog_ident=pgbouncer
; syslog_facility=daemon
; log_connections=1 …

postgresql sinatra pgbouncer

5
推荐指数
1
解决办法
7091
查看次数

标签 统计

pgbouncer ×1

postgresql ×1

sinatra ×1