head	1.8;
access;
symbols
	REL7_4_29:1.6
	REL8_0_25:1.7
	REL8_1_21:1.7
	REL7_4_28:1.6
	REL8_0_24:1.7
	REL8_1_20:1.7
	REL7_4_27:1.6
	REL8_0_23:1.7
	REL8_1_19:1.7
	REL7_4_26:1.6
	REL8_0_22:1.7
	REL8_1_18:1.7
	REL7_4_25:1.6
	REL8_0_21:1.7
	REL8_1_17:1.7
	REL7_4_24:1.6
	REL8_0_20:1.7
	REL8_1_16:1.7
	REL7_4_23:1.6
	REL8_0_19:1.7
	REL8_1_15:1.7
	REL7_4_22:1.6
	REL8_0_18:1.7
	REL8_1_14:1.7
	REL7_4_21:1.6
	REL8_0_17:1.7
	REL8_1_13:1.7
	REL7_4_20:1.6
	REL8_0_16:1.7
	REL8_1_12:1.7
	REL7_3_21:1.6
	REL7_4_19:1.6
	REL8_0_15:1.7
	REL8_1_11:1.7
	REL7_3_20:1.6
	REL7_4_18:1.6
	REL8_0_14:1.7
	REL8_1_10:1.7
	REL7_3_19:1.6
	REL7_4_17:1.6
	REL8_0_13:1.7
	REL8_1_9:1.7
	REL8_0_12:1.7
	REL8_1_8:1.7
	REL7_3_18:1.6
	REL7_4_16:1.6
	REL8_0_11:1.7
	REL8_1_7:1.7
	REL8_0_10:1.7
	REL8_1_6:1.7
	REL7_4_15:1.6
	REL7_3_17:1.6
	REL8_1_5:1.7
	REL8_0_9:1.7
	REL7_4_14:1.6
	REL7_3_16:1.6
	REL7_3_15:1.6
	REL7_4_13:1.6
	REL8_0_8:1.7
	REL8_1_4:1.7
	REL7_3_14:1.6
	REL7_4_12:1.6
	REL8_0_7:1.7
	REL8_1_3:1.7
	REL7_3_13:1.6
	REL7_4_11:1.6
	REL8_0_6:1.7
	REL8_1_2:1.7
	REL7_3_12:1.6
	REL7_4_10:1.6
	REL8_0_5:1.7
	REL8_1_1:1.7
	REL8_1_STABLE:1.7.0.6
	REL8_1_0:1.7
	REL8_1_0RC1:1.7
	REL8_1_0BETA4:1.7
	REL8_1_0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_0_PATCHES:1.3.0.2
	REL7_0:1.3;
locks; strict;
comment	@# @;


1.8
date	2006.01.05.01.56.28;	author momjian;	state dead;
branches;
next	1.7;

1.7
date	2004.03.23.01.23.47;	author tgl;	state Exp;
branches;
next	1.6;

1.6
date	2002.07.09.04.47.07;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2001.12.21.06.00.15;	author thomas;	state Exp;
branches;
next	1.4;

1.4
date	2001.05.24.15.53.31;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	2000.04.04.13.49.29;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	2000.03.01.19.11.05;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2000.02.15.05.22.36;	author thomas;	state Exp;
branches;
next	;


desc
@@


1.8
log
@Remove QNX port.
@
text
@PostgreSQL on QNX 4
--------------------
last updated:           $Date: 2004/03/23 01:23:47 $

current maintainer:     Bernd Tegge (tegge@@repas-aeg.de)
original author:        Andreas Kardos (kardos@@repas-aeg.de)

This port is an important step because PostgreSQL is still the only free
relational database with full SQL and ODBC support available for QNX 4.
The only commercial databases available are Empress RDBMS and Velocis
Database Server (not supported for Digital Unix).

The most effort required the emulation of System V semaphore sets,
shared memory and IPC and of some IEEE floating-point functionality.

It is recommended to use the GNU C compiler instead of the Watcom compiler
because the Watcom compiler doesn't support a int8 datatype (long or
long long int) and it does not have a C++ frontend. The only advantage
using Watcom C would be support of Tk and pgaccess.

QNX 4 does not offer native support of shared libraries. Therefore the related
functionality cannot be used. Shared library support could probably be
implemented in future.

