This is the pgtcl-ng Source Release NEWS file
Last updated for pgtclng-2.0.0 on 2011-09-18
The project home page is: http://sourceforge.net/projects/pgtclng/
-----------------------------------------------------------------------------

* 2011-09-18    pgtcl-ng 2.0.0 Released

This release includes two new commands and one new command option. It also
includes a fix for building with Tcl-8.6 (currently in beta).

This is the first release after rehosting on Sourceforge.net. Documentation
and information files have been updated accordingly.

Feature request #3408919 "Access to server PID, notification PID, and
        server version":
+ New command pg_backend_pid to get the backend process ID.
+ New command pg_server_version to get the server version as an intger.
+ New -pid option to pg_listen, to pass the notifying client's backend
  process ID to the notification callback.

Fixed bug #3405928, building fails with Tcl-8.6 beta, reported by Zbigniew:
Pgtcl-ng will now compile with Tcl-8.6beta, avoiding access to the errorLine
structure element which is now hidden.  The correct access method is detected
at compile time. However, if Pgtcl-ng is compiled using stubs with Tcl-8.6,
and then run under Tcl-8.5 or older, it will crash. This is because the
new function used at 8.6 to access the structure member does not exist in
older releases.


Note: Despite the version number ending in ".0.0", Pgtclng-2.0.0 is not 
substantially different from the previous release 1.9.0, and there should
be no incompatibilities. (Changes were made to an internal data structure,
but a major factor in not using "1.10.0" instead is the way release packages
are sorted by name.)


* 2011-03-21    pgtcl-ng 1.9.0 Released

This release adds one new feature: pg_result $r -dict, which returns the
query result as a Tcl dictionary. The idea for this feature came from the
pgfoundry 'pgtcl' project. This feature requires Tcl-8.5 or higher.


* 2010-10-10    pgtcl-ng 1.8.0 Released

This release has one new feature for PostgreSQL-9.0.0. Notification
messages can now include a payload, which is passed to the notification
listener callback proc. For example:
Given (in one session):
    pg_listen $db my_channel my_callback_proc

Then (possibly in another session):
    SQL> NOTIFY my_channel, 'the payload'
This will result in execution of:  my_callback_proc "the payload" in the
original session.

And:
       SQL> NOTIFY my_channel
 or:   SQL> NOTIFY my_channel, ''
This will result in execution of:  my_callback_proc
in the original session.

Compatibility Warning:
    This applies only if you use pg_listen to set up a notification listener
    callback procedure.

    Your listener callback should be defined to accept an optional argument
    for the payload, for example:   proc listen_handler {{payload ""}} { ... }
    Starting with version 1.8.0, pgtclng will pass a payload argument to the
    handler if a non-empty payload is provided in the SQL command. If an empty
    payload is provided, or no payload (including any usage with a PostgreSQL
    server older than 9.0.0), pgtclng will not supply the argument to the
    handler. This behavior was chosen to improve compatibility with older
    scripts that would throw an error if provided an unexpected argument.

    If you do not update your listener callback to have an optional argument,
    and you never include a payload in the notification SQL, your script will
    not have any problems. However, note that anyone who can connect to the
    database can send a notification (if they know the 'channel' name used
    in the pg_listen command), and they can include a payload. If your listener
    callback does not expect a payload argument, it will throw a background
    error (which may or may not terminate the script) if it receives such a
    payload argument.


For Windows, only MinGW building is now supported and tested. Borland BCC
building of pgtcl-ng probably still works, but is no longer tested. Refer
to the Windows binary release of pgtcl-ng for more information.


* 2010-07-14    pgtcl-ng 1.7.2 Released

This release now supports building on Windows with MinGW, in addition to
Borland C++ Building (BCC). The binary release for Windows now includes
DLLs built with BCC and with MinGW. (In future releases, the BCC-built DLLs
may be dropped, leaving just MinGW.)

