This is pgin.tcl/Changelog, a summary of changes in pgin.tcl
-----------------------------------------------------------------------------

* 2003-06-30 Version 1.5.0

Change/Fix: Add USERNAME to the list of variables checked for a default
database username. Now checks PGUSER, USER, LOGNAME, then USERNAME. This
is for Windows NT.

Fix to Tkpsql: Will now get focus properly on startup on Windows.

Bug fix: If a query result has duplicate column names, you can now access
all the values with pg_result -getTuple, -list, and -llist.

    Detailed explanation: If there are duplicate column names (from different
    tables) in a query result, you can not access the duplicates using any
    method which uses column-name-indexed arrays. For example:
       SELECT a.id, a.s, b.id, b.s FROM a, b WHERE a.id=b.id;
    The result will contain 4 columns, called "id", "s", "id", "s". The two
    "id" columns are equal, but the two "s" columns are likely not. If you use
    pg_select to iterate over this query result, your data array will contain
    data(id) and data(s) only; you can't get to the "a.s" value because "b.s"
    overwrote it.  This is the correct behavior, and affects pg_select,
    pg_execute, and pg_result -assign, -assignbyidx, and -tupleArray.

    But pg_result -getTuple, as well as the new pg_result -list and -llist,
    should be able to fetch all values including those for duplicate column
    names, because they return the results as a list, not an array indexed
    by column names. The bug was that pgin.tcl was storing values internally
    indexed by column name, and had already lost the duplicates, so it
    returned a list with the right number of values but the wrong values
    for the duplicates.

    The fix is to have pgin.tcl store the results indexed by column number,
    instead of name, just like libpq does.

    Note you should generally avoid this issue anyway by assigning
    column aliases to duplicate columns and computed columns:
       SELECT a.id ,a.s as a_s, b.id ,b.s as b_s FROM a, b WHERE a.id=b.id;

Related change: Attribute names are stored in a list, rather than separate
array elements, in the result structure; similar for their type OIDs,
sizes, and size modifiers.

Related change: Used more consistent internal variable names, especially for
result value iteration which is duplicated in several places.

Finish new COPY I/O routines needed for compatibility with future version
of pgin.tcl which will talk the new PostgreSQL "v3 FE/BE protocol".

Removed README.PGAccess and updated README remarks on PGAccess.


* 2003-06-27 Version 1.4.4 [Unreleased]
Minor internal optimizations: check result structure, binary scan.
Begin work on new COPY I/O routines which will be needed for future
"PostgreSQL Version 3 Protocol" support.


* 2003-04-26 Version 1.4.3 [Unreleased]
Fixes for empty query: Fix bad variable error on receipt of EmptyQuery
message; also now properly sets result status to PGRES_EMPTY_QUERY on
EmptyQuery.

Fix: pg_execute now handles empty query, COPY FROM, and COPY TO correctly.

Fix: pg_result -cmdTuples returns "", not 0, if the SQL was not Insert,
Update, or Delete. This is the behavior I expect when -cmdTuples is added
to libpgtcl and documented, because it matches the behavior of libpq.


* 2003-04-13 Version 1.4.2 [Unreleased]
Tried to add byte, short, and bigint types to fast-path function call interface,
but it didn't work, and after more examination it looks like only integer32
and string/buffer arguments are supported by libpq anyway, so removed the code.
Changed this call to build and output the message with one puts.


* 2003-04-12 Version 1.4.1 [Unreleased]
Improved fast-path function call interface to allow calling overloaded
functions. Just put the arg type list after the function name.


