Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
blob: 7af9930f176266c40735f3db3ca271ce862c78e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
From: "Joost Kraaijeveld" <JKraaijeveld@askesis.nl>
To: "Pgsql-Ports@Postgresql. Org" <pgsql-ports@postgreSQL.org>
Subject: RE: [PORTS] Re: psql under win32
Date: Wed, 21 Apr 1999 07:07:47 +0200
Message-ID: <000001be8bb4$e59b0ab0$0300a8c0@abraracourcix.askesis.nl>
MIME-Version: 1.0

Installing PostgreSQL on NT:

---------------------------------------------------------------------------

It can be done by done by typing configure, make and make install.

1. Install the Cygwin package
2. Update to EGCS 1.1.2
   (This may be optional.)

---------------------------------------------------------------------------

				OPTIONAL

1. Install the Andy Piper Tools (http://www.xemacs.freeserve.co.uk/)
   (This may be optional.)

---------------------------------------------------------------------------

			  CYGWIN32 INSTALLATION

1. Download the Cygwin32 IPC Package by Ludovic LANGE 
   http://www.multione.capgemini.fr:80/tools/pack_ipc/current.tar.gz
2. Untar the package and follow the readme instructions.
3. Apply the patch from the file.
4. I tested 1.03.
5. I used the \cygwin-b20\h-i568-cygwin32\i586-cygwin32\lib and
\cygwin-b20\h-i568-cygwin32\i586-cygwin32\include\sys instead of the
/usr/local/lib and usr/local/include/sys.

NOTE:
Also, the cygnus-bindir has to be placed in the path before the
NT-directories, because the sort.exe has to be taken for cygnus, not
NT.

---------------------------------------------------------------------------

		   POSTGRESQL INSTALL WITH NT SPECIFICS

1. Download the current version of PostgreSQL.
2. Untar the package.
3. Copy the files from \pgsql\src\win32 according to the readme file.
4. Edit \pgsql\src\template\cygwin32 if needed (I had to adjust the YFLAGS
path).
5. ./configure
6. make
7. create the directory /usr/local/pgsql manually: the mkdir cannot create a
directory 2 levels deep in one step.
8. make install
9. cd /usr/lical/pgsql/doc
10. make install
11. Set the environmental data
12. Initdb --username=jkr (do not run this command as administrator)

13. Open a new Cygwin command prompt
14. Start "ipc-deamon&" (background proces)
15. Start "postmaster -i 2>&1 > /tmp/postgres.log &" (background proces)
16. Start "tail -f /tmp/postgres.log" to see the messages

17. cd /usr/src/pgsql/src/test/regress
18. make all runtest

All test should be run, allthought the latest snapshot I tested (18-4)
appears to have some problems with locking.

NOTE:
By default, PostgreSQL clients like psql communicate using unix domain
sockets, which don't work on NT.  Start the postmaster with -i, and 
when connecting to the database from a client, set the PGHOST
environment variable to 'localhost' or supply the hostname on the
command line.

Joost


---------------------------------------------------------------------------

FIX FOR POSTGRESQL FREEZING ON NT MACHINES - EVERYONE SHOULD APPLY THIS PATCH


From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Horak Daniel" <horak@mmp.plzen-city.cz>, "'Tom Lane'" <tgl@sss.pgh.pa.us>
Cc: <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] backend freezeing on win32 fixed (I hope ;-) ) 
Date: Wed, 18 Aug 1999 08:45:28 +0900
Message-ID: <000301bee90a$95d40f00$2801007e@cadzone.tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
In-reply-to: <2E7F82FAC1FCD2118E1500A024B3BF907DED3F@exchange.mmp.plzen-city.cz>
Importance: Normal
Sender: owner-pgsql-hackers@postgreSQL.org
Precedence: bulk
Status: RO