There is one bug fix for a failure to build and run pgtcl-ng on PostgreSQL
versions before 8.2. It has no impact for PostgreSQL-8.2 and higher.


* 2009-11-25    pgtcl-ng 1.7.1 Released

The release now supports building a Tcl stubs-enabled module on Windows,
which means the same compiled module will load into different Tcl versions.

There is one minor bug fix to pg_encrypt_password. An error was not
properly detected when the command was passed an invalid, empty username.


* 2009-09-11    pgtcl-ng 1.7.0 Released

This release adds some commands and options to "catch up" to features added
to the PostgreSQL libpq library.

This version adds four new commands:
+ pg_encrypt_password to encrypt a password for certain SQL commands
+ pg_lo_truncate to truncate a large object
+ pg_describe_cursor to return information about a cursor (portal)
+ pg_describe_prepared to return information about a prepared statement.

This version adds two options to pg_result, for use with
pg_describe_prepared to return information about a prepared statement:
+ pg_result -numParams returns the number of parameters
+ pg_result -paramTypes returns the parameter type OIDs.

In this release, pg_escape_string, pg_quote, and pg_escape_bytea
accept an optional connection parameter. This allows use of
connection-specific information to properly handle string escaping.

This release also contains fixes to error handling in pg_select.


* 2007-12-26    pgtcl-ng 1.6.2 Released

This release fixes a character set encoding problem on Windows only. When
communicating with a non-UTF8 database, character set translation was not
working because the method pgtcl-ng used to set the client encoding
(PGCLIENTENCODING environment variable) was not working. This release fixes
the problem by using a different way to set the client encoding
(PQsetEncoding call). This problem only affected Windows, and this was
probably a long-standing issue (not introduced in a recent release).

* 2007-12-25    pgtcl-ng 1.6.1 Released

This release contains important fixes for the new Tcl-8.5.0 release.
Versions of pgtcl-ng before this will crash with "... called with
shared object" when built against Tcl-8.5. Pgtcl-ng 1.6.1 will also build
and run with Tcl-8.4.x.


* 2007-01-15    pgtcl-ng 1.6.0 Released

This release contains the new features described in "pgtcl-ng 1.6.0 Beta
version" below, plus the following:

New command: pg_sendquery_prepared
This executes a pre-prepared query (like pg_exec_prepared), but is
asynchronous like pg_sendquery.

New command: pg_sendquery_params
This executes a parameterized query (like pg_exec_params), but is
asynchronous like pg_sendquery. Note: pg_sendquery itself supports
parameterized queries, but only for untyped TEXT parameters.
pg_sendquery_params supports binary parameters and binary return type.


* 2006-12-13    pgtcl-ng 1.6.0 Beta version

This release contains two new features for asynchronous queries.

1. Asynchronous parameterized queries:

The command pg_sendquery now accepts optional arguments which are used
as parameter substitutions in the SQL query. For example:
     pg_sendquery $connection "SELECT * FROM mytable WHERE i=\$1" $var
The parameter value ($var) is sent to the PostgreSQL backend along with the
query as a parameterized query. This works like pg_exec with parameters,
but for asynchronous queries.  This idea was copied from the Pgtcl project,
by Brett Schwarz and Karl Lehenbauer.


2. Event-driven asynchronous query results:

A command can be registered to execute when a result is ready from an
asynchronous query. This provides event-driven asynchronous queries.
(Before this was added, the choice was to busy-wait or block.)

The command to register a result callback is:
     pg_result_callback $conn ?callbackCommand?
If the callback command is provided, a new result callback is established.
Only one result callback can be active at any time.
Synchronous query commands are not allowed when a result callback is in place.
A result callback will be removed if any of the following occurs:
  (a) The callback command executes because the result is ready.
  (b) pg_getresult is called (which blocks until a result is ready).
  (c) pg_cancelrequest is called (canceling the asynchronous query).
  (d) The connection is closed.
  (e) pg_result_callback is called. (Without a callbackCommand, to
      just remove the callback, or with a callbackCommand to replace the
      callback.)
