postgresql-8.0.0cvs-1 (experimental)
------------------------------------------
PostgreSQL is an advanced Object-Relational database management system
(DBMS) that supports almost all SQL constructs (including transactions,
subselects and user-defined types and functions).
This is based on a cvs snapshot after beta3, which fixes most 
of the cygwin issues. Only tablespace needs to be fixed.

Runtime requirements:
  cygwin-1.5.11-1
  crypt-1.1-1
  libiconv2-1.9.2-1
  libintl3-0.14.1-1
  libncurses7-5.3-4
  libreadline5-4.3-5
  openssl-0.9.7d-2
  perl-5.8.5-3	  (optional, for pgperl. only this version!)
  python-2.3.4-2  (optional, for pgpython. only this version!)
  zlib-1.2.1-2

Build requirements: (additionally)
  gcc-core 3.3.x    or newer (libtool-devel-1.5.10 not required)
  binutils-20040725-2   or newer
  make-3.80-1           or newer
  ash-20040127-1        or newer
  fileutils-4.1         or newer
  sed-4.1.2-1           or newer
  m4-1.4-1
  Sun JDK 1.4.x     (optional, for pgjava only)
  Ant 1.5 

Canonical homepage:
  http://www.postgresql.org

Canonical download:
  ftp://ftp.postgresql.org

  This build is a snapshot against cvs HEAD from 2004-10-04:
    export CVSROOT=-:pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot
    cvs login
      Password: anoncvs
    cvs co -d postgresql-8.0.0cvs -D 2004-10-04 pgsql-server

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

Build instructions:
  unpack postgresql-<VER>-<REL>-src.tar.bz2
    if you use setup to install this src package, it will be
	 unpacked under /usr/src automatically
  cd /usr/src
  ./postgresql-<VER>-<REL>.sh all

This will create:
  /usr/src/postgresql-<VER>-<REL>.tar.bz2
  /usr/src/postgresql-<VER>-<REL>-src.tar.bz2

Or use './postgresql-<VER>-<REL>.sh prep' to get a patched source directory

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