> -----Original Message-----
> From: owner-pgsql-hackers@postgreSQL.org
> [mailto:owner-pgsql-hackers@postgreSQL.org]On Behalf Of Horak Daniel
> Sent: Tuesday, August 17, 1999 9:06 PM
> To: 'Tom Lane'
> Cc: 'pgsql-hackers@postgreSQL.org'
> Subject: RE: [HACKERS] backend freezeing on win32 fixed (I hope ;-) )

Yutaka Tanida [yutaka@marin.or.jp] and I have examined IPC
library.

We found that postmaster doesn't call exec() after fork() since v6.4.

The value of static/extern variables which cygipc library holds may
be different from their initial values when postmaster fork()s child
backend processes.

I made the following patch for cygipc library on trial.
This patch was effective for Yutaka's test case.

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp

*** sem.c.orig	Tue Dec 01 00:16:25 1998
--- sem.c	Tue Aug 17 13:22:06 1999
***************
*** 58,63 ****
--- 58,78 ----
  static int		  GFirstSem	 = 0;		/*PCPC*/
  static int		  GFdSem	    ;		/*PCPC*/

+ static pid_t	GProcessId = 0;
+
+ static void	init_globals(void)
+ {
+ 	pid_t pid;
+
+ 	if (pid=getpid(), pid != GProcessId)
+ 	{
+ 		GFirstSem = 0;
+ 		used_sems = used_semids = max_semid = 0;
+ 		sem_seq = 0;
+ 		GProcessId = pid;
+ 	}
+ }
+
  /************************************************************************/
  /* Demande d'acces a la zone partagee de gestion des semaphores		*/
  /************************************************************************/
***************
*** 77,82 ****
--- 92,98 ----
  {
      int LRet ;

+ 	init_globals();
      if( GFirstSem == 0 )
      {
  	if( IsGSemSemExist() )
*** shm.c.orig	Tue Dec 01 01:04:57 1998
--- shm.c	Tue Aug 17 13:22:27 1999
***************
*** 59,64 ****
--- 59,81 ----
  static int		  GFirstShm	 = 0;		/*PCPC*/
  static int		  GFdShm	    ;		/*PCPC*/

+ /*****************************************/
+ /*	Initialization of static variables   */
+ /*****************************************/
+ static pid_t GProcessId = 0;
+ static void init_globals(void)
+ {
+ 	pid_t pid;
+
+ 	if (pid=getpid(), pid != GProcessId)
+ 	{
+ 		GFirstShm = 0;
+ 		shm_rss = shm_swp = max_shmid = 0;
+ 		shm_seq = 0;
+ 		GProcessId = pid;
+ 	}
+ }
+
  /************************************************************************/
  /* Demande d'acces a la zone partagee de gestion des shm		*/
  /************************************************************************/
***************
*** 82,87 ****
--- 99,105 ----
  {
   int LRet ;

+  init_globals();
   if( GFirstShm == 0 )
   {
    if( IsGSemShmExist() )
*** msg.c.orig	Tue Dec 01 00:16:09 1998
--- msg.c	Tue Aug 17 13:20:04 1999
***************
*** 57,62 ****
--- 57,77 ----
  static int		  GFirstMsg	 = 0;		/*PCPC*/
  static int		  GFdMsg	    ;		/*PCPC*/

+ /*****************************************/
+ /*	Initialization of static variables   */
+ /*****************************************/
+ static pid_t GProcessId = 0;
+ static void init_globals(void)
+ {
+ 	pid_t pid;
+
+ 	if (pid=getpid(), pid != GProcessId)
+ 	{
+ 		GFirstMsg = 0;
+ 		msgbytes = msghdrs = msg_seq = used_queues = max_msqid = 0;
+ 		GProcessId = pid;
+ 	}
+ }
  /************************************************************************/
  /* Demande d'acces a la zone partagee de gestion des semaphores		*/
  /************************************************************************/
***************
*** 79,84 ****
--- 94,100 ----
  {
   int LRet ;

+  init_globals();
   if( GFirstMsg == 0 )
   {
    if( IsGSemMsgExist() )