Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B3308475909 for ; Thu, 8 Aug 2002 04:52:13 -0400 (EDT) Received: from e-mail.inode.at (e-mail.inode.at [213.229.60.101]) by postgresql.org (Postfix) with ESMTP id D21A8475903 for ; Thu, 8 Aug 2002 04:52:12 -0400 (EDT) Received: from flo.inode.at ([195.58.160.13] helo=flo.comnex.net) by e-mail.inode.at with esmtp (Exim 3.22 #2) id 17cj1h-0004SY-00 for pgsql-interfaces@postgresql.org; Thu, 08 Aug 2002 10:52:13 +0200 From: g.hintermayer@mail.inode.at To: pgsql-interfaces@postgresql.org Subject: libpgtcl modifications MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=xxmartinlovesdanilaandhisbaby Message-Id: Date: Thu, 08 Aug 2002 10:52:13 +0200 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/25 X-Sequence-Number: 2987 Mail created by cWebmail need a browser, which supports MIME Version 1.0 --xxmartinlovesdanilaandhisbaby Content-Type: text/plain I hacked libpgtcl to get the following working: > A broken backend connection trigers a notify event to the client (fixed > notification string "connection_closed") so proper action can be taken to switch > to another database server etc. Remember that this is event driven. If you have > applications, that have idle database connections most of the time, you'll get > immediate feedback of a dying server. Upon connection to the server issue a > pg_notify for notify event "connection_closed" and whenever the backend crashes > (which it does do in very very rare cases) you get an event driven recovery. (of > course the Tcl-Event loop has to be processed). Issuing a notification > "connection_closed" on a still working database could be used for switching to > another db-server. > I'd like to share my changes (because I don't want to apply them to every > release). What's the way to go ? Attached is a patch (hope I did it right ;-) ) Gerhard -- Gerhard Hintermayer http://www.inode.at/g.hintermayer --xxmartinlovesdanilaandhisbaby Content-transfer-encoding: base64 Content-Type: text/plain; name="patch-notification.gz" Content-Disposition: attachment; filename="patch-notification.gz" H4sICBeSTz0AA3BhdGNoAOVYaW/jNhD97PyKyRbI2qp8yJdy1AFSb3bhbjan s0BRFIZWomwisuRQtFt3kf/eGZKyrVxN4nS7QIPAkUnNc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