From 8c8aa53953d047c176023358ca311b78cafc6f7b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 2 Sep 2002 21:51:47 +0000 Subject: pg_on_connection_loss command for libpgtcl. Patch from Gerhard Hintermayer, revised and documented by Tom Lane. This patch also fixes a 'must fix' bug: libpgtcl's LISTEN/NOTIFY support was broken by the recent changes to the PGnotify structure. Guess that change wasn't quite so safe as we thought. --- doc/src/sgml/libpgtcl.sgml | 105 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/libpgtcl.sgml b/doc/src/sgml/libpgtcl.sgml index 3bebbc327f8..c42f0988108 100644 --- a/doc/src/sgml/libpgtcl.sgml +++ b/doc/src/sgml/libpgtcl.sgml @@ -72,6 +72,10 @@ pg_listen establish a callback for NOTIFY messages + + pg_on_connection_loss + establish a callback for unexpected connection loss + pg_lo_creat @@ -1245,7 +1249,7 @@ pg_listen dbHandle callbackCommand -If present and not empty, provides the command string to execute +If present, provides the command string to execute when a matching notification arrives. @@ -1312,6 +1316,105 @@ invoke the SQL NOTIFY statement using pg_exec. + + +pg_on_connection_loss +PGTCL - Asynchronous Notify + + +pg_on_connection_loss + +set or change a callback for unexpected connection loss + +pgtclconnection loss +connection loss + + + +2002-09-02 + + +pg_on_connection_loss dbHandle callbackCommand + + + + +2002-09-02 + +Inputs + + + + + dbHandle + + +Specifies a valid database handle. + + + + + + callbackCommand + + +If present, provides the command string to execute +when connection loss is detected. + + + + + + + + +2002-09-02 + +Outputs + + + + + None + + + + + + + + + + + + +2002-09-02 + +Description + +pg_on_connection_loss creates, changes, or cancels +a request to execute a callback command if an unexpected loss of connection +to the database occurs. +With a callbackCommand +parameter, the request is established, or the command string of an already +existing request is replaced. With no callbackCommand +parameter, a prior request is canceled. + + + +The callback command string is executed from the Tcl idle loop. That is the +normal idle state of an application written with Tk. In non-Tk Tcl shells, +you can +execute update or vwait to cause +the idle loop to be entered. + + + + + + + pg_lo_creat -- cgit v1.2.3