1This is the pgtcl-ng Source Release NEWS file
2Last updated for pgtclng-2.1.1 on 2014-09-12
3The project home page is: http://sourceforge.net/projects/pgtclng/
4-----------------------------------------------------------------------------
5
6* 2014-09-12    pgtcl-ng 2.1.1 Released
7
8This version contains 1 bug fix.
9
10Fixed Bug #8 "pg_execute returns continue":
11
12If the command body for pg_execute used "continue" in the last loop
13iteration, pg_execute returned TCL_CONTINUE instead of TCL_OK which would
14cause a Tcl error. This has now been fixed.
15
16
17* 2013-10-07    pgtcl-ng 2.1.0 Released
18
19This version adds 5 new commands, new pg_connect options, and new error
20field codes for pg_result. The following 4 Feature Requests are implemented
21in this release:
22
23
24Feature request #5 "Add 64-bit large object support":
25
26+ New commands pg_lo_lseek64, pg_lo_tell64, and pg_lo_truncate64 use Tcl
27  Wide Integers (64-bit) for offsets or lengths. These are only available
28  when pgtclng was built with a PostgreSQL-9.3.0 or higher libpq, and only
29  work when connected to a PostgreSQL-9.3.0 or higher server.
30
31
32Feature request #6 "Add new forms for connection options":
33
34+ Added "pg_connect -connlist {list}" to specify the connection options
35  as a Tcl list.  (The syntax is from Flightaware Pgtcl, but the
36  implementation is new, and not completely compatible.) The advantage of
37  using this form is that it does not require quoting or escaping, especially
38  for the password.
39
40+ pg_connect -conninfo now accepts a PostgreSQL URI for a connection string,
41  as described in the PostgreSQL manual, for example:
42     pg_connect -conninfo postgresql://myuser:secretd@host.example.com/dbname
43  This only works when pgtclng was built with a PostgreSQL-9.2.0 or higher
44  libpq (independent of the server version).
45
46
47Feature request #7 "Support new error message fields":
48
49+ pg_result -error and -errorField now support 5 new field codes.  These
50  provide access to the schema, table, column, and constraint name specific
51  to the error. To get message data using these error fields, pgtclng must
52  be built with a PostgreSQL-9.3.0 or higher libpq, and connected to a
53  PostgreSQL-9.3.0 or higher server.
54
55  Single-character codes for error message fields are now case sensitive.
56  This is not compatible with previous releases. See Compatibility Warning
57  below.
58
59
60Feature request #8 "Support 2 new libpq escape functions":
61
62+ New commands pg_escape_literal, which is an alternative to pg_quote, and
63  pg_escape_identifier, for escaping SQL identifiers.
64
65
66Compatibility Warning:
67
68PostgreSQL-9.2.0 started using lower case letters as the value of the new
69PG_DIAG_* symbols which are used to select error message fields to retrieve.
70This conflicts with case insensitive field codes in previous versions of
71pgtclng [pg_result -errorField] and [pg_result -error] commands.
72
73Starting with pgtclng-2.1.0, field code single-character abbreviations are now
74case sensitive. This will require changes to scripts, if they used
75single-character lower case letters as field codes.  The full field code names
76remain case insensitive.
77
78For example:
79  Both of these worked before, and continue to work:
80       pg_result $res -errorField SEVERITY
81       pg_result $res -errorField severity
82  The single-character code for SEVERITY is 'S'. Starting with this release,
83  an upper case 'S' must be used, as 's' is now used for SCHEMA_NAME.
84       pg_result $res -errorField s
85          Returned the error severity in previous releases.
86          Returns the error object schema name in this release.
87
88-----------------------------------------------------------------------------
89
90* 2011-09-18    pgtcl-ng 2.0.0 Released
91
92This release includes two new commands and one new command option. It also
93includes a fix for building with Tcl-8.6 (currently in beta).
94
95This is the first release after rehosting on Sourceforge.net. Documentation
96and information files have been updated accordingly.
97
98Feature request #3408919 "Access to server PID, notification PID, and
99        server version":
100+ New command pg_backend_pid to get the backend process ID.
101+ New command pg_server_version to get the server version as an intger.
102+ New -pid option to pg_listen, to pass the notifying client's backend
103  process ID to the notification callback.
104
105Fixed bug #3405928, building fails with Tcl-8.6 beta, reported by Zbigniew:
106Pgtcl-ng will now compile with Tcl-8.6beta, avoiding access to the errorLine
107structure element which is now hidden.  The correct access method is detected
108at compile time. However, if Pgtcl-ng is compiled using stubs with Tcl-8.6,
109and then run under Tcl-8.5 or older, it will crash. This is because the
110new function used at 8.6 to access the structure member does not exist in
111older releases.
112
113
114Note: Despite the version number ending in ".0.0", Pgtclng-2.0.0 is not
115substantially different from the previous release 1.9.0, and there should
116be no incompatibilities. (Changes were made to an internal data structure,
117but a major factor in not using "1.10.0" instead is the way release packages
118are sorted by name.)
119
120
121* 2011-03-21    pgtcl-ng 1.9.0 Released
122
123This release adds one new feature: pg_result $r -dict, which returns the
124query result as a Tcl dictionary. The idea for this feature came from the
125pgfoundry 'pgtcl' project. This feature requires Tcl-8.5 or higher.
126
127
128* 2010-10-10    pgtcl-ng 1.8.0 Released
129
130This release has one new feature for PostgreSQL-9.0.0. Notification
131messages can now include a payload, which is passed to the notification
132listener callback proc. For example:
133Given (in one session):
134    pg_listen $db my_channel my_callback_proc
135
136Then (possibly in another session):
137    SQL> NOTIFY my_channel, 'the payload'
138This will result in execution of:  my_callback_proc "the payload" in the
139original session.
140
141And:
142       SQL> NOTIFY my_channel
143 or:   SQL> NOTIFY my_channel, ''
144This will result in execution of:  my_callback_proc
145in the original session.
146
147Compatibility Warning:
148    This applies only if you use pg_listen to set up a notification listener
149    callback procedure.
150
151    Your listener callback should be defined to accept an optional argument
152    for the payload, for example:   proc listen_handler {{payload ""}} { ... }
153    Starting with version 1.8.0, pgtclng will pass a payload argument to the
154    handler if a non-empty payload is provided in the SQL command. If an empty
155    payload is provided, or no payload (including any usage with a PostgreSQL
156    server older than 9.0.0), pgtclng will not supply the argument to the
157    handler. This behavior was chosen to improve compatibility with older
158    scripts that would throw an error if provided an unexpected argument.
159
160    If you do not update your listener callback to have an optional argument,
161    and you never include a payload in the notification SQL, your script will
162    not have any problems. However, note that anyone who can connect to the
163    database can send a notification (if they know the 'channel' name used
164    in the pg_listen command), and they can include a payload. If your listener
165    callback does not expect a payload argument, it will throw a background
166    error (which may or may not terminate the script) if it receives such a
167    payload argument.
168
169
170For Windows, only MinGW building is now supported and tested. Borland BCC
171building of pgtcl-ng probably still works, but is no longer tested. Refer
172to the Windows binary release of pgtcl-ng for more information.
173
174
175* 2010-07-14    pgtcl-ng 1.7.2 Released
176
177This release now supports building on Windows with MinGW, in addition to
178Borland C++ Building (BCC). The binary release for Windows now includes
179DLLs built with BCC and with MinGW. (In future releases, the BCC-built DLLs
180may be dropped, leaving just MinGW.)
181
182There is one bug fix for a failure to build and run pgtcl-ng on PostgreSQL
183versions before 8.2. It has no impact for PostgreSQL-8.2 and higher.
184
185
186* 2009-11-25    pgtcl-ng 1.7.1 Released
187
188The release now supports building a Tcl stubs-enabled module on Windows,
189which means the same compiled module will load into different Tcl versions.
190
191There is one minor bug fix to pg_encrypt_password. An error was not
192properly detected when the command was passed an invalid, empty username.
193
194
195* 2009-09-11    pgtcl-ng 1.7.0 Released
196
197This release adds some commands and options to "catch up" to features added
198to the PostgreSQL libpq library.
199
200This version adds four new commands:
201+ pg_encrypt_password to encrypt a password for certain SQL commands
202+ pg_lo_truncate to truncate a large object
203+ pg_describe_cursor to return information about a cursor (portal)
204+ pg_describe_prepared to return information about a prepared statement.
205
206This version adds two options to pg_result, for use with
207pg_describe_prepared to return information about a prepared statement:
208+ pg_result -numParams returns the number of parameters
209+ pg_result -paramTypes returns the parameter type OIDs.
210
211In this release, pg_escape_string, pg_quote, and pg_escape_bytea
212accept an optional connection parameter. This allows use of
213connection-specific information to properly handle string escaping.
214
215This release also contains fixes to error handling in pg_select.
216
217
218* 2007-12-26    pgtcl-ng 1.6.2 Released
219
220This release fixes a character set encoding problem on Windows only. When
221communicating with a non-UTF8 database, character set translation was not
222working because the method pgtcl-ng used to set the client encoding
223(PGCLIENTENCODING environment variable) was not working. This release fixes
224the problem by using a different way to set the client encoding
225(PQsetEncoding call). This problem only affected Windows, and this was
226probably a long-standing issue (not introduced in a recent release).
227
228* 2007-12-25    pgtcl-ng 1.6.1 Released
229
230This release contains important fixes for the new Tcl-8.5.0 release.
231Versions of pgtcl-ng before this will crash with "... called with
232shared object" when built against Tcl-8.5. Pgtcl-ng 1.6.1 will also build
233and run with Tcl-8.4.x.
234
235
236* 2007-01-15    pgtcl-ng 1.6.0 Released
237
238This release contains the new features described in "pgtcl-ng 1.6.0 Beta
239version" below, plus the following:
240
241New command: pg_sendquery_prepared
242This executes a pre-prepared query (like pg_exec_prepared), but is
243asynchronous like pg_sendquery.
244
245New command: pg_sendquery_params
246This executes a parameterized query (like pg_exec_params), but is
247asynchronous like pg_sendquery. Note: pg_sendquery itself supports
248parameterized queries, but only for untyped TEXT parameters.
249pg_sendquery_params supports binary parameters and binary return type.
250
251
252* 2006-12-13    pgtcl-ng 1.6.0 Beta version
253
254This release contains two new features for asynchronous queries.
255
2561. Asynchronous parameterized queries:
257
258The command pg_sendquery now accepts optional arguments which are used
259as parameter substitutions in the SQL query. For example:
260     pg_sendquery $connection "SELECT * FROM mytable WHERE i=\$1" $var
261The parameter value ($var) is sent to the PostgreSQL backend along with the
262query as a parameterized query. This works like pg_exec with parameters,
263but for asynchronous queries.  This idea was copied from the Pgtcl project,
264by Brett Schwarz and Karl Lehenbauer.
265
266
2672. Event-driven asynchronous query results:
268
269A command can be registered to execute when a result is ready from an
270asynchronous query. This provides event-driven asynchronous queries.
271(Before this was added, the choice was to busy-wait or block.)
272
273The command to register a result callback is:
274     pg_result_callback $conn ?callbackCommand?
275If the callback command is provided, a new result callback is established.
276Only one result callback can be active at any time.
277Synchronous query commands are not allowed when a result callback is in place.
278A result callback will be removed if any of the following occurs:
279  (a) The callback command executes because the result is ready.
280  (b) pg_getresult is called (which blocks until a result is ready).
281  (c) pg_cancelrequest is called (canceling the asynchronous query).
282  (d) The connection is closed.
283  (e) pg_result_callback is called. (Without a callbackCommand, to
284      just remove the callback, or with a callbackCommand to replace the
285      callback.)
286To use event-driven asynchronous query results, first establish the
287callback, then issue the query with pg_sendquery.
288
289Suggested by Kyle Bateman (kyleb), with the initial implementation designed
290and written by Miguel Sofer (msofer).
291
292
293* 2006-08-30    pgtcl-ng 1.5.3 Released
294
295This is the first release on pgfoundry. (Prior releases were on gborg.)
296This release also contains the following changes:
297   1. Bug fix for character set encoding during COPY FROM/TO
298   2. Replaced build system using newer TEA 3.5. Other build fixes.
299
300
301* 2004-11-07    pgtcl-ng 1.5.2 Released
302
303This is a minor release. There are two new commands suggested by levanj:
304   1.  New command pg_escape_bytea escapes a binary string for
305       use in an SQL statement for a BYTEA type column.
306   2.  New command pg_unescape_bytea un-escapes a BYTEA column value
307       from a query result and returns a Tcl binary string.
308
309For better compatibility with Gborg pgtcl, which implemented the -errorField
310feature of pgtcl-ng/pgin.tcl in a different way:
311   3.  The error code field name is now optional to pg_result -errorField,
312       and can also be supplied to pg_result -error. This means the two
313       subcommands are now identical. With no error code field name argument,
314       they return the default message form. Also, extended the list of
315       valid field code names to be case insensitive and include the
316       different field code names used in Gborg pgtcl,
317
318
319* 2004-06-07    pgtcl-ng 1.5.1 Released
320
321This is the second release of pgtcl-ng with these changes:
322   1.  New command option: pg_result $res -cmdStatus
323       Returns the command completion tag, e.g. "UPDATE 4".
324       (Suggested by Jerry.Levan -at- EKU.EDU)
325   2.  If EXTRA_LIBS is defined in the environment when "configure" runs,
326       its value will be appended to the link line. This is for some systems
327       where dependent libraries must be explicitly specified.
328       (Suggested by Jerry.Levan -at- EKU.EDU)
329   3.  New command: pg_quote to return quoted escaped string. This was recently
330       added to Gborg pgtcl CVS, replacing pg_escape_string, but pgtcl-ng
331       will continue to support both.
332   4.  Fix pg_execute error handling to allow arbitrary return
333       codes from the script it executes, same as pg_select.
334   5.  New command: pg_exec_params to execute parameterized query, binary safe.
335   6.  pg_exec can take extra arguments which will substitute for
336       placeholders in the SQL. This is not binary safe; use pg_exec_prepared
337       or pg_exec_params for binary parameters or binary results.
338       (Idea from Gborg pgtcl CVS - karl.)
339
340
341* 2004-02-28    pgtcl-ng 1.5.0 Released
342
343This is the first release of pgtcl-ng. (The version number is 1.5.0 for
344continuity with previous implementations of this interface.) Highlights of
345this release are:
346
347  * From Gborg pgtcl project:
348    1. Stand-alone Tcl Extension Architecture (TEA) build system
349    2. New asynchronous query commands
350    3. New: Get query results as lists
351    4. New: pg_escape_string
352  * New in Pgtcl-ng:
353    5. Completed conversion to use Tcl-8 objects
354    6. New: pg_transaction_status, check in-transaction status
355    7. New: pg_parameter_status, get server parameter value
356    8. New: pg_exec_prepared, execute prepared queries, binary-safe
357    9. New: pg_notice_handler, change Notice and Warning handler
358   10. New: Get extended error message field values
359   11. New: Get extended column attribute information
360   12. New: Test query result values for NULL
361  * New reference manual
362  * Windows binary release
363
364There are also numerous fixes, include Large Object error handling, and a
365rewritten COPY implementation which can now deal with records longer than
3664096 bytes. (Bet you didn't know that limitation was there...) Please note:
367Many of the new commands should be considered 'experimental' and possibly
368subject to change.
369
370More detailed changes can be found in the ChangeLog files. Please note,
371however, that it is likely that not all changes between bundled PostgreSQL
372libpgtcl, Gborg pgtcl, and Gborg pgtcl-ng have been recorded.
373
374-----------------------------------------------------------------------------
375