2017-06-21 Peter da Silva * Integrate sqlite bridge with "pg_sqlite" command. * Documentation updates for 2.2.x * Update version to 2.2.0 2017-04-25 Peter da Silva * Update minor version to 2.1.1 * Documentation updates for 2.1.x * Remove dead macro from configure.in (change in TEA) 2016-10-26 Peter da Silva * Increment version to v2.1.0 * Add -params and -paramarray to pg_select * Add -paramarray to pg_exec and pg_sendquery * Update documentation to match. 2016-07-06 Jeff Lawson * Increment to 2.0.1 * Update pre-generated pdf documentation. * Update Makefile target to install manpages 2016-07-06 Pietro Cerutti * Avoid installing .h file only needed during build. 2016-07-06 Peter da Silva * Fix some manpage formatting glitches * Add more test cases 2016-06-20 Jeff Lawson * Released 2.0.0 2016-06-20 Peter da Silva * Add man-page generation using docbook2man 2016-06-16 Jeff Lawson * Change functionality of pg_quote regarding NULL values. pg_quote will now only return "NULL" if the new "-null" flag is explicitly specified by the callerd, regardless of whether a database handle is also specified (#6). 2016-06-16 Karl Lehenbauer, Jeff Lawson and Peter da Silva * Add a -rowbyrow option to pg_select that will return results through libpq a row at a time via PQsetSingleRowMode rather letting libpq wait for all the rows to be returned first. (Caveats at https://www.postgresql.org/docs/current/static/libpq-single-row-mode.html should be observed.) 2016-06-16 Jeff Lawson * Explicitly initialize extra Tcl_ChannelType fields. * Make pg_select handle exit conditions more carefully. * Fix mislabelled error message text. * Regenerate HTML documentation. 2016-06-16 Peter da Silva * Add ?connection? option for pg_quote and flags for pg_select. * Modify Makefile for docs to only generate HTML by default. * Update documentation to reflect changes and updates. 2016-06-15 Peter da Silva * Fixed docbook errors in libpgtcl.sgml * Deleted html directory to make "make" work. 2016-06-15 Karl Lehenbauer * Make -async processing for pg_connect use C-level Tcl boolean handling. 2016-06-15 Jeff Lawson * Unset array in pg_select at start of each loop to avoid elements lingering over (#4). * Remove unused variable. 2016-06-14 Jeff Lawson * Fix possible segfault in pg_select if you unset the array variable inside of the code body. * Document the pg_select refcount fix. * Whitespace cleanup. * Remove changelog from 1.4 era; update some text. * Update Tcl version in the README. * Avoid error during docs part of "make install". * Add SGML dependency to dohtml target. 2015-08-26 Karl Lehenbauer * Install helper package sc_postgres by default. * Minor package README improvements. * Helper integration. * Regenerate "configure" script. 2015-08-23 Karl Lehenbauer * Doc and usage message additions. 2015-08-22 Karl Lehenbauer * Simplify most Tcl_GetStringFromObj calls. * Remove legacy version handling, requiring Tcl 8.4 or above. (Tcl 8.4 has been out for ten years or so, so it's OK.) * Remove ifdef compatibility for long-present stuff such as lo_truncate that has been in PostgreSQL libpq since version 8.3 (released in 2008). 2015-08-18 Karl Lehenbauer * pg_result $res -foreach array code - iterate over tuples in a result handle. * Fix compiler warnings. 2015-08-08 Karl Lehenbauer * Update build to Tcl Extension Architecture (TEA) 3.9 * shared library now builds without a reference to libtcl*.so since it uses stubs to access that library. * "make distclean" will now remove autom4te.cache * Add .gitignore to suppress untracked files warning 2015-04-21 Karl Lehenbauer * genericize tclsh invocation. 2015-03-04 Karl Lehenbauer * clean up compiler warnings. 2014-09-15 Karl Lehenbauer * Force UTC in helpers' clock_to_sql_time. 2014-07-07 Karl Lehenbauer * Force UTC on timestamp without timezone conversions. 2013-06-14 Karl Lehenbauer * Fix gen_update_from_array to work correctly with multiple key fields. 2013-05-08 Karl Lehenbauer * Update .gitignore to ignore *.o, *.so, Makefile, pkgIndex.tcl, etc. 2012-10-10 David McNett * Migrate README file to a github-friendly markdown format. * Migrate from Tcl 8.4 to Tcl 8.5. 2012-09-21 Karl Lehenbauer * Update the postgresql database schema comparator. 2012-09-11 Karl Lehenbauer * Add subcommands for direct execution of connection handles for conndefaults, set_single_row_mode, is_busy, blocking and cancel_request. * Make "make distclean" get rid of more autoconf work product. * Add -nodotfields option to pg_select. If set it will inhibit the creation of the .tupno, .numcols and .headers fields in pg_select results. * Added new command, pg_set_single_row_mode aka ::pg::set_single_row_mode to enable retrieving query results row-by-row. * Make "make distclean" get rid of more autoconf work product. * Clean up compiler warnings. * Update README.freebsd. 2012-06-18 Karl Lehenbauer * Add new -withoutnulls option to pg_select, if set will remove null fields from the row result array. * Reference variable name as a string, not an object, when invoking Tcl_UnsetVar2. 2012-06-04 Karl Lehenbauer * Change dbinfo option "pass" to "password". Fix crash in pg_listen. 2012-06-02 Karl Lehenbauer * Add new pg_dbinfo options "dbname", "user", "pass", "host", "port", "options", "status", "transaction_status", "error_message", "needs_password", "used_password", "used_ssl" to provide Tcl access to libpq connection parameter values established at connection time. * Fixed bug where pg_dbinfo would get a segmentation violation if passed an invalid connection handle. * Version bump to 1.9. 2011-02-15 Karl Lehenbauer * Removed arrVar variable and setting of it in Pg_result because it didn't do anything. 2010-07-01 Brett Schwarz * Added result callback for async queries via pg_sql. Based on code from Miguel Sofer. I had this code laying around and thought I had already committed, but turned out no. 2010-04-14 Karl Lehenbauer * Added new option to pg_dbinfo, "sql_count", returns the number of calls to pg_exec, pg_exec_prepared, pg_sendquery, pg_sendquery_prepared, and pg_select since the database connection was established. * Fixed a bug in dbinfo where a missing database connection argument could result in a coredump. * Version bump to 1.8. 2010-04-12 Brett Schwarz * Added Tcl 8.6 compatability by gettting rid of errorLine direct struct access and using Tcl_GetErrorLine, introduced in 8.6. Also added define for Tcl versions less than 8.6 so they can use the Tcl_GetErrorLine call. I ripped this off from the aolserver fix :) 2009-09-16 Karl Lehenbauer * Add gen_update_from_array and perform_update_from_array to Postgres helper package. 2009-07-07 Karl Lehenbauer * pg_select was not checking returns from Tcl_ObjSetVar2 and friends. The problem was that if the pg_select array already existed as a scalar variable, no error was returned to denote this, and it caused a coredump in Tcl 8.5. This has now been fixed. * In pg_select code, correct memory allocation for columnNameObjs to use the size of a pointer to Tcl_Obj times the number of columns, rather than the size of a Tcl_Obj times the number of columns.. 2009-06-30 Karl Lehenbauer * Fixed bug in "pgresult -assign" that could cuase a Tcl panic by attempting to set a value into a shared Tcl object. * libpq's PQfname can return NULL if the column requested is out of range. We have seen it return NULL when the column is in range, so instead of dumping core, we treat such a return as a Tcl error. 2009-04-06 Karl Lehenbauer * Pgtcl 1.7 released. 2009-02-26 Karl Lehenbauer * Make PostgreSQL helpers "res_dont_care" and "res_must_succeed" accept PGRES_TUPLES_OK as a sucessful result as well as PGRES_COMMAND_OK. 2008-05-24 Karl Lehenbauer * Add new pg_result suboption -tupleArrayWithoutNulls. It works like -tupleArray except if a field is null, it unsets the field from the array. 2008-05-23 Karl Lehenbauer * Add "escape_bytea" and "unescape_bytea" to the methods that can be invoked from $conn. * Extend pg_escape_bytea to allow a connection handle to be specified. If specified, libpq's PQescapeByteaConn is used rather than deprecated PQescapeBytea, which can return incorrect results since it can't determine whether standard-conforming strings are enabled. If the "$conn escape_bytea ..." method is used, the connection-handle version is automatically used. * Detect if lo_truncate is available in libpq or not and, if not, return an error if it is attempted. 2008-05-20 Karl Lehenbauer * Add support for the lo_truncate function that truncates a large object to a given length. * Version bump to 1.7. 2007-12-14 Karl Lehenbauer * Update autoconf build to Tcl Extension Architecture (TEA) 3.6 * Extend pg_quote to allow a connection handle to be specified. If the connection handle is specified and the string matches the null string, returns "NULL" (without quotes). If not, returns the string quoted for inclusion in SQL commands. * pg_quote can be invoked as a method of the connection handle as well. For instance, "$db quote $string". * Removed unused variables and silence compiler warnings with casting. * Added "internal_position" and "internal_query" to the error options. 2007-02-08 Brett Schwarz * Added support for async connections. Note that you will have to use [after] command to find the result of the connection. Callbacks won't work, since the sock isn't established yet 2007-01-24 Brett Schwarz * added additional sub commands to dbinfo (version, protocol, param, backendpid, socket) 2006-07-05 Karl Lehenbauer * Updated autoconf build to Tcl Extension Architecture (TEA) 3.5 2006-01-01 Brett Schwarz * changed the commands that handle params, such that if a value is NULL then the lib will change the paramValues value to '\0' so that the backend will insert a NULL correctly 2005-11-27 Karl Lehenbauer * Bumped version number to 1.6 * Add pg_null_value_string, ::pg::null_value_string and "$conn null_value_string" to get and set a special string value that will be returned for fields containing null values from queries. pg_select and pg_execute use this value for null values. If not set, they use the traditional empty string. pg_exec, pg_exec_prepared, pg_sendquery and pg_sendquery_prepared use this value as well. However, it can be overridden or replaced for one specific result using "pg_result $result -null_value_string NULL", etc, or by executing the result handle, as in "$result -null_value_string NULL" Updated documentation and regenerated HTML and PDF files. 2005-11-09 Karl Lehenbauer * List -cmdTuples as one of the possible options when executing pg_result without arguments. 2005-07-18 Karl Lehenbauer * Made pggrok database introspection code much more useful -- routines for finding out data about fields and indexes in a table now load on array with data about each field (index) and execute a code body on it, rather than punting with a call to parray 2005-07-01 Karl Lehenbauer * Fixed memory leaks when connections-as-commands are used ($conn exec $statement, etc) 2005-04-16 Brett Schwarz * added more documentation about the new capabilities 2005-02-25 Brett Schwarz * took away pg::conninfo and pg::results, and made one command pg::dbinfo. Usage is pg::dbinfo connections and pg::dbinfo results $conn 2004-11-30 Karl Lehenbauer * Document pg_exec_prepared, pg_results, and pg_sendquery_prepared. * Document pg_exec's ability to take optional arguments for $-substitution in PostgreSQL 7.4+. * Documented pg_getresult and pg_result -error suboptions. * Pasted connect string options from the libpq manual rather than simply referring Pgtcl users to the libpq manual. * Regenerated pdf and html documentation. 2004-11-29 Brett Schwarz * Added commands to escape and unescape binary strings 2004-11-29 Karl Lehenbauer * Added library of useful PostreSQL helper functions to the playpen. * Added dbobjects PostgreSQL/Itcl-object interface package to the playpen. * Added pggrok code to introspect into Postgres databases to the playpen. 2004-11-23 Karl Lehenbauer * Simplify result object processing * Fixed bug in Pg_cancelrequest where the error message would not be returned. * Remove unused variables. * Silence compiler warnings about a fall-through (that couldn't be reached) that would cause a function declared to return something to not return anything and about a possibly uninitialized variable. 2004-11-22 Karl Lehenbauer * Created playpen directory where interesting things that are not yet ready for prime time can be examined and messed with. Added code for turning OIDs returned by pg_result -lAttributes into data type names. 2004-11-19 Karl Lehenbauer * Updated autoconf build to TEA 3.1 / autoconf 2.59 * Added import_sampledata_prepared_onetransaction.tcl to the tests 2004-11-17 Karl Lehenbauer * minor optimization in connections-as-commands and results-as-commands where we don't copy and then swap, we copy it the way we want it to end up (first and second elements of objv reversed). * connections-as-commands and results-as-commands now error out when called with no arguments 2004-11-16 Karl Lehenbauer * libpgtcl will again build with versions of Tcl < 8.5 thanks to a little extra checking for HAVETCL_NEWDICTOBJ * Fixed several calls to Tcl_AppendStringsToObj whose arguments were terminated with -1 instead of NULL, eliminating several segmentation violations that could occur while preparing error messages. * Removed spurious newline at the start of the error message when the query result handle passed to pg_result is invalid. 2004-11-05 Brett Schwarz * added delete proc for result handle cleanup 2004-11-02 Brett Schwarz * added delete proc for connection handle cleanup 2004-09-20 Brett Schwarz * added preliminary support for dicts in pg_result. Need to have Tcl 8.5 or the dicts package extension. Need to set HAVETCL_NEWDICTOBJ manually for now. 2004-08-23 Brett Schwarz * added tcltest script of testing pgtcl. 2004-08-21 Brett Schwarz * Made the result handle into a command, and added associated command dispatcher. 2004-08-18 Brett Schwarz * Added another way to specify the connection string to pg::connect: pg::connect -connlist {host myhost port myport ...}. This is similiar to -conninfo, except that the arg is a key value list. * Added -connhandle option to pg::connect to specify the connection handle name. If not specified, then connection handle name is derived by pgtcl (as before). 2004-08-16 Brett Schwarz * added Pg_results (pg::results, pg_results) command that returns the result handles for a particular connection 2004-08-15 Brett Schwarz * Added new command pg::conninfo that returns a list of PG connection handles 2004-07-02 Brett Schwarz * added basic capability to use the connection handle as a command * since connection handle can be a command now, I made the returned handle namespace qualified, with respect to the calling namespace 2004-06-29 Brett Schwarz * Added proper Tcl namespace support (i.e. ::pg::connect) 2004-06-28 Karl Lehenbauer * Version 1.4 released 2004-06-22 Karl Lehenbauer * Added new optional subidentifiers to pg_result $resultID -error. You can specify one of "severity", "sqlstate", "primary", "detail", "hint", "position", "context", "file", "line", or "function" to get the severity (ERROR, FATAL, PANIC, WARNING, NOTICE, DEBUG, INFO, or LOG or a localized translation of one of these), the SQLSTATE code (see Appendix A of the Postgres manual), the primary human-readable error message, the optional secondary error message carrying more detail about the problem, the hint, an optional suggestion about what to do, the position, an error cursor position as an index into the original statement string starting from 1 (in characters, not bytes), the context, the source file where the error was reported, the line number of the source code where the error was reported, and the name of the source code function reporting the error, respectively. With newer versions of Postgres, $-variable substitution is now supported in pg_sendquery as it is in pg_exec. * Added a new function, pg_sendquery_prepared, that supports asynchronous invocation of prepared statements. 2004-06-21 Karl Lehenbauer * Added parameter support to the asynchronous pg_sendquery function. With newer versions of Postgres, $-variable substitution is now supported in pg_sendquery as it is in pg_exec. * Added a new function, pg_sendquery_prepared, that supports asynchronous invocation of prepared statements. 2004-05-26 Karl Lehenbauer * Changed configure script to use pg_config to find the path to PostgreSQL includes and libraries. * Altered libpgtcl to no longer require access to internal PostgreSQL include files. * Changed configure script to determine whether or not PostgreSQL 7.4+ functions PQexecParams and PQexecPrepared are available or not. 2004-05-21 Karl Lehenbauer * Add pg_exec_prepared to execute pre-prepared SQL statements with parameters. 2004-04-23 Karl Lehenbauer * Add pg_quote function to escape strings. It adds the outside quotes, too. 2004-04-14 Karl Lehenbauer * Modify pg_exec to support $-variable substitution for PostgreSQL 7.4 and above (protocol >= 3). For example, you can now do stuff like pg_exec $conn {select * from foo where field1 = $1} $value 2004-02-14 Brett Schwarz * Updated with the fixes that went into the -core libpgtcl release * Also added fix for WSAStartup posted by anonymous on the bug list 2003-01-14 Brett Schwarz * added -cmdTuples to pg_result (code submitted by Artur Trzewik) 2002-11-19 Brett Schwarz * Improved the performance of -list a little bit 2002-11-15 Karl Lehenbauer * Tagged for 1.4b3 * Fix pg_listen. (callback string wasn't properly terminated) Also made slight performance improvements in pg_listen. 2002-11-15 Brett Schwarz * Cleanup memory leaks in pg_result. * Fixed bug in pg_result -assignbyidx 2002-11-15 Karl Lehenbauer * Convert all the "#ifdef TCL_ARRAYS" where tcl_value was called if defined and not called if not defined to always "call" tcl_value. In the case where TCL_ARRAYS isn't defined, tcl_value is now defined as a macro that returns whatever was given to it, making it a no-op. This change allows the code to be compiled with TCL_MEM_DEBUG enabled to look for memory leaks. 2002-11-06 Karl Lehenbauer * Tagged for 1.4b2 * Create the libpgtcl shared library in a way where it can find both the Postgres shared library it needs (libpq) and the Tcl shared library it needs (libtcl). 2002-11-05 Brett Schwarz * added -list and -llist options to pg_result to return the results as a list and list of lists 2002-11-05 Karl Lehenbauer Started the ChangeLog.