Porting PostgreSQL to Windows NT installation procedures
First of all, thank Daniel Horak
and
Joost
Kraaijeveld for their helps. Without them, I cannot port Postgres to
NT successfully.
-
Install the Cygwin package
1. Download ftp://go.cygnus.com/pub/sourceware.cygnus.com/cygwin/latest/full.exe
2. Run full.exe and install in c:/Unix/Root directory.
3. Run Cygwin, and then run "mount /"
-
Install the Andy Piper tools
1. Go to ftp://ftp.xemacs.org/pub/xemacs/aux/
and
download cygwin-b20-local.tar.bz2 in the
c:/Unix/Root directory.
2. cd c:/Unix/Root; bunzip2 local-b20.tar.bz2
3. tar -xvf local-b20.tar
4. cd /local/bin; sh check_cygwin_setup.sh
5. After doing step 4, you see the following message:
You don't have /bin would you like to mount cygwin as /bin?"
[y/n]
Select 'n', and the other options are selected 'y'
6. mount c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/bin /bin
7. cd c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32; mkdir libexec
share
man etc sbin info
8. cp -r /local/{bin,libexec,share,man,etc,sbin,info,include}
-
Install Ludovic Lange's Cygwin32 IPC package
1. Go to http://www.multione.capgemini.fr/tools/pack_ipc/
and download
cygwin32_ipc-1.03.tgz in c:/Unix/Root directory.
2. tar -zxvf cygwin32_ipc-1.03.tgz
3. cd cygwin32_ipc-1.03/src and run 'make'
4. mkdir c:/usr/local/{bin,include,lib}
cp /cygwin32_ipc-1.03/bin/* c:/usr/local/bin
cp /cygwin32_ipc-1.03/include/sys/* c:/usr/local/include
cp /cygwin32_ipc-1.03/lib/* c:/usr/local/lib
5. mount c:/usr/local/bin /usr/local/bin
mount c:/usr/local/include /usr/local/include
mount c:/usr/local/lib /usr/local/lib
-
Install PostgreSQL 6.5 Beta1
1. Download PostgreSQL 6.5 Beta1 source
code
2. un.h, endian.h and tcp.h are included in the sources (src/win32)
3. cp un.h c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/sys
cp endian.h c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include
cp tcp.h c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/netinet
4. Postgres treats all files as binary files so the lf/cf stuff appeard,
so we do steps 4, 5, 6,
and 7:
mkdir -p c:/Postgres/{Source,Binary}
mkdir -p /usr/src/pgsql
mkdir -p /usr/local/pgsql
5. Copy Postgres source code to c:/Postgres/Source directory, then
tar -zxvf postgresql-v6.5beta1.tar.gz
6. mv postgresql-v6.5beta1 pgsql
7. mount -b c:/Postgres/Binary/pgsql /usr/local/pgsql
mount c:/Postgres/Source/pgsql /usr/src/pgsql
mount c:/Unix/Root/cygwin-b20/share /sw/cygwin/share
8. mkdir -p /usr/local/pgsql/{bin,include,lib,data}
9. ln -s /usr/local/lib /usr/src/pgsql/src/backend/libpostgres.a
10. Change
pgsql/src/utils/dllinit.c <cygwin32/cygwin_dll.h> to <cygwin/cygwin_dll.h>
11. cd
/usr/src/pgsql/src, then run 'sh configure'
12. make
> make.txt 2>&1
13. make
install > make.install.txt 2>&1
14. cp
/usr/local/pgsql/lib/pq.dll /usr/local/pgsql/bin
15. After
the make install you had to change all the text files in the bin and lib
diectories so
that they did not contain cr/lf and eof stuff.
16. Using
any editor to create .bashrc in / directory as belows:
PATH=$PATH:/usr/local/pgsql/bin:/usr/local/bin
PGDATA=/usr/local/pgsql/data
PGLIB=/usr/local/pgsql/lib
LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/local/lib
export LD_LIBRARY_PATH PATH PGDATA PGLIB
17. source
/.bashrc, then run 'initdb --username=xxxx'
Note that the owner of the DB system have to be different from root/administrator
18. Edit
the file /usr/local/pgsql/data/pg_hba.conf, such as:
host all
163.17.11.109 255.255.255.0 trust
19. /usr/local/bin/ipc-daemon.exe&
20. postmaster
-i&
21. Run
' psql -h host_name template1', then you will see:
BASH.EXE-2.02$ psql -h linux1 template
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: template1
template1=>
Last updated: 5/15/99' Author: Kevin
Lo