To use event-driven asynchronous query results, first establish the
callback, then issue the query with pg_sendquery.

Suggested by Kyle Bateman (kyleb), with the initial implementation designed
and written by Miguel Sofer (msofer).


* 2006-08-30    pgtcl-ng 1.5.3 Released

This is the first release on pgfoundry. (Prior releases were on gborg.)
This release also contains the following changes:
   1. Bug fix for character set encoding during COPY FROM/TO
   2. Replaced build system using newer TEA 3.5. Other build fixes.


* 2004-11-07    pgtcl-ng 1.5.2 Released

This is a minor release. There are two new commands suggested by levanj:
   1.  New command pg_escape_bytea escapes a binary string for
       use in an SQL statement for a BYTEA type column.
   2.  New command pg_unescape_bytea un-escapes a BYTEA column value
       from a query result and returns a Tcl binary string.

For better compatibility with Gborg pgtcl, which implemented the -errorField
feature of pgtcl-ng/pgin.tcl in a different way:
   3.  The error code field name is now optional to pg_result -errorField,
       and can also be supplied to pg_result -error. This means the two
       subcommands are now identical. With no error code field name argument,
       they return the default message form. Also, extended the list of
       valid field code names to be case insensitive and include the
       different field code names used in Gborg pgtcl, 


* 2004-06-07    pgtcl-ng 1.5.1 Released

This is the second release of pgtcl-ng with these changes:
   1.  New command option: pg_result $res -cmdStatus
       Returns the command completion tag, e.g. "UPDATE 4".
       (Suggested by Jerry.Levan -at- EKU.EDU)
   2.  If EXTRA_LIBS is defined in the environment when "configure" runs,
       its value will be appended to the link line. This is for some systems
       where dependent libraries must be explicitly specified.
       (Suggested by Jerry.Levan -at- EKU.EDU)
   3.  New command: pg_quote to return quoted escaped string. This was recently
       added to Gborg pgtcl CVS, replacing pg_escape_string, but pgtcl-ng
       will continue to support both.
   4.  Fix pg_execute error handling to allow arbitrary return
       codes from the script it executes, same as pg_select.
   5.  New command: pg_exec_params to execute parameterized query, binary safe.
   6.  pg_exec can take extra arguments which will substitute for
       placeholders in the SQL. This is not binary safe; use pg_exec_prepared
       or pg_exec_params for binary parameters or binary results.
       (Idea from Gborg pgtcl CVS - karl.)


* 2004-02-28    pgtcl-ng 1.5.0 Released

This is the first release of pgtcl-ng. (The version number is 1.5.0 for
continuity with previous implementations of this interface.) Highlights of
this release are:

  * From Gborg pgtcl project:
    1. Stand-alone Tcl Extension Architecture (TEA) build system
    2. New asynchronous query commands
    3. New: Get query results as lists
    4. New: pg_escape_string
  * New in Pgtcl-ng:
    5. Completed conversion to use Tcl-8 objects
    6. New: pg_transaction_status, check in-transaction status
    7. New: pg_parameter_status, get server parameter value
    8. New: pg_exec_prepared, execute prepared queries, binary-safe
    9. New: pg_notice_handler, change Notice and Warning handler
   10. New: Get extended error message field values
   11. New: Get extended column attribute information
   12. New: Test query result values for NULL
  * New reference manual
  * Windows binary release

There are also numerous fixes, include Large Object error handling, and a
rewritten COPY implementation which can now deal with records longer than
4096 bytes. (Bet you didn't know that limitation was there...) Please note:
Many of the new commands should be considered 'experimental' and possibly
subject to change.

More detailed changes can be found in the ChangeLog files. Please note,
however, that it is likely that not all changes between bundled PostgreSQL
libpgtcl, Gborg pgtcl, and Gborg pgtcl-ng have been recorded.

-----------------------------------------------------------------------------
