At 2004-10-05 17:48:27 -0400, [EMAIL PROTECTED] wrote:
>
> Searching for all references to one of the existing entry points such
> as PQexecPrepared will probably help you identify what you need to do.

OK. I've attached two additional patches below.

I don't really understand how the *.def files work, so I'm just guessing
about what needs to be changed. Thanks to Josh Berkus and Kris Jurka for
looking over the documentation patch, which just adds descriptions of
the two new functions.

I apologise in advance if I've missed anything.

-- ams
--- libpqdll.def.1~     2004-10-06 03:34:38.727908153 +0530
+++ libpqdll.def        2004-10-06 03:33:55.053473771 +0530
@@ -115,3 +115,5 @@
     PQsendQueryPrepared     @ 111
     PQdsplen                @ 112
     PQserverVersion         @ 113
+    PQsendPrepare           @ 114
+    PQprepare               @ 115

--- libpqddll.def.1~    2004-10-06 03:34:58.573470328 +0530
+++ libpqddll.def       2004-10-06 03:35:12.184112562 +0530
@@ -115,3 +115,5 @@
     PQsendQueryPrepared     @ 111
     PQdsplen                @ 112
     PQserverVersion         @ 113
+    PQsendPrepare           @ 114
+    PQprepare               @ 115

--- blibpqdll.def.1~    2004-10-06 03:31:57.372858897 +0530
+++ blibpqdll.def       2004-10-06 03:32:50.903586158 +0530
@@ -115,6 +115,8 @@
     _PQsendQueryPrepared     @ 111
     _PQdsplen                @ 112
     _PQserverVersion         @ 113
+    _PQsendPrepare           @ 114
+    _PQprepare               @ 115
 
 ; Aliases for MS compatible names
     PQconnectdb             = _PQconnectdb            
@@ -230,3 +232,5 @@
     PQsendQueryPrepared     = _PQsendQueryPrepared
     PQdsplen                = _PQdsplen
     PQserverVersion         = _PQserverVersion
+    PQsendPrepare           = _PQsendPrepare
+    PQprepare               = _PQprepare
*** libpq.sgml.1~       2004-10-06 03:30:42.803775731 +0530
--- libpq.sgml  2004-10-06 05:24:22.934466263 +0530
***************
*** 1183,1194 ****
  </varlistentry>
  </variablelist>
  
! Presently, prepared statements for use with <function>PQexecPrepared</>
! must be set up by executing an SQL <command>PREPARE</> command,
! which is typically sent with <function>PQexec</> (though any of
! <application>libpq</>'s query-submission functions may be used).
! A lower-level interface for preparing statements may be offered in a
! future release.
  </para>
  
  <para>
--- 1183,1238 ----
  </varlistentry>
  </variablelist>
  
! Prepared statements for use with <function>PQexecPrepared</> can be
! created by executing an SQL <command>PREPARE</> statement (which is
! sent with <function>PQexec</>, or one of the other query-submission
! functions), or with <function>PQprepare</>. The latter does not
! require parameter types to be pre-specified.
! </para>
! 
! <para>
! <variablelist>
! <varlistentry>
! <term><function>PQprepare</function><indexterm><primary>PQprepare</></></term>
! <listitem>
! <para>
!           Submits a request to create a prepared statement with the
!           given parameters, and waits for completion.
! <synopsis>
! PGresult *PQprepare(PGconn *conn,
!                     const char *stmtName,
!                     const char *query,
!                     int nParams,
!                     const Oid *paramTypes);
! </synopsis>
! </para>
! 
! <para>
! <function>PQprepare</> creates a prepared statement for execution with
! <function>PQexecPrepared</>. Unlike <command>PREPARE</>, it allows the
! client to prepare a statement without pre-specifying the types of each
! parameter. This function is supported only in protocol 3.0 and later
! connections; it will fail when using protocol 2.0.
! </para>
! 
! <para>
! The function creates a prepared statement named <parameter>stmtName</>
! (which may be <literal>""</>, to refer to the unnamed statement) from
! the <parameter>query</>. If any parameters are used, they are referred
! to in the query as <literal>$1</>, <literal>$2</>, etc.
! 
! <parameter>nParams</> is the number of parameters for which types are
! pre-specified in the array <parameter>paramTypes[]</>. It may be zero,
! or up to the number of parameters used in the query. Each entry in the
! <parameter>paramTypes[]</> array should contain the OID of the type of
! the corresponding parameter. If <parameter>nParams</> is 0, the server
! assigns a data type to each parameter, as it would for untyped literal
! strings. Likewise, if any element in the type array is zero, its type
! is inferred.
! </para>
! </listitem>
! </varlistentry>
! </variablelist>
  </para>
  
  <para>
***************
*** 2353,2358 ****
--- 2397,2423 ----
  </varlistentry>
  
  <varlistentry>
+ <term><function>PQsendPrepare</><indexterm><primary>PQsendPrepare</></></term>
+ <listitem>
+ <para>
+         Sends a request to create a prepared statement with the given
+         parameters, without waiting for completion.
+ <synopsis>
+ int PQsendPrepare(PGconn *conn,
+                   const char *stmtName,
+                   const char *query,
+                   int nParams,
+                   const Oid *paramTypes);
+ </synopsis>
+ 
+         This is an asynchronous version of <function>PQprepare</>, and
+         its parameters are handled identically. It will not work on 2.0
+         protocol connections.
+ </para>
+ </listitem>
+ </varlistentry>
+ 
+ <varlistentry>
  <term><function>PQgetResult</function><indexterm><primary>PQgetResult</></></term>
  <listitem>
  <para>
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to