From 81fa9e0e5620e361aaf0808261195a000aa3df8c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 13 Jun 2000 09:16:39 +0000 Subject: [PATCH] in the Directory src/bin/pgtclsh there is a good mechanism to integrate the tcl-spec in the Makefile. The patch in the attachemant does this in the src/interfaces/libpgtcl too Thank you Rudolf Weber --- configure.in | 2 + doc/TODO.detail/replication | 125 ++++++++++++++++++++++++++-- src/interfaces/libpgtcl/Makefile.in | 15 +++- 3 files changed, 134 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 71a84bb942..14034cf00f 100644 --- a/configure.in +++ b/configure.in @@ -1312,6 +1312,8 @@ AC_OUTPUT( src/interfaces/libpq++/Makefile src/interfaces/libpgeasy/Makefile src/interfaces/libpgtcl/Makefile + src/interfaces/libpgtcl/mkMakefile.tcldefs.sh + src/interfaces/libpgtcl/mkMakefile.tkdefs.sh src/interfaces/odbc/GNUmakefile src/interfaces/odbc/Makefile.global src/interfaces/python/GNUmakefile diff --git a/doc/TODO.detail/replication b/doc/TODO.detail/replication index a864dab5e9..93a0ea17dd 100644 --- a/doc/TODO.detail/replication +++ b/doc/TODO.detail/replication @@ -43,7 +43,7 @@ From owner-pgsql-hackers@hub.org Fri Dec 24 10:01:18 1999 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id LAA11295 for ; Fri, 24 Dec 1999 11:01:17 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id KAA20310 for ; Fri, 24 Dec 1999 10:39:18 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id KAA20310 for ; Fri, 24 Dec 1999 10:39:18 -0500 (EST) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id KAA61760; Fri, 24 Dec 1999 10:31:13 -0500 (EST) @@ -129,7 +129,7 @@ From owner-pgsql-hackers@hub.org Fri Dec 24 18:31:03 1999 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id TAA26244 for ; Fri, 24 Dec 1999 19:31:02 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id TAA12730 for ; Fri, 24 Dec 1999 19:30:05 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id TAA12730 for ; Fri, 24 Dec 1999 19:30:05 -0500 (EST) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id TAA57851; Fri, 24 Dec 1999 19:23:31 -0500 (EST) @@ -212,7 +212,7 @@ From owner-pgsql-hackers@hub.org Fri Dec 24 21:31:10 1999 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA02578 for ; Fri, 24 Dec 1999 22:31:09 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id WAA16641 for ; Fri, 24 Dec 1999 22:18:56 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id WAA16641 for ; Fri, 24 Dec 1999 22:18:56 -0500 (EST) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id WAA89135; Fri, 24 Dec 1999 22:11:12 -0500 (EST) @@ -486,7 +486,7 @@ From owner-pgsql-hackers@hub.org Sun Dec 26 08:31:09 1999 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id JAA17976 for ; Sun, 26 Dec 1999 09:31:07 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id JAA23337 for ; Sun, 26 Dec 1999 09:28:36 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id JAA23337 for ; Sun, 26 Dec 1999 09:28:36 -0500 (EST) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id JAA90738; Sun, 26 Dec 1999 09:21:58 -0500 (EST) @@ -909,7 +909,7 @@ From owner-pgsql-hackers@hub.org Thu Dec 30 08:01:09 1999 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id JAA10317 for ; Thu, 30 Dec 1999 09:01:08 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id IAA02365 for ; Thu, 30 Dec 1999 08:37:10 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id IAA02365 for ; Thu, 30 Dec 1999 08:37:10 -0500 (EST) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id IAA87902; Thu, 30 Dec 1999 08:34:22 -0500 (EST) @@ -1006,7 +1006,7 @@ From owner-pgsql-patches@hub.org Sun Jan 2 23:01:38 2000 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id AAA16274 for ; Mon, 3 Jan 2000 00:01:28 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id XAA02655 for ; Sun, 2 Jan 2000 23:45:55 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id XAA02655 for ; Sun, 2 Jan 2000 23:45:55 -0500 (EST) Received: from hub.org (hub.org [216.126.84.1]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA13828; Sun, 2 Jan 2000 23:40:47 -0500 (EST) @@ -1424,7 +1424,7 @@ From owner-pgsql-hackers@hub.org Tue Jan 4 10:31:01 2000 Received: from renoir.op.net (root@renoir.op.net [207.29.195.4]) by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id LAA17522 for ; Tue, 4 Jan 2000 11:31:00 -0500 (EST) -Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.4 $) with ESMTP id LAA01541 for ; Tue, 4 Jan 2000 11:27:30 -0500 (EST) +Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id LAA01541 for ; Tue, 4 Jan 2000 11:27:30 -0500 (EST) Received: from localhost (majordom@localhost) by hub.org (8.9.3/8.9.3) with SMTP id LAA09992; Tue, 4 Jan 2000 11:18:07 -0500 (EST) @@ -1617,3 +1617,114 @@ RDBMS, and you will have trouble convincing management that this is not really true. +From pgsql-hackers-owner+M2401@hub.org Tue May 23 12:19:54 2000 +Received: from news.tht.net (news.hub.org [216.126.91.242]) + by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id MAA28410 + for ; Tue, 23 May 2000 12:19:53 -0400 (EDT) +Received: from hub.org (majordom@hub.org [216.126.84.1]) + by news.tht.net (8.9.3/8.9.3) with ESMTP id MAB53304; + Tue, 23 May 2000 12:00:08 -0400 (EDT) + (envelope-from pgsql-hackers-owner+M2401@hub.org) +Received: from gwineta.repas.de (gwineta.repas.de [193.101.49.1]) + by hub.org (8.9.3/8.9.3) with ESMTP id LAA39896 + for ; Tue, 23 May 2000 11:57:31 -0400 (EDT) + (envelope-from kardos@repas-aeg.de) +Received: (from smap@localhost) + by gwineta.repas.de (8.8.8/8.8.8) id RAA27154 + for ; Tue, 23 May 2000 17:57:23 +0200 +Received: from dragon.dr.repas.de(172.30.48.206) by gwineta.repas.de via smap (V2.1) + id xma027101; Tue, 23 May 00 17:56:20 +0200 +Received: from kardos.dr.repas.de ([172.30.48.153]) + by dragon.dr.repas.de (UCX V4.2-21C, OpenVMS V6.2 Alpha); + Tue, 23 May 2000 17:57:24 +0200 +Message-ID: <010201bfc4cf$7334d5a0$99301eac@Dr.repas.de> +From: "Kardos, Dr. Andreas" +To: "Todd M. Shrider" , + +References: +Subject: Re: [HACKERS] failing over with postgresql +Date: Tue, 23 May 2000 17:56:20 +0200 +Organization: repas AEG Automation GmbH +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 8bit +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 5.00.2314.1300 +X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 +X-Mailing-List: pgsql-hackers@postgresql.org +Precedence: bulk +Sender: pgsql-hackers-owner@hub.org +Status: OR + +For a SCADA system (Supervisory Control and Data Akquisition) which consists +of one master and one hot-standby server I have implemented such a +solution. To these UNIX servers client workstations are connected (NT and/or +UNIX). The database client programms run on client and server side. + +When developing this approach I had to goals in mind: +1) Not to get dependend on the PostgreSQL sources since they change very +dynamically. +2) Not to get dependend on the fe/be protocol since there are discussions +around to change it. + +So the approach is quite simple: Forward all database requests to the +standby server on TCP/IP level. + +On both servers the postmaster listens on port 5433 and not on 5432. On +standard port 5432 my program listens instead. This program forks twice for +every incomming connection. The first instance forwards all packets from the +frontend to both backends. The second instance receives the packets from all +backends and forwards the packets from the master backend to the frontend. +So a frontend running on a server machine connects to port 5432 of +localhost. + +On the client machine runs another program (on NT as a service). This +program forks for every incomming connections twice. The first instance +forwards all packets to port 5432 of the current master server and the +second instance forwards the packets from the master server to the frontend. + +During standby computer startup the database of the master computer is +dumped, zipped, copied to the standby computer, unzipped and loaded into +that database. +If a standby startup took place, all client connections are aborted to allow +a login into the standby database. The frontends need to reconnect in this +case. So the database of the standby computer is always in sync. + +The disadvantage of this method is that a query cannot be canceled in the +standby server since the request key of this connections gets lost. But we +can live with that. + +Both programms are able to run on Unix and on (native!) NT. On NT threads +are created instead of forked processes. + +This approach is simple, but it is effective and it works. + +We hope to survive this way until real replication will be implemented in +PostgreSQL. + +Andreas Kardos + +-----Ursprüngliche Nachricht----- +Von: Todd M. Shrider +An: +Gesendet: Donnerstag, 18. Mai 2000 17:48 +Betreff: [HACKERS] failing over with postgresql + + +> +> is anyone working on or have working a fail-over implentation for the +> postgresql stuff. i'd be interested in seeing if and how any might be +> dealing with just general issues as well as the database syncing issues. +> +> we are looking to do this with heartbeat and lvs in mind. also if anyone +> is load ballancing their databases that would be cool to talk about to. +> +> --- +> Todd M. Shrider VA Linux Systems +> Systems Engineer +> tshrider@valinux.com www.valinux.com +> + + diff --git a/src/interfaces/libpgtcl/Makefile.in b/src/interfaces/libpgtcl/Makefile.in index 5e7e75908b..d722e28b5e 100644 --- a/src/interfaces/libpgtcl/Makefile.in +++ b/src/interfaces/libpgtcl/Makefile.in @@ -6,7 +6,7 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.41 2000/06/06 22:01:01 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.42 2000/06/13 09:16:39 momjian Exp $ # #------------------------------------------------------------------------- @@ -19,6 +19,14 @@ include $(SRCDIR)/Makefile.global CFLAGS+= -I$(LIBPQDIR) +# +# Include definitions from the tclConfig.sh file +# +include Makefile.tcldefs +ifeq ($(USE_TK), true) +include Makefile.tkdefs +endif + ifdef KRBVERS CFLAGS+= $(KRBFLAGS) endif @@ -46,6 +54,11 @@ install-headers: beforeinstall-headers libpgtcl.h beforeinstall-headers: -@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi +Makefile.tcldefs: mkMakefile.tcldefs.sh + /bin/sh mkMakefile.tcldefs.sh + +Makefile.tkdefs: mkMakefile.tkdefs.sh + /bin/sh mkMakefile.tkdefs.sh .PHONY: clean