Maintainers:
Merlin Moncure <mmoncure at gmail dot com>
Andrew Chernow <ac at esilo dot com>


Version 0.5 - 2007-12-05

- Added a PQputf function which behaves like printf. All types
supported by the param set of functions have a conversion specifier.  To
see an example of use and a list of conversion specifiers, look at
CONVERSION_SPECIFIERS.TXT.  There is also a PQparamExecf and PQparamSendf.

- PQputint8 no longer takes a void* as its value argument.  It is now
a macro that expands to PQputint8v(PQconn*, size_t valsize, ...).  You can
now put 64-bit types by value, which includes constants.  If or when
libpq exposes a 64-bit type, PQputint8 will begin using that instead.

- updated exports.txt: removed PQputint8 because it is now a macro.  Added
PQputint8v, PQputf, PQparamExecf and PQparamSendf.

- Made PQparamClear() an intenal function called pqClearParam().

- Added a PQputbytea() for type safetly reasons.  Version 0.4 started
using Oids for every put call internally.

- Added the ability to put a direct pointer to user memory for the
text and bytea types.  PQputtextptr() and PQputbyteaptr().  When
these functions are used, the param library just stores a pointer
rather than making an internal copy.  After a successful or failed call
to any of the paramexec functions, it is safe to free this memory.

  // Example
  char *text = strdup("some text");
  PQputtextptr(conn, text);
  PQparamExec(conn, cmd, 1, NULL); // failed or not, safe to free memory
  free(text);

The idea is that text and bytea can be very large.  It is a bit
wasteful to allocate another copy of them in these cases.  Also,
PQputtextptr() and PQputbyteaptr() are very useful for stack buffers
or constants.  Watch your scope when using a stack buffer!

- Added extern to PQgetmoney prototype in libpq-fe.h.


Version 0.4 - 2007-08-21
- Added support for inet, cidr types

- fixed tabs/spaces formatting

- small bug fixes

- OID type checks internally now.  OIDs are passed to exec functions.

- merged the PGparam structure into PGconn.  The interface is much
cleaner that way: put value(s) on a conn and eventually exec a query
that uses those params ... in the order they were put.  It is easier to
just keep track of a PGconn, instead introducing an extra struct required
to exec a query.


Version 0.3 - 2007-08-19

- Added support for boolean, macaddr, point, lseg, box, circle, path
and polygon.

- Each Geometric type required a structure.  New structs are:
PGpoint, PGlseg, PGbox, PGcircle, PGpath and PGpolygon.  Very
similar to backend versions: BOX, POLYGON, LSEG, etc...

- All PQparamPutXXX functions have been renamed to match the
PQgetXXX functions.  Instead of PQparamPutInt4(), its now PQputint4().

- Added a PQputnull macro. This translates to an SQL NULL value.

- Any put function that takes a pointer, like PQputint8(), PQputbox(),
etc..., can be provided a NULL.  This has the same effect as calling
PQputnull().

- Added some comments and organization to include/pg.h to match libpq-fe.h.

- Added "extern" to prototypes in include/pg.h.

- Added PQgetmoney().  PQputmoney() is on the back burner until an 8.3
issue is resolved.  Need to know which version officially moves
to 64-bit money type. This will allow PQputmoney() to identify what size
to use for a money type.  PQgetmoney() can simply use PQgetlength(),
after verifying PQftype() is CASHOID.

**QUESTIONS: Does the libpq library ever allocate memory with something
other than malloc?  Are there times we need to use this allocator?  I
ask due to the existence of PQfreemem().


Version 0.2 - 2007-08-18

While enhancing the API and refactoring to match libpq naming, some
bugs were introduced.  Below is a list of the fixes.  Also, the list
includes a few things that cleaned up the code for readability.

- PGparam had a slab and slabsize member.  This is a dead idea and
was removed.  PQparamClear was referencing the slab member; this has
been removed as well.

- PQparamPutString was accepting a length argument.  It specified
the strlen of the string to put.  Initially, this API only sent params
in binary format.  Because of this, PQparamPutString was not including
the NUL in the value.  Since PQparamPutString was changed to send
strings in text format, things broke because there was no NUL.
The length argument has been removed and PQparamPutString properly
handles text format NUL.

- PQparamPutString has been renamed to PQparamPutText to macth
postgres type.

- PQparamPutFloat has been renamed to PQparamPutFloat4 to match
postgres type.

- PQparamPutDouble has been renamed to PQparamPutFloat8 to match
postgres type.

- PQgetfloat is a macro that did not put "()" around its floatp arg.
was ((void*)flaotp), now its ((void*)(floatp))).

- PQgetfloat has been renamed to PQgetfloat4 to match postgres type.

- PQgetdouble has been renamed to PQgetfloat8 to match postgres type.

- The PARAM_CHKPTR(p) macro was stupidly dereferencing the param
ptr ... ONLY IF IT WAS NULL!  Yes, lets make sure the ptr is NULL before
we access it.  Cute :)

- PQgetchar text format was broken (for use with "char" type).
Apparently, when using text format the char value is converted to "A"
instead if "65". Makes sense, just wasn't initially aware of this.

- PQparamPutChar, PutInt2, PutInt4, PQgetchar, getint2 and getint4 were
all using unsigned types.  These have been changed to signed types since
postgres server leans more towards signed types.

- param.c had a long macro named PARAM_ARRAY_ASSIGN.  This has been
converted to a static function named paramArrayAssign().

- Changes some error messages to make them more clear.

- Comments were added throughout param.c and result.c.