QNX 4 does not support UNIX domain sockets. Clients must use TCP/IP
sockets. Therefore, do not set "listen_addresses" to empty in your
postgresql.conf file.  In fact, it's advisable to explicitly set
"listen_addresses" in an environment using native QNX networking.
Otherwise the postmaster might not use the IP-Address you think it does :-)

Prerequisites:
--------------

The following prerequisites have been used:

QNX standard:
QNX 4.25, Watcom C 10.6, GNU make

Available from http://www.teaser.fr/~jcmichot/
flex-2.5.4a.tar.gz (flex)
egcs-112-qnx4-r20.tar[.gz] (GNU C)

Available from ftp://ftp.visi.com/users/hawkeyd/qnx/
bison-1.2.5.tar.gz

Available from http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/
perl 5.004_04

from ftp://ftp.freesoftware.com/pub/infozip/zlib/
zlib 1.1.3

tcl8.0.3.tar.Z (Tcl)

In order to achieve meaningful results for the regression tests, you need
a different shell. The standard QNX shell is quite broken with regard to
scripting (even QSSL suggested to use pdksh or bash). Both are available
in source and binaries at
http://quics.qnx.com/cgi-bin/dir_find.cgi?/usr/free/

flex can be built without any problems using the Watcom or GNU C compilers.

The current version of bison (1.2.8 at the time of this writing) does not
build cleanly on QNX4 with gcc installed, but you can download src and
binary of a previous version from the above mentioned ftp site.

download source
GNU C can be installed by
/etc/install -u egcs112-qnx4-r20.tar[.gz]

Although Tcl can be built after some slight code changes using the Watcom
compiler, the GNU C compiler should be used instead. Otherwise it would be
impossible to link postgres built with GNU C together with libtcl8.0.a built
with the Watcom compiler. However, if you are going to build a Watcom version
you must build the tcl and tk libraries with Watcom too.

To make unix/tclUnixTest.c compilable uncomment
#include <sys/resource.h>
in it or
touch /usr/include/sys/resource.h
In unix/Makefile.in replace
	( echo cd $(TOP_DIR)/tests\; source all ) | ./tcltest
by
	( echo cd ../tests\; source all ) | ./tcltest
After that Tcl can be built and tested as stated in README.

Tk cannot be built with GNU C due to the lack of a stack version of the
X11 library. With the Watcom compiler Tk could be built but this is not useful
because of the link problems mentioned above.

Therefore the Tk interface and the pgaccess tool cannot be supported for a GNU C
version of PostgreSQL on QNX 4.

PostgreSQL:
-----------

On QNX 4 some headers are not in the directories expected. To avoid
modifications of the code the following links should be made:

ln -s /usr/local/bin/perl /usr/local/bin/perl5
ln -s /usr/include/errno.h /usr/include/sys/errno.h
ln -s /usr/include/ioctl.h /usr/include/sys/ioctl.h
ln -s /usr/src/pgsql/src/backend/port/qnx4/ipc.h /usr/include/sys/ipc.h
ln -s /usr/src/pgsql/src/backend/port/qnx4/sem.h /usr/include/sys/sem.h
ln -s /usr/src/pgsql/src/backend/port/qnx4/shm.h /usr/include/sys/shm.h

