Next
Previous
Contents
Port to Windows NT is done and is available from
http://www.postgresql.org.
You can download the PostgreSQL binaries for Windows NT from download page and will save
you time.
If you want to re-compile the source tree then follow the instructions given below.
Porting to NT is done using Cygnus cygwin32 package which
has gcc, gmake for Win NT/95.
At this site and get the file cdk.exe (self-extractor file for gnu-win32)
The authors of Windows NT port of PostgreSQL are -
- Download
ftp://go.cygnus.com/pub/sourceware.cygnus.com/cygwin/latest/full.exe
- Run full.exe and install in c:\Unix\Root directory.
- Run Cygwin, Type 'mount --help' for docs. You can use -f switch to force mount.
And then run "umount / " and "mount c:\Unix\Root /"
- Go to
ftp://ftp.xemacs.org/pub/xemacs/aux/ and download
cygwin-b20-local.tar.bz2 in the
c:/Unix/Root directory.
- cd c:/Unix/Root; bunzip2 cygwin-b20-local.tar.bz2
- tar -xvf cygwin-b20-local.tar
- cd /local/bin; sh check_cygwin_setup.sh
- 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'
- mount c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32/bin
/bin
- cd c:/Unix/Root/cygwin-b20/H-i586-cygwin32/i586-cygwin32; mkdir
libexec share
man etc sbin info
- cp -R /local/{ bin,libexec,share,man,etc,sbin,info,include }
- Go to
http://www.multione.capgemini.fr/tools/pack_ipc and
download
cygwin32_ipc-1.03.tgz in c:/Unix/Root directory.
- tar -zxvf cygwin32_ipc-1.03.tgz
- cd cygwin32_ipc-1.03/src and run 'make'
- mkdir -p c:/usr/local/{bin,include,lib,include/sys}
cp /cygwin32_ipc-1.03/bin/* c:/usr/local/bin
cp /cygwin32_ipc-1.03/include/sys/* c:/usr/local/include/sys
cp /cygwin32_ipc-1.03/lib/* c:/usr/local/lib
cp c:/usr/local/bin/* /bin
cp c:/Unix/Root/cygwin-b20/H-i586-cygwin32/bin/* /bin
- mount c:/usr/local/bin /usr/local/bin
mount c:/usr/local/include /usr/local/include
mount c:/usr/local/lib /usr/local/lib
cp /local/lib/* /usr/local/lib
- Download the latest PostgreSQL source code
- Postgres treats all files as binary files so the lf/cf stuff
appeard, so we do steps 2, 3, 4, and 5:
mkdir -p c:/Postgres/{Source,Binary}
mkdir c:/Postgres/Binary/pgsql
mkdir -p /usr/src/pgsql
mkdir -p /usr/local/pgsql
- Copy Postgres source code to c:/Postgres/Source directory, then
tar -zxvf postgresql-6.5.3.tar.gz
- mv postgresql-6.5.3 pgsql
- Mount directories now -
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-b20/share
- mkdir -p /usr/local/pgsql/{bin,include,lib,data}
- cd /usr/src/pgsql/src/win32
- Copy header files -
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
- ln -s /usr/local/lib /usr/src/pgsql/src/backend/libpostgres.a
- cd /usr/src/pgsql/src, then run './configure'
- make > make.txt 2>&1
- make install > make.install.txt 2>&1
- cp /usr/local/pgsql/lib/pq.dll /usr/local/pgsql/bin
- 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.
- 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
- source /.bashrc, then run 'initdb --username=xxxx'
Note that the owner of the DB system have to be different from
root/administrator
- Edit the file /usr/local/pgsql/data/pg_hba.conf, such as:
host all 163.17.11.109 255.255.255.0 trust
- ipc-daemon.exe&
- postmaster -i&
- Run ' psql -h host_name template1'
Next
Previous
Contents