* 2003-03-29 Version 1.4.0 [Unreleased]
Add pg_escape_string as found in libpgtcl CVS on gborg.
(Note: This now needs Tcl 8.1. But that is not to imply that this package
would work on Tcl 8.0.x before, since I'm testing only on Tcl 8.3.)


* 2003-02-13 Version 1.3.9 - Released to gborg
Catch unknown parameter in conninfo, and clean up error messages there.
Fix: typo in pg_callfn common message handling.


* 2003-02-09 Version 1.3.8 [Unreleased]
New fast-path function call command wrappers outside of namespace.
Renamed version variable to pgtcl::version

* 2003-02-03 Version 1.3.7 [Unreleased]
First implementation of COPY IN/OUT, not compatible (but close) to libpgtcl.
Added: pg_endcopy.

* 2003-02-01 Version 1.3.6 [Unreleased]
Add pg_configure (instead of setting namespace variables from outside).

* 2003-01-24 Version 1.3.5 [Unreleased]
Changed calling sequence for fast-path function call callfn so caller gives
type (Int, String, or byte string) rather than length.

* 2003-01-01 Version 1.3.4 [Unreleased]
Added handling of BinaryRow message. This might now work with Binary
Cursors; note however that libpgtcl does not work with Binary Cursors.

* 2002-12-28 Version 1.3.3 [Unreleased]
Changed fast-path function call to lookup and cache function OIDs;
this simpifies the large-object calls.

* 2002-11-16 Version 1.3.2 [Unreleased]
Added pg_result -list, and pg_result -llist. These are in the beta-released
libpgtcl, but are not in the production libpgtcl included with PostgreSQL
releases.

* 2002-11-16 Version 1.3.1 [Unreleased]
Add option to control what is returned for NULL. This feature is not
available in libpgtcl.
Rewrote connection info (conninfo) parsing to properly handle quoting
and escaping of parameter values.

* 2002-11-09 Version 1.3.0 [Unreleased]
Renamed.
Added use of namespace for internal variables and procedures.
Minor cleanup to MD5 code.

* 2002-11-04 Version 1.2.1 [Unreleased]
Fixed args to pg_listen.
Fixed pg_exectute when called with no proc: store 1st row, not last.

* 2002-11-03 [Unreleased]
Add missing .headers, .numcols, .tupno to array in pg_select.
Unset array var at end of pg_select.
(Both of these for compat. with real pgtcl)

* 2002-11-03 [Unreleased]
Add pg_execute

* 2002-11-03 [Unreleased]
Adds support for MD5 authentication; previously only plain-text password
authentication was supported.  MD5 authentication is available in
PostgreSQL-7.2 and higher, and is the preferred authentication method.

* 2002-11-02 [Unreleased]
Fixed 2 error messages to match libpgtcl.

* 2002-11-02 [Unreleased]
Fixes: pg_result -oid and -cmdTuples return 0 if the query was not an
INSERT, or INSERT/DELETE/UPDATE respectively. (This was an undocumented
change in libpgtcl.)

* 2001-05-27 [Unreleased]
Increase read/write size in pg_lo_import/export from 1024 to 32768 to
solve problem with poor performance.

* 2001-05-26 [Unreleased]
Added hostaddr to conninfo connection string (same as "host").

* 2001-05-19 Version 1.2.0 [Unreleased]
Adds support for large object calls.
Fix: no extra newline after notice messages.

* 2000-11-11 [Unreleased]
Added pg_result -cmdTuples to return number of inserted, updated, or
deleted tuples. (Extension over libpgtcl.)

* 2000-11-11 [Unreleased]
Code cleanup, messages cleanup, fix bug if pg_select returns 0 tuples

* 2000-10-21 [Unreleased]
Add notice, notify, listen

* 2000-10-15 [Unreleased]
Initial RCS revision

* 2000-07-06 [Unreleased]
Fixes for Tcl8.3.1: Tcl behaves differently when reading null byte at the
end of a string. The fix is backward-compatible (works in Tcl 8.0.5 too).

* 1999-07-22 [Unreleased]
Bug fix: bad error return in pg_select.

* 1998-12-28 [Unreleased]
Gave up on copy in/out.

* 1998-12-20 [Unreleased]
Changes for PostgreSQL 6.4 to speak Backend Protocol v2.

* 1998-12-18 [Unreleased]
Complete basic functions.