For ecgs-2.91.60 the file
/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.66/include/g++/stl_alloc.h
had to be patched (extern "C++" { ... } // extern "C++").
See attached patch.

If all prerequisites are available postgres can be built and installed by
cd pgsql/src
./configure --with-tcl --without-tk --with-perl
gmake > make.log 2>&1
gmake install > make.install.log 2>&1
su
cd interfaces/perl5
gmake install
exit

All other steps can be carried out as stated in the INSTALL file.

Make problems:
--------------

Sometimes the Watcom library manager wlib crashes with SIGSEGV on some
object files. This is a general problem and not PostgreSQL related.
Currently bootstrap.o causes such a crash. The workaround is not to include
the object file into the SUBSYS.o but link it directly. For further information
see backend/Makefile and backend/bootstrap/Makefile.
libpgsql.a currently cannot be generated because of the same problem. But this
doesn't matter since shared libraries are not supported.
(The Makefiles are already changed to ignore this, you don't have to
do anything)

Regression tests:
-----------------
please don't use the QNX shell for the parallel regression tests. Download
bash from quics.qnx.com and run 'make SHELL=/usr/local/bin/bash check'
instead.

The majority of regression tests succeeded. The following tests failed:

geometry:
Some slight deviation in the last digit and "0" instead of "-0".
Can be ignored.

timestamp, tinterval, abstime, horology:
Differences for years before the UNIX epoch. The QNX library probably treats
time_t as unsigned -> dates before 1970 get moved into the far future.
Can be ignored.

create_function_1, create_function_2, create_type, create_operator,
create_view, select_views, triggers, misc, plpgsql:
Error messages due to the lack of shared library support.

rules, select_views:
looks like it fails because it depends on tables created by previously
failing tests.

alter_table:
An expected failure message contains one blank more than expected.
Possibly a faulty output file.

int8, subselect, union
fails for Watcom version because of lacking int8 support.

The current state of this port should be sufficient for lot of applications.


Have fun!

Andreas Kardos
2000-04-04

Bernd Tegge
tegge@@repas-aeg.de
2001-12-10

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

*** ./stl_alloc.h.orig	Sat Feb 28 05:17:28 1998
--- ./stl_alloc.h	Tue Nov 23 04:14:09 1999
***************
*** 120,125 ****
--- 120,126 ----
  #pragma set woff 1174
  #endif
  
+ extern "C++" {
  // Malloc-based allocator.  Typically slower than default alloc below.
  // Typically thread-safe and more storage efficient.
  #ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
***************
*** 682,687 ****
--- 683,689 ----
  # endif
  
  #endif /* ! __USE_MALLOC */
+ } // extern "C++"
  
  #if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
  #pragma reset woff 1174


Patch required to build with gcc:

*** /usr/src/postgresql-7.2b3/src/backend/port/qnx4/sem.h       Thu Nov  8 21:37:52 2001
--- src/backend/port/qnx4/sem.h Mon Dec 10 13:22:18 2001
***************
*** 55,60 ****
--- 55,71 ----
        ushort_t        sem_num;                /* semaphore #                  */
        short           sem_op;                 /* semaphore operation          */
        short           sem_flg;                /* operation flags              */
+ };
+
+ /*
+  * command union for semctl.
+  */
+
+ union semun {
+   int val;                    /* value for SETVAL */
+   struct semid_ds *buf;       /* buffer for IPC_STAT, IPC_SET */
+   unsigned short int *array;  /* array for GETALL, SETALL */
+   struct seminfo *__buf;      /* buffer for IPC_INFO */
  };

  extern int    semctl(int semid, int semnum, int cmd, /* ... */ union semun arg);
@


1.7
log
@Replace the virtual_host and tcpip_socket parameters with a unified
listen_addresses parameter, as per recent discussion.  The default behavior
is now to listen on localhost, which eliminates the need for the -i
postmaster switch in many scenarios.

Andrew Dunstan
@
text
@d3 1
a3 1
last updated:           $Date: 2001/12/21 06:00:15 $
@


1.6
log
@Fix typo mentioned by Rich Morin.
@
text
@d26 3
a28 4
sockets. Therefore you either have to set "tcpip_socket = true" in
your postgresql.conf or to start postmaster with the -i option.
Furthermore it's advisable to set to set the PGHOST or SOCK environment
variable for postmaster in an environment using native QNX networking.
@


1.5
log
@Updates for next release from Bernd Tegge.
@
text
@d1 1
a1 1
PostgresSQL on QNX 4
d3 1
a3 1
last updated:           $Date: 2001/12/10 $
@


1.4
log
@I haven't tried building postgres with the Watcom compiler for 7.1 because
it does not support 64bit integers. AFAIK that's the default data type for
OIDs, so I am not surprised that this does not work. Use gcc instead.
BTW., 7.1 does not compile as is with gcc either, I believed the
required patches made it into the 7.1.1 release but obviously I missed
the deadline.
Since the ports mailing list does not seem to be archived I have attached
a copy of the patch (for 7.1 and 7.1.1).

I've just performed a build of a Watcom compiled version and found a couple
of bugs in the watcom specific part of that patch. Please use the attached
version instead.

Tegge, Bernd
@
text
@d3 1
a3 1
last updated:           $Date: 2001/04/30 23:55:26 $
d8 1
a8 1
This port is an important step because PostgreSQL is now the only free
d25 6
a30 3
QNX 4 does not support UNIX domain sockets. Clients must use TCP/IP sockets.
Therefore postmaster must always be started with the -i option. Furthermore
it would be useful to set the PGHOST variable.
d134 2
a135 8

