Re: [DOCS] Documentation update for PQexecParams

2006-11-09 Thread David Fetter
On Wed, Nov 08, 2006 at 08:07:19PM +0200, Theo Kramer wrote:
> Hi
> 
> I have been using PQprepare() and PQexecPrepared(). This has led me to 
> update libpq.sgml, in particular for PQexecParams().
> 
> The changes are to the formatting of the arguments for PQexecParams()
> (as shared by PQexecPrepared()) which make it easier to read, as well as
> creating a table giving a set of possible values for the various arguments 
> with
> the associated SQL types.
> 
> I would imagine the best place to submit the patch would be to
> psql-patches, however, before I do this I am wondering if this is the right 
> forum for
> having the changes vetted before submitting the patch.
> 
> Please advise.

Send it to both lists, and thanks for doing this :)

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [DOCS] Documentation update for PQexecParams

2006-11-09 Thread Theo Kramer
On Thu, 2006-11-09 at 06:43 -0800, David Fetter wrote:
> On Wed, Nov 08, 2006 at 08:07:19PM +0200, Theo Kramer wrote:
> > Hi
> > 
> > I have been using PQprepare() and PQexecPrepared(). This has led me to 
> > update libpq.sgml, in particular for PQexecParams().
> > 
> > The changes are to the formatting of the arguments for PQexecParams()
> > (as shared by PQexecPrepared()) which make it easier to read, as well as
> > creating a table giving a set of possible values for the various arguments 
> > with
> > the associated SQL types.
> > 
> > I would imagine the best place to submit the patch would be to
> > psql-patches, however, before I do this I am wondering if this is the right 
> > forum for
> > having the changes vetted before submitting the patch.
> > 
> > Please advise.
> 
> Send it to both lists, and thanks for doing this :)
> 

Thanks - attached output of 'diff -c libpq.sgml libpq.sgml.org' where
libpq.sgml contains my proposed changes and libpq.sgml.org originates
from the 8.2 Beta 2 distribution for comment.
-- 
Regards
Theo
*** libpq.sgml	Tue Nov  7 22:06:37 2006
--- libpq.sgml.org	Mon Oct 23 20:10:31 2006
***
*** 956,962 
  are connected to. The number is formed by converting the major, minor, and
  revision numbers into two-decimal-digit numbers and appending them
  together. For example, version 8.1.5 will be returned as 80105, and version
! 8.2 will be returned as 80200 (leading zeroes are not shown).  Zero is
  returned if the connection is bad.
  
  
--- 956,962 
  are connected to. The number is formed by converting the major, minor, and
  revision numbers into two-decimal-digit numbers and appending them
  together. For example, version 8.1.5 will be returned as 80105, and version
! 8.1 will be returned as 80100 (leading zeroes are not shown).  Zero is
  returned if the connection is bad.
  
  
***
*** 1138,1237 
  
  
  
! 
! 
!   
! command
! 
!   
! The SQL command to be executed. If parameters are used, they are referred to in the command string
! as $1, $2, etc.
!   
! 
!   
! 
!   
! nParams
! 
!   
! The number of parameters supplied; it is the length
! of the arrays paramTypes[], paramValues[],
! paramLengths[], and paramFormats[]. (The array pointers
! may be NULL when nParams is zero.)
!   
! 
!   
! 
!   
! paramTypes[]
! 
!   
! Specifies, by OID, the data types to be assigned to
! the parameter symbols.  If paramTypes is NULL, or any particular
! element in the array is zero, the server assigns a data type to the parameter
! symbol in the same way it would do for an untyped literal string.
!   
! 
!   
! 
!   
! paramValues[]
! 
!   
! Specifies the actual values of the parameters.
! A null pointer in this array means the corresponding parameter is null;
! otherwise the pointer points to a zero-terminated text string (for text
! format) or binary data in the format expected by the server (for binary
! format).
!   
! 
!   
! 
!   
! paramLengths[]
! 
!   
! Specifies the actual data lengths of binary-format parameters.
! It is ignored for null parameters and text-format parameters.
! The array pointer may be null when there are no binary parameters.
!   
! 
!   
! 
!   
! paramFormats[]
! 
!   
! Specifies whether parameters are text (put a zero in the array for
! the corresponding parameter) or binary (put a one in the array for
! the corresponding parameter). If the array pointer is null then all
! parameters are presumed to be zero terminated text strings.
!   
! 
!   
! 
!   
! resultFormat
! 
!   
! Specify zero to obtain results in text format, or one to
! obtain results in binary format.  (There is not currently a provision to
! obtain different result columns in different formats, although that is
! possible in the underlying protocol.)
!   
! 
!   
! 
! 
  
  
- 
  The primary advantage of PQexecParams over PQexec
  is that parameter values may be separated from the command string, thus
  avoiding the need for tedious and error-prone quoting and escaping.
- 
  
- 
  Unlike PQexec, PQexecParams allows at most one SQL
  command in the given string.  (There can be semicolons in it, but not more
  than one nonempty command.)  This is a limitation of the underlying protocol,
--- 1138,1178 
  
  
  
! If parameters are used, they are referred to in the command string
! as $1, $2, etc.
! nParams is the number of parameters supplied; it is the length
! of the arrays paramTypes[], paramValues[],
! paramLengths[], and paramFormats[].  (The
! array pointers may be NULL when nParams is zero.)
! paramTypes[] specifies, by OID, the data types to be assigned to
! the parameter symbols.  If paramType