什么是准备好的陈述?

时间:2020-03-05 18:50:58  来源:igfitidea点击:

我在postgres pg_log目录的.log文件中看到很多行,内容如下:

ERROR:  prepared statement "pdo_pgsql_stmt_09e097f4" does not exist

准备好的语句是什么?什么样的情况会导致这些错误消息显示出来?

解决方案

回答

我认为这对我们有帮助:
http://jdbc.postgresql.org/documentation/81/server-prepare.html

基本上看起来像可以预编译的存储过程。

回答

从文档中:

A prepared statement is a server-side
  object that can be used to optimize
  performance. When the PREPARE
  statement is executed, the specifie
  statement is parsed, rewritten, and
  planned. When an EXECUTE command is
  subsequently issued, the prepared
  statement need only be executed. Thus,
  the parsing, rewriting, and planning
  stages are only performed once,
  instead of every time the statement is
  executed.

在网上搜索时,我发现" pdo_pgsql_stmt"命令是通过某种PHP连接到数据库的。也许此链接可以找到可以将错误消息发送到的适合的邮件列表或者问题跟踪器?

编辑:我想我在这里找到了错误:

http://bugs.php.net/bug.php?id=37870