Currently yacc fails on backend/parser/gram.y and 
interfaces/ecpg/preproc/preproc.y due to exceeded maximum table size. You can
generate the gram.h, parse.h, preproc.h and preproc.c files on another platform
and use them. This is only a problem when you use the current source tree since
parse.h, gram.c, preproc.h and preproc.c are included in official
distributions. In order to avoid this, install the bison binary mentioned
above.
d150 2
a151 2
Differences for years outside the normal Unix range, e.g. 1968
instead of 2105
a153 6
rules:
"ERROR:  Bad money external representation ..."
if a value of type money is inserted in string representation e.g. as in
"insert into rtest_emp values ('wiech', '5000.00');"
Subject of further investigation.

d158 10
a167 7
numeric, numeric_big, sanity_check:
"ERROR:  Cannot create unique index. Table contains non-unique values"
This error occurs for indices of tables num_exp_add, num_exp_sub,
num_exp_div and num_exp_mul only.
Subject of further investigation. Probably because of the missing indices
these numeric tests take a long time.
The diffence in sanity_check.out is a consequence of this problem only.
a170 2
The Watcom version failed additional tests because of the lack of int8
support.
d179 1
a179 1
2001-03-01
d206 25
@


1.3
log
@Update QNX FAQ
@
text
@d3 4
d14 1
a14 2
shared memory and IPC and of some IEEE floating-point functionality. For
the Watcom compiler spinlocks have been implemented using POSIX semaphores.
d16 1
a16 1
It is recomended to use the GNU C compiler instead of the Watcom compiler
d18 2
a19 5
long long int) and it does not have a C++ frontend.
It could be managed to build postgres using the Watcom compiler but it crashes
quite early. These problems probably could be solved. The only advantage would
be support of Tk and pgaccess. For the Watcom compiler some more modifications
have to be made which are not described here.
d25 3
a27 3
QNX 4 does not support UNIX domain sockets. Connections can only be made
with TCP/IP sockets. Therefore postmaster must always be started with the
-i option. Furthermore it would be useful to set the PGHOST variable.
d34 4
a37 3
QNX 4.25
Watcom C 10.6
GNU make
d39 6
a44 1
egcs111-qnx4-r20.tar[.gz] (GNU C)
d46 4
d52 6
d60 5
d66 1
a66 1
/etc/install -u egcs111-qnx4-r20.tar[.gz]
d71 3
a73 1
with the Watcom compiler.
d105 1
a105 1
/usr/local/lib/gcc-lib/i386-pc-qnx4/egcs-2.91.60/include/g++/stl_alloc.h
a108 3
If you use another ecpg version the include/g++ path in Makefile.qnx4
(CXXFLAGS) has to be adopted.

d111 2
a112 2
./configure --with-tcl --with-perl --with-x
gmake all > make.log 2>&1
d136 3
a138 2
parse.h, gram.c, preproc.h and preporc.c are included in official
distributions.
d142 3
d163 2
a164 1
create_function_2, triggers, misc, plpgsql:
d175 4
a178 1
The reached state of this port should be sufficient for lot of applications.
a182 1
kardos@@repas-aeg.de
d185 3
@


1.2
log
@Add QNX fixes from Kardos, Dr. Andreas
@
text
@d133 6
d156 1
a156 1
2000-02-28
@


1.1
log
@Rename file to be consistant with other platform-specific FAQs.
@
text
@d112 5
a116 4
Currently yacc fails on interfaces/ecpg/preproc/preproc.y because of
exceeded maximum table size. You can generate the preproc.h and preproc.c
files on another platform and use them. This is only a problem when you use
the current source tree since preproc.h and preporc.c are included in official
a123 12
int2, int4:
Error message "Result too large" instead of "Numerical result out of range".
Can be ignored.

int8, float4: 
Exponent expression "e+nnn" instead of "e+nn". Can be ignored.

float8:
Exponent expression "e+nnn" instead of "e+nn" and some slight difference
in the last digit.
Can be ignored.

d128 1
a128 1
datetime, abstime, tinterval, horology:
d136 4
a139 5
rules:
Subject of further investigation.

numeric, numeric_big:
ERROR:  Cannot create unique index. Table contains non-unique values
d141 2
a142 1
these tests take a long time.
d150 1
a150 1
1999-12-16
@
