Skip to content

Releases: flightaware/Pgtcl

PgTcl 1.9

14 Jun 15:49
Compare
Choose a tag to compare
* 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.

* Removed arrVar variable and setting of it in Pg_result because it
  didn't do anything.

* 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.

PgTcl 1.8

14 Jun 15:50
Compare
Choose a tag to compare
* 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.

* 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 :)

* Add gen_update_from_array and perform_update_from_array to Postgres
  helper package.

* 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..

* 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.

PgTcl 1.7

14 Jun 15:52
Compare
Choose a tag to compare
* Make PostgreSQL helpers "res_dont_care" and "res_must_succeed"
  accept PGRES_TUPLES_OK as a sucessful result as well as
  PGRES_COMMAND_OK.

* Add new pg_result suboption -tupleArrayWithoutNulls.  It works like
  -tupleArray except if a field is null, it unsets the field from
  the array.

* 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.

* Add support for the lo_truncate function that truncates a large object
  to a given length.

* Version bump to 1.7.

* 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.

* 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

* added additional sub commands to dbinfo (version, protocol, param,
backendpid, socket)

* Updated autoconf build to Tcl Extension Architecture (TEA) 3.5

* 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

PgTcl 1.6

14 Jun 17:06
Compare
Choose a tag to compare
* 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.

* List -cmdTuples as one of the possible options when executing
  pg_result without arguments.

* 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

* Fixed memory leaks when connections-as-commands are used
  ($conn exec $statement, etc)

* added more documentation about the new capabilities

* took away pg::conninfo and pg::results, and made one command
  pg::dbinfo. Usage is pg::dbinfo connections and
  pg::dbinfo results $conn

* 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.

* Added commands to escape and unescape binary strings

* 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.

* 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.

* 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.

* Updated autoconf build to TEA 3.1 / autoconf 2.59

* Added import_sampledata_prepared_onetransaction.tcl to the tests

* 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

* 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.

* added delete proc for result handle cleanup

* added delete proc for connection handle cleanup

PgTcl 1.5

14 Jun 17:28
Compare
Choose a tag to compare

New options to pg_connect, -connhandle and -connlist

experimental -dict option in pg_result

Proper Tcl namespace support, in the ::pg namespace.

Connection handles and result handles are now executable commands in their own right, while maintaining compatible with their former usage as strictly handles.

Upgraded to TEA 3.1 compliant build.

Documentation overhauled and brought current with the code.

PgTcl 1.4

14 Jun 17:29
Compare
Choose a tag to compare

With version 1.4, Pgtcl has been internally overhauled and brought up to date with the latest Tcl C-interface technology, while maintaining nearly 100% compatibility with the pg_* Tcl interface provided by Pgtcl 1.3.

Just about every Tcl program that uses Pgtcl 1.3 will work without modification under Pgtcl 1.4.

Version 1.4 was something of a transitional release, as pgtcl moved out the of core and into its this distribution. Previously, for example, the Pgtcl documentation resided with the rest of the PostgreSQL documentation, and Pgtcl's source code accessed PostgreSQL's include files and libraries in a fraternal manner that had to be divorced and reworked to use the same APIs and build methods that any external application would use to build against PostgreSQL's libpq C interface library.

The Pgtcl documentation is now included with this release. As building the documentation requires a number of fairly major tools and packages, the release also includes the docs prebuilt in HTML and PDF format.

CHANGES

The main changes are:

  • All commands have now been converted to use Tcl 8-style Tcl objects.

    The result is a probable increase in performance in all routines, with
    potentially huge performance increases in pg_select and pg_execute when
    used with complex Tcl code bodies.

  • Also Tcl 7 is no longer supported. (Surely you're not still
    using it, anyway, right?)

  • A new asynchronous interface has been added

    Requests can be issued to the backend without waiting for the
    results, allowing for user interfaces to still work while
    database requests are being processed, etc.
    Also, requests can now be cancelled while they're in progress.

  • pg_* call arguments are now checked much more rigorously.

    Code previously using atoi() for integer conversions now
    uses Tcl_GetIntFromObj, etc.

    pg_* calls with too many arguments were often accepted without
    complaint. These now generate standard Tcl "wrong # args"
    messages, etc.

    Error reporting has been brought into more compliance with the
    Tcl way of doing things.

  • TEA-compliant build and install.

  • pg_exec now supports $-variable substitution. This is a new
    feature of Postgres 7.4 that is now supported in Pgtcl.
    You can now say:

    pg_exec $conn {select * from foo where id = $1 and user = $2} $id $user

    And the values following the SQL statement are substituted positionally
    for $1, $2, etc, in the statement.

  • pg_exec_prepared allows execution of prepared SQL statements.

  • pg_sendquery_prepared allows asynchronous execution of prepared
    SQL statements.

Some programs that might have been working properly but had certain
syntatically incorrect pg_* commands will now fail until fixed.

pg_result -assign and pg_result -assignbyidx used to return the array
name, which was superfluous because the array name was specified on the
command line. They now return nothing. *** POTENTIAL INCOMPATIBILITY ***