Clarify documentation on the behavior of unnamed bind queries.
authorBruce Momjian
Tue, 16 Feb 2010 20:15:14 +0000 (20:15 +0000)
committerBruce Momjian
Tue, 16 Feb 2010 20:15:14 +0000 (20:15 +0000)
doc/src/sgml/protocol.sgml
src/backend/tcop/postgres.c

index 845e41813073dacdbc02a3263028a8d63e96e324..5b69f373243774f9c06a5c68de184383de2ff418 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  Frontend/Backend Protocol
    
     The unnamed prepared statement is likewise planned during Parse processing
     if the Parse message defines no parameters.  But if there are parameters,
-    query planning occurs during Bind processing instead.  This allows the
-    planner to make use of the actual values of the parameters provided in
-    the Bind message when planning the query.
+    query planning occurs every time Bind parameters are supplied.  This allows the
+    planner to make use of the actual values of the parameters provided by
+    each Bind message, rather than use generic estimates.
    
 
    
index 8d33000e616897be82ccd4750d0d9cfadfb1ecd1..15d0808ad24b9f20eb560362975d96f906313513 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.588 2010/02/13 01:32:19 sriggs Exp $
+ *   $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.589 2010/02/16 20:15:14 momjian Exp $
  *
  * NOTES
  *   this is the "main" module of the postgres backend and
@@ -1469,7 +1469,7 @@ exec_bind_message(StringInfo input_message)
    }
    else
    {
-       /* special-case the unnamed statement */
+       /* Unnamed statements are re-prepared for every bind */
        psrc = unnamed_stmt_psrc;
        if (!psrc)
            ereport(ERROR,