Files included in the binary distribution:

  /etc/postinstall/postgresql.sh
  /etc/preremove/postgresql.sh
  /usr/bin/clusterdb.exe
  /usr/bin/createdb.exe
  /usr/bin/createlang.exe
  /usr/bin/createuser.exe
  /usr/bin/dropdb.exe
  /usr/bin/droplang.exe
  /usr/bin/dropuser.exe
  /usr/bin/ecpg.dll
  /usr/bin/ecpg.exe
  /usr/bin/ecpg_compat.dll
  /usr/bin/initdb.exe
  /usr/bin/ipcclean
  /usr/bin/pgtypes.dll
  /usr/bin/pg_config.exe
  /usr/bin/pg_controldata.exe
  /usr/bin/pg_ctl.exe
  /usr/bin/pg_dump.exe
  /usr/bin/pg_dumpall.exe
  /usr/bin/pg_resetxlog.exe
  /usr/bin/pg_restore.exe
  /usr/bin/postgres.exe
  /usr/bin/postmaster.exe
  /usr/bin/pq.dll
  /usr/bin/psql.exe
  /usr/bin/vacuumdb.exe
  /usr/include/*.h
  /usr/include/libpq/*.h
  /usr/lib/libecpg.a
  /usr/lib/libecpg_compat.a
  /usr/lib/libpgtypes.a
  /usr/lib/libpostgres.a
  /usr/lib/libpq.a
  /usr/lib/postgresql/<charset-convert>.dll
  /usr/lib/postgresql/pgxs/config/install-sh
  /usr/lib/postgresql/pgxs/config/mkinstalldirs
  /usr/lib/postgresql/pgxs/src/Makefile.global
  /usr/lib/postgresql/pgxs/src/Makefile.port
  /usr/lib/postgresql/pgxs/src/Makefile.shlib
  /usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk
  /usr/lib/postgresql/pgxs/src/nls-global.mk
  /usr/lib/postgresql/pgxs/src/utils/dllinit.o
  /usr/lib/postgresql/plperl.dll
  /usr/lib/postgresql/plpgsql.dll
  /usr/lib/postgresql/plpython.dll
  /usr/share/doc/Cygwin/postgresql-8.0.0cvs.README (this file)
  /usr/share/doc/postgresql/*  (official docs)
  /usr/share/locale/*/LC_MESSAGES/*.mo (nls files for all backends)
  /usr/share/postgresql/conversion_create.sql
  /usr/share/postgresql/information_schema.sql
  /usr/share/postgresql/pg_hba.conf.sample
  /usr/share/postgresql/pg_ident.conf.sample
  /usr/share/postgresql/pg_service.conf.sample
  /usr/share/postgresql/postgres.bki
  /usr/share/postgresql/postgres.description
  /usr/share/postgresql/postgresql.conf.sample
  /usr/share/postgresql/psqlrc.sample
  /usr/share/postgresql/recovery.conf.sample
  /usr/share/postgresql/sql_features.txt
  /usr/share/postgresql/system_views.sql
  /usr/share/postgresql/timezone/* (all supported timezones)

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

Port Notes:

----------  postgresql-8.0.0cvs-1 -----------

Maintainership changed from Jason Tishler to Reini Urban.
nls and charset translation support (not only -E Latin1). Building via gbs.
Improved IPC and signals handling. Up to 50 max_connections 
possible, but 5 are still recommended. max 63 hardlimit on cygwin.
Added new postinstall and preremove recipes to save and restore the 
old databases into /var/tmp/db.out.gz.
TODO: add /usr/lib/postgresql/ to the postmaster service path
      add init.d service installer/uninstaller as with clamav
      fix tablespace breakage

----------  postgresql-7.4.5-1 -----------

First cygserver release, ipc-daemon2 not supported anymore.
Note: If you haven't uninstalled ipc-daemon2, it will be built against it, 
and will therefore fail when cygserver is running.


Cygwin port maintained by: Reini Urban <rurban@x-ray.at>
Please report problems, suggestions, etc. dependent on their nature to one of
the following:

    pgsql-cygwin@postgresql.org
    cygwin@cygwin.com

======================================================================

(The official doc/FAQ_MSWIN is hopelessly outdated. Until this is 
fixed, we add some information here.)

Abstract:

README for the experimental Cygwin PostgreSQL 8.0.0 distribution.

PostgreSQL is an advanced Object-Relational database management system
(DBMS) that supports almost all SQL constructs (including transactions,
subselects and user-defined types and functions).

The Cygwin PostgreSQL package is very monolithic compared its RPM
counterparts and its contents is roughly analogous to the aggregation
of the following PostgreSQL RPMs:

    postgresql-contrib
    postgresql-devel
    postgresql-docs
    postgresql-jdbc
    postgresql-libs
    postgresql-perl
    postgresql-python
    postgresql-server

Whats new:

Win32 Native Server, Savepoints, Point-In-Time Recovery, Tablespaces,
Improved Buffer Management, CHECKPOINT, VACUUM, Change Column Types, 
New Perl Server-Side Language, CSV support in COPY.

The main PostgreSQL project plans to add support for a native Windows
version with our version 8 release. This will probably be released in
late 2004.

See http://momjian.postgresql.org/main/writings/pgsql/win32.html 
for the PostgreSQL Native Win32 Status Report. (mingw build)
However the cygwin port also benefits from the version 8 changes, 
which comes with better IPC support, and improved signal handling.

See http://candle.pha.pa.us/main/writings/pgsql/sgml/release.html#RELEASE-8-0
for the full list of major changes with 8.0, and the steps for migration to 
version 8.0.

Deprecated features:

* The 8.1 release will remove the function to_char(interval).

* By default, tables in PostgreSQL 8.0 and earlier are created with
  OIDs. In the next release, this will not be the case: to create a
  table that contains OIDs, the WITH OIDS clause must be specified or
  the default_with_oids configuration parameter must be enabled. Users
  are encouraged to explicitely specify WITH OIDS if their tables
  require OIDs for compatibility with future releases of PostgreSQL.

Recommended usage:

It's very easy to install, but we don't recommend using the
cygwin version of PostgreSQL for "Production" quality databases, nor
high load levels. The cygwin emulation layer introduces a few
limitations, namely the lack of being able to tune PostgreSQL to the
same performance levels of a Unix system or the new Native WinNT built, 
and we're also not sure how well the data integrity features of 
Windows + cygwin + PostgreSQL work +in the event of a system crash, 
hardware failure, etc.

It should be suitable for development usage however.

Install:

There are two types of Cygwin PostgreSQL installations -- basic and NT
services.  The basic installation is good for casual use on any version of
Windows, but required on Windows 9x/Me.  The NT services installation is
good for a more production environment, but is only available on Windows
NT/2000/XP.  Note that this installation type is very similar to the normal
Unix installation with just some Cygwin/Windows variations.  You should
choose the type which best meets your needs and/or is constrained by your
platform.

Regardless of the installation type, the first step is to add "server" to
your CYGWIN environment variable setting and start cygserver.  See the
cygserver README:

    /usr/share/doc/cygwin/cygserver.README

for more details.  If the CYGWIN variable is not set correctly and/or
cygserver is not running then initdb and postmaster will fail to run
properly.

The following is the basic Cygwin PostgreSQL installation procedure (skip if
using the NT services installation below):

1. Install and configure cygserver:

    $ cygserver-config

2. Start cygserver:

    $ cygserver &

3. Initialize PostgreSQL:

    $ initdb

4. Start the PostgreSQL postmaster:

    $ postmaster &

5. Connect to PostgreSQL:

    $ psql template1

The following is the NT services Cygwin PostgreSQL installation procedure
(with footnotes designated by "[n]"):

1. Install and configure cygserver as a NT service:

    # cygserver-config

2. Create the "postgres" user account:

    # net user postgres $password /add /fullname:postgres /comment:'PostgreSQL user account' /homedir:"$(cygpath -w /home/postgres)" # [11]
    # mkpasswd -l -u postgres >>/etc/passwd

3. Grant the "postgres" user the "Log on as a service" user right:

    # cmd /c secpol.msc # [3] [4] [5] [12]

4. Install postmaster as a NT service:

    # cygrunsrv --install postmaster --path /usr/bin/postmaster --args "-D /var/postgresql/data -i" --dep cygserver --termsig INT --user postgres --shutdown # [6]

5. Create the PostgreSQL data directory:

    # mkdir -p /var/postgresql/data

6. Change ownership of the PostgreSQL data directory:

    # chown postgres /var/postgresql/data # [10]

7. Start cygserver:

    # cygrunsrv -S cygserver # [7]

8. Initialize PostgreSQL (*when running under the "postgres" account*):

    $ initdb -D /var/postgresql/data

9. Start postmaster:

    # cygrunsrv -S postmaster # [7]

10. Verify postmaster is running:

    # cygrunsrv -Q postmaster  [13]

11. Connect to PostgreSQL:

    # psql -U postgres template1 # [8] [9]

The following are the notes to the above:

[1] The "#" prompt indicates running as a user which is a member of the
    Local Administrators group under bash.
[2] The "$" prompt indicates running as the "postgres" user under bash.
    Log in as "postgres" or use ssh to emulate Unix's "su" command.
[3] Sorry, but I don't know of a generally available command line way of
    setting user rights.
[4] On Windows 2000 and XP Pro, this starts the "Local Security Settings"
    applet.  On Windows NT 4.0, start User Manager, select Policies, and then
    select User Rights...
[5] See http://support.microsoft.com/default.aspx?scid=KB;en-us;q259733 for
    a Microsoft KB article explaining how to configure user rights.
[6] Clean postmaster shutdown will only work with a post Cygwin 1.3.2
    snapshot from 2001-Jul-28 or later.
[7] Cygwin's bin directory (e.g., C:\Cygwin\bin) must be added to the
    Windows NT/2000's system PATH and the machine rebooted for the SCM
    to find cygwin1.dll.
[8] Actually, psql can run under any user account.
[9] One can use PostgreSQL's createuser command or set PGUSER to obviate
    the need to specify "-U postgres" on the psql command line.
[10] Assumes that ntsec is set via the CYGWIN environment variable.
[11] $password is the password for the postgres user account.
[12] On Windows XP Home, there is no built in way to assign user rights --
     use editrights instead:

         $ editrights -u postgres -a SeServiceLogonRight

[13] If postmaster fails to start, then examine /var/log/postmaster.log
     and/or the NT Event Log.

Source:

As configured, the PostgreSQL source builds OOTB under Cygwin with
some minor required build patches.

Build:

This distribution has been configured as follows:

    ./configure --disable-thread-safety --enable-nls
    --disable-integer-datetimes --enable-multibyte --with-python
    --with-perl --with-java --with-CXX --with-openssl 
    --prefix=/usr --sysconfdir=/etc --datadir=/usr/share
    --mandir=/usr/share/man
    --docdir=/usr/share/doc/postgresql-<VER>-<REL>

See postgresql-<VER>-<REL>.sh and postgresql-<VER>-<REL>-1.patch in the source package for 
the exact build recipe for configuring, making, and packaging this distribution.

Test:

Only tablespace test fails with this build.
On NT/2000/XP, Cygwin PostgreSQL passes all other regression tests 
with the serial_schedule. The parallel schedule hangs.
The pgperl extension fails with shared memory errors, there's no regression test yet.

On 9X/ME, it has been reported that Cygwin PostgreSQL hangs at random
places during the regression test.  Unfortunately, at the time of this
writing, no one has tracked down the root cause of these hangs. 
(cygserver most likely)

Issues:

1. make check can generate spurious regression test failures due to
overflowing the listen() backlog queue which generates connection
refused errors.  One can workaround this (Winsock) limitation, by running
the regression test as follows:

    $ make MAX_CONNECTIONS=5 check

2. Cygwin PostgreSQL only supports the "C" locale because Cygwin itself
does not fully support locales.  This implies the LANG environment variable
must be unset or set to "C".  Otherwise, initdb will fail.

3. Cygwin PostgreSQL can fail to start or not function properly if certain
files and directories have incorrect permissions.  The following usually
solves these kinds of problems:

    $ chmod a+rwx /tmp
    $ chmod a+rx /usr/bin /usr/bin/*
    $ chmod a+rw /var/log # could adversely affect other daemons

4. It may be necessary to increase cygserver's system wide maximum number of
semaphores (SEMMNS).  This change is affected by editing /etc/cygserver.conf,
setting the following parameter:

    kern.ipc.semmns 100

and restarting cygserver.  Otherwise, PostgreSQL can fail to operate properly.
For example, initdb will fail if postmaster is already running.

5. It is known that the plperl language extension may crash on IPC shmget calls
under Cygwin only. No one has tracked down the root cause yet.


Homepage:

The primary PostgreSQL web site is:

    http://www.postgresql.org

The 8.0.x Documentation is also online at 

  http://candle.pha.pa.us/main/writings/pgsql/sgml/

