Commit Graph

473 Commits

Author SHA1 Message Date
Bruce Momjian bf50caf105 pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
Peter Eisentraut 11745364d0 Add collation support on Windows (MSVC build)
There is not yet support in initdb to populate the pg_collation
catalog, but if that is done manually, the rest should work.
2011-04-10 00:15:41 +03:00
Andrew Dunstan 48c9de8028 Fix typo 2011-01-30 20:34:05 -05:00
Andrew Dunstan 91812df4ed Enable building with the Mingw64 compiler.
This can be used to build 64 bit Windows binaries, not only on 64 bit
Windows but on supported cross-compiling hosts including 32 bit Windows,
Cygwin, Darwin and Linux.
2011-01-30 19:56:46 -05:00
Magnus Hagander dcb09b595f Support for collecting crash dumps on Windows
Add support for collecting "minidump" style crash dumps on
Windows, by setting up an exception handling filter. Crash
dumps will be generated in PGDATA/crashdumps if the directory
is created (the existance of the directory is used as on/off
switch for the generation of the dumps).

Craig Ringer and Magnus Hagander
2010-12-19 16:45:28 +01:00
Tom Lane 5132ad8bdf Make S_IRGRP etc available in mingw builds as well as MSVC.
(Hm, I wonder whether BCC defines them either...)

Also label dangling endifs a bit better in this area.
2010-12-12 13:43:44 -05:00
Tom Lane 1319002e2e Provide a complete set of file-permission-bit macros in win32.h.
My previous patch exposed the fact that we didn't have these.  Those
hard-wired octal constants were actually wrong on Windows, not just
inconsistent.
2010-12-11 13:11:18 -05:00
Tom Lane 576477e73c Force default wal_sync_method to be fdatasync on Linux.
Recent versions of the Linux system header files cause xlogdefs.h to
believe that open_datasync should be the default sync method, whereas
formerly fdatasync was the default on Linux.  open_datasync is a bad
choice, first because it doesn't actually outperform fdatasync (in fact
the reverse), and second because we try to use O_DIRECT with it, causing
failures on certain filesystems (e.g., ext4 with data=journal option).
This part of the patch is largely per a proposal from Marti Raudsepp.
More extensive changes are likely to follow in HEAD, but this is as much
change as we want to back-patch.

Also clean up confusing code and incorrect documentation surrounding the
fsync_writethrough option.  Those changes shouldn't result in any actual
behavioral change, but I chose to back-patch them anyway to keep the
branches looking similar in this area.

In 9.0 and HEAD, also do some copy-editing on the WAL Reliability
documentation section.

Back-patch to all supported branches, since any of them might get used
on modern Linux versions.
2010-12-08 20:01:09 -05:00
Itagaki Takahiro 844ed5dc97 Don't use __declspec (dllimport) for PGDLLEXPORT to reduce warnings
by gcc version 4 on mingw and cygwin. We don't use dllexport here
because dllexport and dllwrap don't work well together.
2010-11-10 12:17:43 +09:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Tom Lane 9eef3318a2 Fix several broken $PostgreSQL$ keywords. Noted while experimenting
with Magnus's script to remove these.
2010-09-19 16:17:45 +00:00
Bruce Momjian 239d769e7e pgindent run for 9.0, second run 2010-07-06 19:19:02 +00:00
Itagaki Takahiro e54b0cba96 PGDLLEXPORT is __declspec (dllexport) only on MSVC,
but is __declspec (dllimport) on other compilers
because cygwin and mingw don't like dllexport.
2010-05-28 16:34:15 +00:00
Itagaki Takahiro 77e50a61ff Mark PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 with PGDLLEXPORT
independently from BUILDING_DLL. It is always __declspec(dllexport).
2010-05-27 07:59:48 +00:00
Magnus Hagander 215cbc90f8 Add emulation of non-blocking sockets to the win32 socket/signal layer,
and use this in pq_getbyte_if_available.

It's only a limited implementation which swithes the whole emulation layer
no non-blocking mode, but that's enough as long as non-blocking is only
used during a short period of time, and only one socket is accessed during
this time.
2010-02-16 19:26:02 +00:00
Tom Lane e08ab7c312 Support inlining various small performance-critical functions on non-GCC
compilers, by applying a configure check to see if the compiler will accept
an unreferenced "static inline foo ..." function without warnings.  It is
believed that such warnings are the only reason not to declare inlined
functions in headers, if the compiler understands "inline" at all.

Kurt Harriman
2010-02-13 02:34:16 +00:00
Magnus Hagander 0a27347141 Make RADIUS authentication use pg_getaddrinfo_all() to get address of
the server.

Gets rid of a fairly ugly hack for Solaris, and also provides hostname
and IPV6 support.
2010-02-02 19:09:37 +00:00
Magnus Hagander 21d3ae09da Define INADDR_NONE on Solaris when it's missing. Per a couple of buildfarm
members complaining.
2010-01-28 11:36:14 +00:00
Magnus Hagander c3705d8cc5 Make ssize_t 64-bit on Win64, for compatibility with for example plpython. 2010-01-02 22:47:37 +00:00
Magnus Hagander 9f0e84a65d Change our WIN32 API version to be 5.01 (Windows XP), to bring in the proper
IPV6 headers in newer SDKs.
2009-09-07 11:22:12 +00:00
Magnus Hagander a7e587863c Reserve the shared memory region during backend startup on Windows, so
that memory allocated by starting third party DLLs doesn't end up
conflicting with it.

Hopefully this solves the long-time issue with "could not reattach
to shared memory" errors on Win32.

Patch from Tsutomu Yamada and me, based on idea from Trevor Talbot.
2009-07-24 20:12:42 +00:00
Bruce Momjian d747140279 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.
2009-06-11 14:49:15 +00:00
Tom Lane ce53791b2a Assorted portability fixes for Borland C, from Pavel Golub. 2009-04-19 22:37:13 +00:00
Magnus Hagander 0154345078 Make win32 builds always do SetEnvironmentVariable() when doing putenv().
Also, if linked against other versions than the default MSVCRT library
(for example the MSVC build which links against MSVCRT80), also update
the cache in the default MSVCRT at the same time.

This should fix the issues with setting LC_MESSAGES on the MSVC build.

Original patch from Hiroshi Inoue and Hiroshi Saito, much rewritten
by me.
2009-01-21 10:30:02 +00:00
Bruce Momjian d00a3472cf Update MinGW so it handles fseeko() similar to Unix. 2009-01-07 03:39:33 +00:00
Peter Eisentraut 21a743e886 Move carefully obscured SunOS 4 specific #include out of c.h into port
header file.  SunOS 4 is probably broken anyway, but this item stuck out as
completely weird.
2008-12-11 09:17:07 +00:00
Andrew Dunstan 53972b460c Add $PostgreSQL$ markers to a lot of files that were missing them.
This particular batch was just for *.c and *.h file.

The changes were made with the following 2 commands:

find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o  \( -name '*.[ch]'  \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *'

find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o  \( -name '*.[ch]'  \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */'
2008-05-17 01:28:26 +00:00
Tom Lane cd00406774 Replace time_t with pg_time_t (same values, but always int64) in on-disk
data structures and backend internal APIs.  This solves problems we've seen
recently with inconsistent layout of pg_control between machines that have
32-bit time_t and those that have already migrated to 64-bit time_t.  Also,
we can get out from under the problem that Windows' Unix-API emulation is not
consistent about the width of time_t.

There are a few remaining places where local time_t variables are used to hold
the current or recent result of time(NULL).  I didn't bother changing these
since they do not affect any cross-module APIs and surely all platforms will
have 64-bit time_t before overflow becomes an actual risk.  time_t should
be avoided for anything visible to extension modules, however.
2008-02-17 02:09:32 +00:00
Magnus Hagander 8d546c7170 Don't enforce 32-bit time_t for FRONTEND apps. Fixes standalone
builds of libpq in both 32 and 64-bit. Per gripe from Hiroshi Saito.
2008-01-09 09:16:43 +00:00
Magnus Hagander 22867ab986 Use _USE_32BIT_TIME_T when building with MSVC. Also, enforce that it's
used when building addons.

Dave Page
2007-12-11 14:34:43 +00:00
Bruce Momjian 0d072761d3 Borland BCC does not support SSPI, per cnliou9@fastmail.fm. 2007-11-24 01:55:26 +00:00
Bruce Momjian 7a1b72f6ef Borland CC 5.5.1 needs ssize_t, per cnliou9@fastmail.fm. 2007-11-24 01:32:48 +00:00
Bruce Momjian fdf5a5efb7 pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
Magnus Hagander 6f14effbf9 New versions of mingw have gettimeofday(), so add an autoconf test
for this.
2007-10-29 11:25:42 +00:00
Magnus Hagander bb98b2e27e Change win32 child-death tracking code to use a threadpool to wait for
childprocess deaths instead of using one thread per child. This drastastically
reduces the address space usage and should allow for more backends running.

Also change the win32_waitpid functionality to use an IO Completion Port for
queueing child death notices instead of using a fixed-size array.
2007-10-26 21:50:10 +00:00
Magnus Hagander 906b2e1b37 Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict with
third party includes (like tcl) that define DLLIMPORT.
2007-07-25 12:22:54 +00:00
Magnus Hagander d602592494 Make it possible, and default, for MingW to build with SSPI support
by dynamically loading the function that's missing from the MingW
headers and library.
2007-07-24 09:00:27 +00:00
Tom Lane 1c7fe33fdb Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl().
This is a Linux kernel bug that apparently exists in every extant kernel
version: sometimes shmctl() will fail with EIDRM when EINVAL is correct.
We were assuming that EIDRM indicates a possible conflict with pre-existing
backends, and refusing to start the postmaster when this happens.  Fortunately,
there does not seem to be any case where Linux can legitimately return EIDRM
(it doesn't track shmem segments in a way that would allow that), so we can
get away with just assuming that EIDRM means EINVAL on this platform.

Per reports from Michael Fuhr and Jon Lapham --- it's a bit surprising
we have not seen more reports, actually.
2007-07-02 20:11:55 +00:00
Tom Lane 37a609b27f Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be
right, there seems precious little reason to have a pile of hand-maintained
endianness definitions in src/include/port/*.h.  Get rid of those, and make
the couple of places that used them depend on WORDS_BIGENDIAN instead.
2007-04-06 05:36:51 +00:00
Magnus Hagander 1ca6ab1c78 Remove headers for old sysv shmem emulation that I forgot.
Also remove headers for old sysv semaphore emulation that were forgotten
when that was changed about a year ago.
2007-03-23 08:30:55 +00:00
Tom Lane 4355d214c2 On Windows, use pgwin32_waitforsinglesocket() instead of select() to wait for
input in the stats collector.  Our select() emulation is apparently buggy
for UDP sockets :-(.  This should resolve problems with stats collection
(and hence autovacuum) failing under more than minimal load.  Diagnosis
and patch by Magnus Hagander.

Patch probably needs to be back-ported to 8.1 and 8.0, but first let's
see if it makes the buildfarm happy...
2007-01-26 20:06:52 +00:00
Bruce Momjian 70268b50dd Update Win32 exception comment. 2007-01-25 21:50:49 +00:00
Bruce Momjian 867c133599 Add comment about exception lists in both winnt.h and ntstatus.h. 2007-01-23 16:21:17 +00:00
Bruce Momjian 882b9948d7 Back out use of FormatMessage(), does error values, not exception
values.  Point to /include/ntstatus.h for an exception list, rather than
a URL.
2007-01-23 03:28:49 +00:00
Bruce Momjian 610f60a092 Print meaningfull error text for abonormal process exit on Win32, rather
than hex codes, using FormatMessage().
2007-01-23 01:45:11 +00:00
Bruce Momjian d26a5f1fea Uppercase hex value. 2007-01-22 18:32:57 +00:00
Bruce Momjian 208ae0c290 When system() fails in Win32, report it as an exception, print the
exception value in hex, and give a URL where the value can be looked-up.
2007-01-22 18:31:51 +00:00
Bruce Momjian a5ec2ec77a Allow Borland CC to compile libpq and psql.
Backpatch to 8.2.X.

L Bayuk
2007-01-11 02:42:31 +00:00
Tom Lane c4e7e675d8 Make sure BYTE_ORDER gets defined in 64-bit builds on Solaris,
per Stefan Kaltenbrunner.
2007-01-10 18:22:50 +00:00
Bruce Momjian cac2d912d9 finite() no longer used; remove finite() platform-specific
infrastructure.
2007-01-02 21:25:50 +00:00
Tom Lane f6e00ae128 Further MSVC portability fixes from Magnus. 2006-10-19 20:03:08 +00:00
Tom Lane b2c04d5e6b Work around buggy strtod on (some versions of?) IRIX. Combination of
proposed patches from John Jorgensen and Steve Singer.
2006-10-05 01:40:45 +00:00
Bruce Momjian 03ea9ecbda Update Solaris strtod() bug comment. 2006-10-04 22:49:44 +00:00
Bruce Momjian 50a3fb9f22 Update Solaris strtol() bug comment. 2006-10-04 22:48:41 +00:00
Bruce Momjian f99a569a2e pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
Tom Lane 0184c6835c Rearrange MSVC errcode hack, fix incorrect _MSC_VER test. Magnus 2006-10-03 20:33:20 +00:00
Bruce Momjian 878f32feab Move WIN32_ONLY_COMPILER define from c.h to win32.h because it was being
defined too late.
2006-10-03 03:59:22 +00:00
Tom Lane 801cbe3310 Define errcode as __msvc_errcode not __vc_errcode for MSVC builds,
per Magnus.
2006-09-16 13:35:49 +00:00
Bruce Momjian e860e746e1 Return inline to win32.h because code was OK, but keep additional
comment.  8.1.X is not affected by this commit.
2006-08-10 01:41:29 +00:00
Bruce Momjian 3929b6e9f6 Move "#define inline __inline" from port/win32.h to c.h because Win32
interface builds like libpq need it.

Backpatch addition to 8.1.X.
2006-08-10 01:35:21 +00:00
Bruce Momjian f896b5e146 Formatting improvement. 2006-08-09 17:33:52 +00:00
Bruce Momjian c554bf878f Fix definition of "errcode" for MSVC.
Hiroshi Saito
2006-08-08 18:49:14 +00:00
Bruce Momjian 1a271f0c71 Fix WIN32 wait() return value macros to be accurate, particularly
because they are used for testing the return value from system().
(WIN32 doesn't overlay the return code with other failure conditions
like Unix does, so they are just simple macros.)

Fix regression checks to properly handle diff failures on Win32 using
the new macros.
2006-07-30 01:45:21 +00:00
Tom Lane 93120f3501 In a Windows backend, don't build src/port/pgsleep.c's version of
pg_usleep at all.  Instead call the replacement function in
port/win32/signal.c by that name.  Avoids tricky macro-redefinition
logic and suppresses a compiler warning; furthermore it ensures that
no one can accidentally use the non-signal-aware version of pg_usleep
in a Windows backend.
2006-07-16 20:17:04 +00:00
Tom Lane 808849e54f Fix lack of repeat-inclusion guard in win32 substitute sys/socket.h.
I think this explains the 'implicit declaration of function gai_strerror'
warnings visible in the current buildfarm report from snake: if
sys/socket.h is included again after getaddrinfo.h, the file would
merrily undefine the gai_strerror macro.
2006-07-16 01:35:28 +00:00
Tom Lane c713683fd7 Reverse inclusion order of <ws2tcpip.h> and <winsock2.h>, per Dave Page. 2006-07-11 14:25:09 +00:00
Bruce Momjian e56756e94e Use Unix line endings instead of DOS ones, per Magnus. 2006-06-26 12:59:44 +00:00
Bruce Momjian e2fee8cf6d Update include files to Unix newline format, per report from Magnus. 2006-06-26 12:52:12 +00:00
Bruce Momjian 399a36a75d Prepare code to be built by MSVC:
o  remove many WIN32_CLIENT_ONLY defines
	o  add WIN32_ONLY_COMPILER define
	o  add 3rd argument to open() for portability
	o  add include/port/win32_msvc directory for
	   system includes

Magnus Hagander
2006-06-07 22:24:46 +00:00
Bruce Momjian f3d99d160d Add CVS tag lines to files that were lacking them. 2006-03-11 04:38:42 +00:00
Bruce Momjian 502e9aefdc Clarify macro layout for win32 IMPORT. 2006-03-03 20:52:36 +00:00
Tom Lane 558bc2584d Fix fsync code to test whether F_FULLFSYNC is available, instead of
assuming it always is on Darwin.  Per report from Neil Brandt.
2006-01-17 23:52:31 +00:00
Andrew Dunstan ad24b8e6ee remove unneeded defines for uid_t and gid_t, which conflict with perl's typedefs. 2006-01-10 01:01:03 +00:00
Bruce Momjian 44f9021223 Remove BEOS port. 2006-01-05 03:01:38 +00:00
Bruce Momjian 6f84b2da75 Remove QNX file. 2006-01-05 02:43:38 +00:00
Tom Lane 25777f6fd3 Fix Windows setitimer() emulation to not depend on delivering an APC
to the main thread.  This allows removal of WaitForSingleObjectEx() calls
from the main thread, thereby allowing us to re-enable Qingqing Zhou's
CHECK_FOR_INTERRUPTS performance improvement.  Qingqing, Magnus, et al.
2005-10-25 15:15:16 +00:00
Tom Lane 6aad07d270 Improve performance of CHECK_FOR_INTERRUPTS() macro on Windows by not doing
a kernel call unless there's some evidence of a pending signal.  This should
bring its performance on Windows into line with the Unix version.  Problem
diagnosis and patch by Qingqing Zhou.  Minor stylistic tweaks by moi ...
if it's broken, it's my fault.
2005-10-21 21:43:46 +00:00
Bruce Momjian 1dc3498251 Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
Tom Lane a310a1d80c Some more mop-up for Windows IPv6 support. Andrew Dunstan 2005-08-26 03:15:12 +00:00
Bruce Momjian 26cbccd52c Add fsync() define for Win32 to cover cases other than wal_sync_method
where we need fsync().
2005-06-16 17:53:54 +00:00
Bruce Momjian 6dc7760ac3 Add support for wal_fsync_writethrough for Darwin, and restructure the
code to better handle writethrough.

Chris Campbell
2005-05-20 14:53:26 +00:00
Bruce Momjian b1f57d88f5 Change Win32 O_SYNC method to O_DSYNC because that is what the method
currently does.  This is now the default Win32 wal sync method because
we perfer o_datasync to fsync.

Also, change Win32 fsync to a new wal sync method called
fsync_writethrough because that is the behavior of _commit, which is
what is used for fsync on Win32.

Backpatch to 8.0.X.
2005-03-24 04:36:20 +00:00
Bruce Momjian afbc30e5d4 Allow Win32 to support the O_SYNC open flag as an wal_sync_method method.
Magnus Hagander
2005-02-27 00:53:29 +00:00
Tom Lane 5cfdd68f84 Rearrange include file contents into a saner order, add inclusion of
<signal.h>.  Per Andrew Dunstan.
2004-12-26 19:20:33 +00:00
Bruce Momjian ee9007a2e1 Allow libpq to build on MS Visual Studio .NET 2003 on Windows XP. 2004-12-01 23:42:26 +00:00
Tom Lane 0021ae06be Fix Win32 problems with signals and sockets, by making the forkexec code
even uglier than it was already :-(.  Also, on Windows only, use temporary
shared memory segments instead of ordinary files to pass over critical
variable values from postmaster to child processes.  Magnus Hagander
2004-11-17 00:14:14 +00:00
Bruce Momjian aa20badeaf Fix improper defines for uid_t and gid_t. Had them backwards. 2004-10-06 17:47:53 +00:00
Bruce Momjian 87ea6f0dbe Use #define instead of typedef for plperl because perl defines
uid_t/gid_t too.
2004-10-06 16:36:02 +00:00
Bruce Momjian 902ca3e225 Here is a patch to fix win32 ssl builds. Summary of changes:
* Links with -leay32 and -lssleay32 instead of crypto and ssl. On win32,
"crypto and ssl" is only used for static linking.

* Initializes SSL in the backend and not just in the postmaster. We
cannot pass the SSL context from the postmaster through the parameter
file, because it contains function pointers.

* Split one error check in be-secure.c. Previously we could not tell
which of three calls actually failed. The previous code also returned
incorrect error messages if SSL_accept() failed - that function needs to
use SSL_get_error() on the return value, can't just use the error queue.

* Since the win32 implementation uses non-blocking sockets "behind the
scenes" in order to deliver signals correctly, implements a version of
SSL_accept() that can handle this. Also, add a wait function in case
SSL_read or SSL_write() needs more data.

Magnus Hagander
2004-10-06 09:35:23 +00:00
Bruce Momjian 4d47db363b Fix typo in recent Win32 typedef change. 2004-10-05 14:27:07 +00:00
Bruce Momjian 2def476de3 Remove unused Win32 defines, convert them to typdefs, per suggestion
from Peter.
2004-10-05 13:48:35 +00:00
Bruce Momjian e1c8b37afb Add new macro as shorthand for MS VC and Borland C++:
+ #if   defined(_MSC_VER) || defined(__BORLANDC__)
+ #define       WIN32_CLIENT_ONLY
+ #endif
2004-09-27 23:24:45 +00:00
Tom Lane 4f7d3e0faf Win32 compile fix for misc_utils.
Claudio Natoli
2004-09-14 03:50:17 +00:00
Bruce Momjian f1d1116178 Fix Cygwin defines to be consistent. 2004-09-09 00:59:49 +00:00
Tom Lane cb79234307 Apparently HPUX runs the IA64 in big-endian mode. 2004-09-02 21:03:30 +00:00
Bruce Momjian b4456e6d6a Define lstat with parameters, rather than just redefining the symbol. 2004-08-31 11:29:56 +00:00
Bruce Momjian 2e88d29f88 Fix typo in lstat() macro exposed by new tablespace code. 2004-08-31 11:25:33 +00:00
Bruce Momjian b6b71b85bc Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
Bruce Momjian 704ff0b2f2 >>> I understand your disliking of non-posix stuff. OTOH,
>>GetLastError will
>>> give much more details than errno.
>>
>>How much more, really?  That mapping table gave me the impression that
>>the win32 error codes aren't all that much more detailed than errno...
>
>The mapping table is not complete. My winerror.h from the SDK
>lists 2209
>error codes, whereas errno.h lists 42...
>
>I still don't think we'll get that much more stuff. Right now,
>the Win32
>code paths that actually use the more advanced functions already write
>out the error number in case something happens. We can keep doing that
>for the other paths (ereport the error *number* when the mapping does
>not have a match). The map to errno will catch almost all cases, I
>think. And in the corner cases we can do with just the number, and use
>"net helpmsg" to get the actual message when checking...

Here's an attempt on this. new file goes in backend/port/win32.

Magnus Hagander
2004-08-29 00:38:03 +00:00
Tom Lane b2d9fbeef2 Work around broken strtod() that's present in many Solaris releases.
Thanks to Michael Fuhr for identifying the problem.
2004-08-11 17:20:50 +00:00
Bruce Momjian 25c161eba6 Move Win32 defines from port.h to win32.h. 2004-07-23 01:58:36 +00:00
Tom Lane b15f9b08ef Replace direct fprintf(stderr) calls by write_stderr(), and cause this
routine to do something appropriate on Win32.  Also, add a security check
on Win32 that parallels the can't-run-as-root check on Unix.

Magnus Hagander
2004-06-24 21:03:42 +00:00
Bruce Momjian 83526ccf06 Cleanup for Win32 pgkill. 2004-05-27 14:39:33 +00:00
Bruce Momjian 6f21f4adaa Move pgkill out into /port so pg_ctl can use it on Win32. 2004-05-27 13:08:57 +00:00
Bruce Momjian 178c08d0c7 Rename another irix file. 2004-05-19 21:39:16 +00:00
Tom Lane 0bd61548ab Solve the 'Turkish problem' with undesirable locale behavior for case
conversion of basic ASCII letters.  Remove all uses of strcasecmp and
strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp;
remove most but not all direct uses of toupper and tolower in favor of
pg_toupper and pg_tolower.  These functions use the same notions of
case folding already developed for identifier case conversion.  I left
the straight locale-based folding in place for situations where we are
just manipulating user data and not trying to match it to built-in
strings --- for example, the SQL upper() function is still locale
dependent.  Perhaps this will prove not to be what's wanted, but at
the moment we can initdb and pass regression tests in Turkish locale.
2004-05-07 00:24:59 +00:00
Bruce Momjian b00d50d365 Per discussion earlier today, here is a fix that lets ereport() on win32
report socket errors.

Magnus Hagander
2004-04-22 03:51:24 +00:00
Bruce Momjian 31338352bd * Most changes are to fix warnings issued when compiling win32
* removed a few redundant defines
* get_user_name safe under win32
* rationalized pipe read EOF for win32 (UPDATED PATCH USED)
* changed all backend instances of sleep() to pg_usleep

    - except for the SLEEP_ON_ASSERT in assert.c, as it would exceed a
32-bit long [Note to patcher: If a SLEEP_ON_ASSERT of 2000 seconds is
acceptable, please replace with pg_usleep(2000000000L)]

I added a comment to that part of the code:

    /*
     *  It would be nice to use pg_usleep() here, but only does 2000 sec
     *  or 33 minutes, which seems too short.
     */
    sleep(1000000);

Claudio Natoli
2004-04-19 17:42:59 +00:00
Bruce Momjian a4c40f140d Here's an attempt at new socket and signal code for win32.
It works on the principle of turning sockets into non-blocking, and then
emulate blocking behaviour on top of that, while allowing signals to
run. Signals are now implemented using an event instead of APCs, thus
getting rid of the issue of APCs not being compatible with "old style"
sockets functions.

It also moves the win32 specific code away from pqsignal.h/c into
port/win32, and also removes the "thread style workaround" of the APC
issue previously in place.

In order to make things work, a few things are also changed in pgstat.c:

1) There is now a separate pipe to the collector and the bufferer. This
is required because the pipe will otherwise only be signalled in one of
the processes when the postmaster goes down. The MS winsock code for
select() must have some kind of workaround for this behaviour, but I
have found no stable way of doing that. You really are not supposed to
use the same socket from more than one process (unless you use
WSADuplicateSocket(), in which case the docs specifically say that only
one will be flagged).

2) The check for "postmaster death" is moved into a separate select()
call after the main loop. The previous behaviour select():ed on the
postmaster pipe, while later explicitly saying "we do NOT check for
postmaster exit inside the loop".
The issue was that the code relies on the same select() call seeing both
the postmaster pipe *and* the pgstat pipe go away. This does not always
happen, and it appears that useing WSAEventSelect() makes it even more
common that it does not.
Since it's only called when the process exits, I don't think using a
separate select() call will have any significant impact on how the stats
collector works.

Magnus Hagander
2004-04-12 16:19:18 +00:00
Tom Lane 1bc2d544b9 Localize our dependencies on the way to create NAN or INFINITY.
Per recent proposal to pghackers.
2004-03-15 03:29:22 +00:00
Bruce Momjian 24262be5f9 Add missing checks for Borland C compiler.
L J Bayuk
2004-03-02 18:35:59 +00:00
Tom Lane 4f571319d3 NOFILE isn't used anywhere any more. 2004-02-23 20:48:03 +00:00
Bruce Momjian af3b182a57 Here is a patch that implements setitimer() on win32. With this patch
applied, deadlock detection and statement_timeout now works.

The file timer.c goes into src/backend/port/win32/.

The patch also removes two lines of "printf debugging" accidentally left
in pqsignal.h, in the console control handler.

Magnus Hagander
2004-02-18 16:25:12 +00:00
Neil Conway f06e79525a Win32 signals cleanup. Patch by Magnus Hagander, with input from Claudio
Natoli and Bruce Momjian (and some cosmetic fixes from Neil Conway).
Changes:

    - remove duplicate signal definitions from pqsignal.h

    - replace pqkill() with kill() and redefine kill() in Win32

    - use ereport() in place of fprintf() in some error handling in
      pqsignal.c

    - export pg_queue_signal() and make use of it where necessary

    - add a console control handler for Ctrl-C and similar handling
      on Win32

    - do WaitForSingleObjectEx() in CHECK_FOR_INTERRUPTS() on Win32;
      query cancelling should now work on Win32

    - various other fixes and cleanups
2004-02-08 22:28:57 +00:00
Bruce Momjian eec08b95e7 [all] Removed call to getppid in SendPostmasterSignal, replacing with a
PostmasterPid variable, which gets set (early) in PostmasterMain
getppid would not be the postmaster?

[fork/exec] Implements processCancelRequest by keeping an array of

pid/cancel_key structs in shared mem

[fork/exec] Moves AttachSharedMemoryAndSemaphores call for backends into
SubPostmasterMain

[win32] Implements reaper/waitpid by keeping an arrays of children
pids,handles in postmaster local mem
      - this item is largely untested, for reasons which should be
obvious, but appears sound

[win32/all] Added extern for pgpipe in Win32 case, and changed the second
pipe call (which seems to have been missed earlier) to pgpipe

[win32] #define'd ftruncate to chsize in the Win32 case

[win32] PG_USLEEP for Win32 has a misplaced paren. Fixed.

[win32] DLLIMPORT handling for MingW case


Claudio Natoli
2004-01-26 22:59:54 +00:00
Bruce Momjian ede3b762a3 Back out win32 patch so we can apply it separately. 2004-01-26 22:54:58 +00:00
Bruce Momjian f4921e5ca3 Attached is a patch that fixes some trivial typos and alignment. Please
apply.

Alvaro Herrera
2004-01-26 22:51:56 +00:00
Tom Lane 9adaf64da3 Mop-up for HAS_TEST_AND_SET refactoring. Un-break two or three platforms
that were broken, try to make layout of s_lock.h entries consistent,
use HAVE_SPINLOCKS in preference to HAS_TEST_AND_SET everywhere outside
s_lock.h itself.
2003-12-23 18:13:17 +00:00
Bruce Momjian 69f2e9b0fc Move slock_t typdefs into s_lock.h from include/port files for
centralization and easier maintanence.
2003-12-23 03:31:30 +00:00
Bruce Momjian 887b5a7be0 Remove NEED_I386_TAS_ASM and just test for compiler defines. 2003-12-23 00:32:06 +00:00
Bruce Momjian 9114cb1c5f This applied patch remove NEED_SPARC_TAS_ASM and instead uses __sparc ||
__sparc__.
2003-12-22 23:39:53 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Bruce Momjian ce26858fac Update for m68k from Peter. 2003-10-26 01:41:10 +00:00
Bruce Momjian 72ecc222b7 Fix #elif typo. 2003-10-26 00:27:59 +00:00
Bruce Momjian 1fdbc8cc20 Update linux/mips port.
Add m68k to linux port.
2003-10-26 00:26:13 +00:00
Tom Lane 026f9c05d5 Move -D_GNU_SOURCE hack from port header to template, so that
configure's tests see the same compilation environment as the code.
Per discussion with Stephan Szabo.
2003-09-26 17:39:13 +00:00
Tom Lane 241cea18f7 Add missing support for Opteron (__x86_64__). 2003-09-14 20:21:18 +00:00
Bruce Momjian 69a46e9ce1 Enable Opteron/Itanium spinlocks. 2003-09-12 15:49:34 +00:00
Bruce Momjian 089003fb46 pgindent run. 2003-08-04 00:43:34 +00:00
Tom Lane 13ac54d1ca Since HPUX now exists for Itanium, we should decouple the assumption
that OS=hpux is the same as CPU=hppa.  First steps at doing this.
With these patches, we still work on hppa with either gcc or HP's cc.
We might work on hpux/itanium with gcc, but I can't test it.  Definitely
will not work on hpux/itanium with non-gcc compiler, for lack of spinlock
code.
2003-08-01 19:12:52 +00:00
Bruce Momjian b4cea00a1f IPv6 cleanups.
Kurt Roeckx
Andrew Dunstan
2003-06-12 07:36:51 +00:00
Bruce Momjian 77645b99f4 Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3. 2003-05-22 19:14:25 +00:00
Peter Eisentraut 6fabec242d Fix compilation on Cygwin. 2003-05-22 17:20:44 +00:00
Bruce Momjian 36adb2e095 Rename Win32 include directory from win32_include to win32. 2003-05-19 17:31:59 +00:00
Bruce Momjian c42581eba3 Allow interfaces to compile under MingGW/Win32 by adding _P to symbols
in ecpg.
2003-05-16 04:59:24 +00:00
Bruce Momjian bee0ac67ee Add missing win32 file --- seems best way to find these is to just
commmit then do a cvs update again.
2003-05-15 16:40:29 +00:00
Bruce Momjian 12c9423832 Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win'
        add -lwsock32 on Win32
        make gethostname() be only used when kerberos4 is enabled
        use /port/getopt.c
        new /port/opendir.c routines
        disable GUC unix_socket_group on Win32
        convert some keywords.c symbols to KEYWORD_P to prevent conflict
        create new FCNTL_NONBLOCK macro to turn off socket blocking
        create new /include/port.h file that has /port prototypes, move
          out of c.h
        new /include/port/win32_include dir to hold missing include files
        work around ERROR being defined in Win32 includes
2003-05-15 16:35:30 +00:00
Bruce Momjian d85a0a6bef More cleanups now that we have crypt(). 2003-05-09 16:59:43 +00:00
Bruce Momjian 89eae96b2f Remove rint() prototype from QNX. 2003-05-09 16:35:57 +00:00
Bruce Momjian 19141f5584 Remove unneeded define. 2003-04-29 18:25:54 +00:00
Bruce Momjian 20ead395c7 Add Win32 shmem/sema prototypes. 2003-04-24 21:23:01 +00:00
Bruce Momjian 4d4953fc41 Make Win32 tests to match existing Cygwin tests, where appropriate. 2003-04-18 01:03:42 +00:00
Peter Eisentraut 1a7f4ed525 Make "win" a separate port from "cygwin". This means you can now
configure under native Windows (MinGW that is), but you won't get very far
compiling yet.  The dynaloader files are from Jan Wieck's patch set.
2003-03-21 17:18:34 +00:00
Tom Lane e4704001ea This patch fixes a bunch of spelling mistakes in comments throughout the
PostgreSQL source code.

Neil Conway
2003-03-10 22:28:22 +00:00
Tom Lane a26ac42b76 Awhile back I wrote that freebsd.h was probably broken in the places where
it diverged from netbsd.h and openbsd.h.  This has now been confirmed.
Accordingly, make all three exactly alike.
2003-01-01 20:35:39 +00:00
Tom Lane 5eb6de5991 Remove NO_MKTIME_BEFORE_1970. I had speculated that it was not needed
anymore given the mktime() workaround now done in DetermineLocalTimeZone.
This has now been confirmed by Robert Bruccoleri for Irix, and I'm going
to extrapolate to AIX as well.
2002-11-12 00:39:08 +00:00
Bruce Momjian ceb4f5ea9c > > I'll re-check that with the ppc architecture guy here.
>
> ... he is now about to write an inlined version that can go into
> s_lock.h . I'll send the new patch later on...

OK, here it comes:

An inlined version of tas(), that works for both, powerpc and
powerpc64. The patch is against 7.3b5 and passes the test suite on
both architectures.

Reinhard Max
2002-11-10 00:33:43 +00:00
Tom Lane 9a1ced2732 Add #define _GNU_SOURCE to work around what seems to be Perl 5.8.0's
problem.  Per recent discussions about plperl failing to build on Linux.
2002-11-07 22:09:51 +00:00
Peter Eisentraut 12bb3679db Remove useless O_DIROPEN stuff. 2002-09-24 20:20:10 +00:00
Bruce Momjian e50f52a074 pgindent run. 2002-09-04 20:31:48 +00:00
Tom Lane a4dbbb52c9 Revert _LARGEFILE64_SOURCE addition; good try but doesn't work,
at least not on HPUX 10.20, and there's no reason to think it
is needed on later versions.
2002-08-30 02:01:34 +00:00
Peter Eisentraut d525ab81c3 Workaround for broken large file support on HP-UX 2002-08-29 22:09:22 +00:00
Tom Lane 846429e3d6 Not needed anymore. 2002-05-05 16:47:09 +00:00
Tom Lane 04c8d4c660 libpq++/pgconnection.h must not include postgres_fe.h, else it fails to
compile in client apps that use the standard installed header set.
To allow removing that include, move DLLIMPORT definitions out of c.h
and into the appropriate port-specific header files.
2002-01-22 19:02:40 +00:00
Bruce Momjian 77e4fd889c Fix indenting for 'extern "C"' cases. 2001-11-08 20:37:52 +00:00
Bruce Momjian ea08e6cd55 New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
2001-11-05 17:46:40 +00:00
Bruce Momjian 6783b2372e Another pgindent run. Fixes enum indenting, and improves #endif
spacing.  Also adds space for one-line comments.
2001-10-28 06:26:15 +00:00
Bruce Momjian b81844b173 pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
2001-10-25 05:50:21 +00:00
Peter Eisentraut 8401f06efd Treat __s390x__ the same as __s390__. (taken from RPM patch set) 2001-09-24 20:10:44 +00:00
Bruce Momjian 1b2d57dc83 A small patch to keep postgres working on the latest BeOS.
Cyril VELTER
2001-08-07 16:56:17 +00:00
Bruce Momjian f36fc7bb63 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
2001-05-24 15:53:34 +00:00
Bruce Momjian 0686d49da0 Remove dashes in comments that don't need them, rewrap with pgindent. 2001-03-22 06:16:21 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Tom Lane 4bd983bf34 Patches from Cyril Velter to make shared-memory-conflict-detection code
work in BeOS port.
2001-03-18 18:22:08 +00:00
Bruce Momjian 7582bd91cb Please apply the following patch to fix AIX and IRIX timestamp behavior
as previously discussed.

It makes AIX and IRIX not use DST for dates before 1970.

The following expected files need to be removed from the regression tests,
they contain wrong results and are not needed any more.

src/test/regress/expected/horology-1947-PDT.out
src/test/regress/expected/tinterval-1947-PDT.out
src/test/regress/expected/abstime-1947-PDT.out

Zeugswetter Andreas
2001-02-13 14:32:52 +00:00
Bruce Momjian cf516c3bb1 I have deleted the include of termios.h in include/port/qnx4.h.
Then I recompiled pgsql and I have compiled a program with ecpg.

I have removed the termios.h, and the ECHO hack.

Thanks
Maurizio
2001-02-09 15:13:49 +00:00
Tom Lane a7ea9f46e1 Still further tweaking of s_lock assembler: do not assume that leading
whitespace is unimportant in assembly code.  Also, move VAX definition
of typedef slock_t to port header files to be like all the other ports.
Note that netbsd.h and openbsd.h are now identical, and I rather think
that freebsd.h is broken in the places where it doesn't agree --- but
I'll leave it to the freebsders to look at that.
2001-01-20 00:03:55 +00:00
Peter Eisentraut 58f4028518 From Jason Tishler <jt@dothill.com>
* doc/FAQ_MSWIN: Update to be consistent with software -- mainly change
comment from lack of Cygwin UNIX domain socket support and to list of
current Cygwin UNIX domain socket issues.
* src/include/config.h.in: Enable UNIX domain sockets for Cygwin.
* src/include/port/win.h: Disable UNIX domain sockets for Cygwin b20.1.
* src/test/regress/pg_regress.sh: Use UNIX domain sockets for Cygwin
instead of TCP/IP.
2001-01-19 23:43:36 +00:00
Peter Eisentraut c3f9371956 Add configure check for sys_nerr, to end all discussions. 2001-01-09 18:40:15 +00:00
Tom Lane fada8ee41f NetBSD/Alpha porting fixes from tom@minnesota.com. 2000-12-31 03:34:01 +00:00
Bruce Momjian 1f159e562b >> Here is a patch for the beos port (All regression tests are OK).
>>     xlog.c : special case for beos to avoid 'link' which does not work yet
>>     beos/sem.c : implementation of new sem_ctl call (GETPID) and a new
>sem_op
>> flag (IPCNOWAIT)
>>     dynloader/beos.c : add a verification of symbol validity (seem that
the
>> loader sometime return OK with an invalid symbol)
>>     postmaster.c :  add beos forking support for the new checkpoint
process
>>     postgres.c : remove beos special case for getrusage
>>     beos.h : Correction of a bas definition of AF_UNIX, misc defnitions
>>
>>
>>     thanks
>>
>>
>>             cyril

Cyril VELTER
2000-12-18 18:45:05 +00:00
Tom Lane 41fe2a2a03 Darwin porting patches from Peter Bierman <bierman@apple.com> 2000-12-11 00:49:54 +00:00
Thomas G. Lockhart 6969b8fa11 Repair usage of the OVERLAPS operator.
Allow some operator-like tokens to be used as function names.
Flesh out support for time, timetz, and interval operators
 and interactions.
Regression tests pass, but non-reference-platform horology test results
 will need to be updated.
2000-12-03 14:51:12 +00:00
Peter Eisentraut 37b7d5c39e Remove DISABLE_COMPLEX_MACRO definitions, since people seem to be getting
by without them.

Don't check for preprocessor symbols from system header files in port
include files, since those header files aren't included at this point.
2000-11-30 21:16:12 +00:00
Peter Eisentraut fd05f89645 Extend accept/AF_UNIX bug workaround to SCO OpenServer. 2000-11-21 23:03:54 +00:00
Bruce Momjian 312063c97b Make pgsql compile on FreeBSD-alpha.
Context diff this time.

Remove -m486 compile args for FreeBSD-i386, compile -O2 on i386.

Compile with only -O on alpha for codegen safety.

Make the port use the TEST_AND_SET for alpha and i386 on FreeBSD.

Fix a lot of bogus string formats for outputting pointers (cast to int
and %u/%x replaced with no cast and %p), and 'Size'(size_t) are now
cast to 'unsigned long' and output with %lu/

Remove an unused variable.

Alfred Perlstein
2000-11-16 05:51:07 +00:00
Peter Eisentraut dfda21e7a6 Add configure check to see whether <string.h> and <strings.h> may both be
included, and then include <strings.h> if so.  Several systems already
needed <strings.h> anyway.  Some new systems that claim to conform to the
Unix 9x "standard" do not declare str[n]casemp() in string.h, and C99
compilers will not like that.
2000-11-03 18:43:52 +00:00
Peter Eisentraut b99ee7f37d This is the minimal version of the Darwin support patch from
Bruce Hartzler <bruceh@mail.utexas.edu>.  It contains shared library
support, regression test map, and the usual template files.  The dynamic
loader is missing, the spin lock code apparently doesn't assemble due to
syntax problems, and semaphores are to be hoped for from Apple.
2000-10-31 19:55:20 +00:00
Peter Eisentraut 525e1c4436 USE_POSIX_TIME replaced by HAVE_TM_ZONE || HAVE_INT_TIMEZONE, which are
equivalent.

In linux.h there were some #undef HAVE_INT_TIMEZONE, which are useless
because HAVE_TM_ZONE overrides it anyway, and messing with configure
results isn't cool.
2000-10-29 13:17:34 +00:00
Peter Eisentraut 4f82ab4c97 #define JMP_BUF has been unnecessary since the arrival of the sigsetjmp
test.
2000-10-28 23:53:01 +00:00
Peter Eisentraut 0c0a176370 As we don't use struct dirent, the #define SYSV_DIRENT is useless. If we
every do need it we'd better use AC_HEADER_DIRENT from Autoconf.

#define NO_EMPTY_STMTS is completely unused.
2000-10-28 22:53:17 +00:00
Bruce Momjian 88094f2e2b beos fixes from Cyril VELTER 2000-10-28 18:27:57 +00:00
Peter Eisentraut fba790ad58 Makeover for Unixware 7.1.1
* Makefile: Add more standard targets.  Improve shell redirection in GNU
make detection.
* src/backend/access/transam/rmgr.c: Fix incorrect(?) C.
* src/backend/libpq/pqcomm.c (StreamConnection): Work around accept() bug.
* src/include/port/unixware.h: ...with help from here.
* src/backend/nodes/print.c (plannode_type): Remove some "break"s after
"return"s.
* src/backend/tcop/dest.c (DestToFunction): ditto.
* src/backend/nodes/readfuncs.c: Add proper prototypes.
* src/backend/utils/adt/numutils.c (pg_atoi): Cope specially with strtol()
setting EINVAL. This saves us from creating an extra set of regression test
output for the affected systems.
* src/include/storage/s_lock.h (tas): Correct prototype.
* src/interfaces/libpq/fe-connect.c (parseServiceInfo): Don't use variable
as dimension in array definition.
* src/makefiles/Makefile.unixware: Add support for GCC.
* src/template/unixware: same here
* src/test/regress/expected/abstime-solaris-1947.out: Adjust whitespace.
* src/test/regress/expected/horology-solaris-1947.out: Part of this file
was evidently missing.
* src/test/regress/pg_regress.sh: Fix shell.  mkdir -p returns non-zero if
the directory exists.
* src/test/regress/resultmap: Add entries for Unixware.
2000-10-22 22:15:13 +00:00
Peter Eisentraut f8ff1ee5aa Move DLSUFFIX, AROPT, and CFLAGS_SL settings from template to
Makefile.port, since they are of no use to configure and much of the
library magic happens in Makefile.port anyway.

Use __alpha, not __alpha__, since the former is universally available.
Remove -DNOFIXADE from the compile command line and put it in the port
include file.
2000-10-21 22:36:14 +00:00
Peter Eisentraut 4d76a801c6 Unify solaris_i386 and solaris_sparc templates. They were almost identical
anyway, the rest being due to them not being kept in sync.  Add configure
test for lorder and use it (on Solaris) when found.
2000-10-10 21:22:29 +00:00
Bruce Momjian be58282516 Tom Lane wrote:
> > For a while I though it might be because we are using an alpha TAS in
> > the spinlock rather than the old semaphore. I replaced our spinlock
> > with the standard one and it made no difference. We have been running
> > with our spinlock implementation for nearly 2 months on a production
> > database now without a hitch, so I think it is ok. Did I ever submit
> > any patches for the Alpha spinlock?
>
> Not that I recall.  We did get some advice from some Alpha gurus at DEC
> who seemed to think the existing TAS code is OK.  What was it that you
> felt needed to be improved?

The current code uses semaphores, which has the advantage that it works
well even on multi-processor machines, but the disadvantage that it is not
the fastest way possible. Writing a spinlock on Alpha for SMP machines is
very difficult, as you need to deal with memory barriers. A real mess. But
then one of the people at Compaq pointed out to us that there is a
ready-made routine on Alpha. We implemented it with the two patches below.
I ran tests with lots of parallel back-ends and got around a 10% speed
increase. I include the two patches. Perhaps some of the other people
running Tru64 can have a look at these as well.

Cheers,

Adriaan Joubert
2000-10-08 04:38:21 +00:00
Bruce Momjian 7ea8403c8a The beos port in the source tree doesn't even compile. and even
after that dynamic loading isn't working and shared memory handling is
broken.

        Attached with this message, there is a Zip file which contain :

        * beos.diff = patch file generated with difforig
        * beos = folder with beos support files which need to be moved in /
src/backend/port
        * expected = foler with three file for message and precision
difference in regression test
        * regression.diff = rule problem (need to kill the backend manualy)
        * dynloader = dynloader files (they are also in the pacth files,
but there is so much modification that I have join full files)

        Everything works except a problem in 'rules' Is there some problems
with rules in the current tree ? It used to works with last week tree.

Cyril VELTER
2000-10-07 14:39:21 +00:00
Bruce Momjian 87c0e623ba New diff that now covers the entire tree. Applying this gets postgresql
working on the VERY latest version of BeOS.  I'm sure there will be
alot of comments, but then if there weren't I'd be disappointed!

Thanks for your continuing efforts to get this into your tree.

Haven't bothered with the new files as they haven't changed.

BTW Peter, the compiler is "broken" about the bool define and so on.
I'm filing a bug report to try and get it addressed.  Hopefully then we
can tidy up the code a bit.

I await the replies with interest :)

David Reid
2000-10-03 03:11:26 +00:00
Bruce Momjian 7a7e0240ea Here is the first batch of files and diffs for the BeOS port. I've run into
problems with some bits of it, but when all the patches are in it'll build
and we can fix it from there :)  I've got a version that builds and runs and
that is the basis for these patches.

The first file has the new additional files that are required,
    template/beos
    backend/port/dynloader/beos.c
    backend/port/dynloader/beos.h
    include/port/beos.h
    makefiles/Makefile.beos

The second is a tarball of diffs against a few files.  I've added sys/ipc.h
to configure and config.h via configure.in and config.h.in and then started
adding the check as this file isn't needed on BeOS and having loads of
#ifdef BEOS isn't as obvious as #ifdef HAVE_SYS_IPC_H and isn't as
autconf'ish :)
Files touched are
    include/c.h
    configure.in
    include/config.h.in
    include/storage/ipc.h
    include/utils/int8.h

Let me know how these go.  I'll await a response before submitting any more.

Any problems just get in touch.

David Reid
2000-10-02 17:16:01 +00:00
Peter Eisentraut 3eec6ee145 Rename templates to match names in makefiles/Makefile.* and include/port.
Read templates after compiler is detected. Convert all templates to real
shell scripts. Rename bsd->openbsd, alpha->osf.
2000-07-15 15:54:52 +00:00
Bruce Momjian 411cf2da3f attached to this mail is a patch from a colleague that makes
PostgreSQL-7.0.2 run on Linux for the Intel-IA64 architecture. It also
fixes a bug in the configure scripts that caused configure to fail on
the fcntl(F_SETLK) test.

This fix triggered a bug in the fcntl(F_SETLK) code of the Linux
kernel when used on unix domain sockets resulting in postmaster to
segfault immediately after startup. There is a fix available and
included in the kernel that will be on SuSE Linux 7.0, but kernels <=
2.2.16 still have this bug.

Reinhard Max
2000-07-05 16:09:31 +00:00
Thomas G. Lockhart 24864d048e Include information for armv4l from Mark Knox <segfault@hardline.org>. 2000-04-18 05:35:38 +00:00
Tom Lane 07672d4e0a Skip setsockopt(SO_REUSEADDR) for the Unix-domain postmaster socket on
all platforms, not just SCO.  The operation is undefined for Unix-domain
sockets anyway.  It seems SCO is not the only platform that complains
instead of treating the call as a no-op.
2000-04-14 00:51:58 +00:00
Bruce Momjian 52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
Bruce Momjian f43ec05d05 I've made a diff against the 7.0beta1 tree that accomplishes several things:
1) adds NetBSD shared lib support on both ELF and a.out platforms

        2) replaces "-L$(LIBPQDIR) -lpq" with "$(LIBPQ)" defined in
           Makefile.global.  This makes it much easier to build stuff in
           the source tree after you've already installed the libraries.

        3) adds TEMPLATEDIR in Makefile.global that indicates where the
           database templates are stored.  This separates the template files
           from real libraries that are installed in $(LIBDIR).
        4) changes include order of <readline/readline.h> and <readline.h>.
           The latest GNU readline installs its headers under a readline
           subdirectory.

In addition to applying the patch below the following files need to be copied:

        backend/port/dynloader:
                bsd.h -> netbsd.h
                bsd.c -> netbsd.c
        include/port:
                bsd.h -> netbsd.h
        makefiles:
                Makefile.bsd -> Makefile.netbsd

It would be great to see this incorporated into the source tree before
the 7.0 release is cut.

        Thanks!

     -- Johnny C. Lam <lamj@stat.cmu.edu>
2000-03-08 01:58:46 +00:00
Peter Eisentraut 8de482a847 Added configure test for readline's filename_completion_function
Completed psql's \? help
2000-03-05 13:30:20 +00:00
Peter Eisentraut 718bb2cc9c Moved psql \eset and \eshow to \encoding
Improved psql's Ctrl-C handling
Fixed configure test for sigsetjmp that now even recognizes it if it's a macro
2000-02-20 14:28:28 +00:00
Bruce Momjian ecd8537376 I checked the WinNT port yesterday (a few days old snapshot from CVS) and I
am including a patch to get it compile.

changes to psql:
- added less as default pager when compiling on Cygwin
- need to declare "filename_completion_function" because it is not exported
from readline -> added to include/port/win.h

changes to pg_id:
- include of <getopt.h>
- add .exe when installing

I think there is a problem with calling the regress tests on WinNT - it
should be called with PORTNAME not HOST as the parameter to regress.sh or
the check  when to add "-h localhost" to psql has to be changed. Now it is
checked against the PORTNAME.

The results of the regress tests were OK with expected failures ;-)

Daniel Horak
2000-02-09 16:23:44 +00:00
Peter Eisentraut 1cd4c14116 Fixed all elog related warnings, as well as a few others. 2000-01-15 02:59:43 +00:00
Tom Lane 76898cd330 Avoid compiler warnings on systems that have snprintf and/or vsnprintf
but do not bother to declare them in <stdio.h>.  Seems to be a more
common omission than you'd think...
1999-12-20 00:51:25 +00:00
Bruce Momjian 7585deb087 I have done the QNX4 port with the current source tree. The number of
backend/Makefiles to be patched could significantly be reduced since
they
have been adopted to the QNX4 needs.

Andreas Kardos
1999-12-16 01:25:23 +00:00
Bruce Momjian 58d1eeaafe Fix for arm32 and fix for dbname with dash. 1999-11-18 21:47:41 +00:00
Tom Lane 51f62d505e Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the
system.  I set MAXPGPATH = 1024 in config.h.in.  If anyone is really
convinced that there ought to be a configure-time test to set the
value, go right ahead ... but I think it's a waste of time.
1999-10-25 03:08:03 +00:00
Bruce Momjian c6411605e1 I have created a small patch that makes possible to compile pgsql on newer
Cygwin snapshots (tested on 990115 which is recommended to use - it fixes
some errors in B20.1)

And I have another patch for including <sys/ipc.h> before <sys/sem.h> in
backend/storage/lmgr/proc.c - it is required due the design of cygipc
headers

                        Dan
1999-10-12 14:54:28 +00:00
Bruce Momjian ff77befb73 Move __alpha to port/alpha.h. 1999-10-09 01:30:23 +00:00
Bruce Momjian e2f32054f4 linux/sparc cleanup 1999-07-19 18:19:40 +00:00
Bruce Momjian b653d1e263 Fix for linux/sparc. 1999-07-19 18:07:36 +00:00
Bruce Momjian be1851902a Fix #if if. 1999-07-19 14:30:52 +00:00
Bruce Momjian e44c931801 Re-add getopt.h check, remove NT-specific tests for it. 1999-07-19 02:27:16 +00:00
Bruce Momjian a9591ce66a Change #include's to use <> and "" as appropriate. 1999-07-15 23:04:24 +00:00
Bruce Momjian 050371fccd More cpu cleanups, only for 6.6. 1999-07-13 20:12:51 +00:00
Bruce Momjian 540c114225 Redefine cpu's as __cpu__. Only for 6.6 branch. 1999-07-13 20:00:37 +00:00
Bruce Momjian d62c25d452 cleanup of long long int atoi test. 1999-07-10 17:03:34 +00:00
Bruce Momjian 07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Bruce Momjian 94bd4e3da7 Update to PyGreSQL 2.3. 1999-05-10 16:10:51 +00:00
Tatsuo Ishii c84ea433d7 Fix from Yutaka Tanida <yutaka@marin.or.jp> 1999-04-26 04:40:17 +00:00
Bruce Momjian c0cd32d7b4 Add ARM32 support by Andrew McMurry 1999-04-13 17:42:26 +00:00
Tom Lane f620241d73 Remove overly presumptuous use of __STDC__ in c.h, replacing
it with configure-script tests to see whether const, inline, volatile, etc
work or not.  (Curiously, configure was already doing the work to see if
const and inline were OK, but the results were not getting plugged into
config.h :-(.)
1999-04-02 05:10:16 +00:00
Bruce Momjian aba8c12f67 We have tested the patches on three platforms:
NetBSD/macppc
LinuxPPC
FreeBSD 2.2.6-RELEASE

All of them seem happy with the regression test. Note that, however,
compiling with optimization enabled on NetBSD/macppc causes an initdb
failure (other two platforms are ok). After checking the asm code, we
are suspecting that might be a compiler(egcs) bug.

Tatsuo Ishii
1999-03-14 16:03:33 +00:00
Bruce Momjian 909c519733 Add missing Windows files. 1999-01-18 12:43:55 +00:00
Tom Lane 7fab608205 Add configure test to see whether vsnprintf() is present,
separately from snprintf() --- HPUX, for one, has snprintf but not
vsnprintf.  Fix a minor typo in snprintf.c, too.
1999-01-17 03:22:52 +00:00
Bruce Momjian b8d5f02e4e I have ported PostgreSQL 6.4 to Cobalt Qube running Linux 2.0.33 with
MIPS cpu (I think it's R4000). I have tested the patches on LinuxPPC
and FreeBSD. I believe they do not harm other platforms.
--
Tatsuo Ishii
1998-12-18 17:25:41 +00:00
Tom Lane 19740e2fff Portability fixes found needed for SunOS 4.1.x:
SunOS has tas(), but not memmove or strerror, and its sprintf() doesn't
return int.  Also, older versions of GNU Make don't like rules with
empty left-hand sides...
1998-11-30 00:30:05 +00:00
Tom Lane b10a719777 Use autoconf to determine whether system has POSIX signals,
instead of relying on port's os.h to tell us.  (Needed for HPUX
where system major version is not enough info.)
configure unsets USE_TK if X libraries not found.
doc/Makefile uses gzcat or zcat as found by autoconf.
1998-11-29 05:30:25 +00:00
Marc G. Fournier 82a9c9cf38 Missed one more required file... 1998-10-27 04:42:59 +00:00
Bruce Momjian 9b7c6ee00b Fixes for Irix from Robert Bruccoleri 1998-10-02 15:38:04 +00:00
Tom Lane 92edd4233e Make HP-PA S_UNLOCK a little faster and less dependent on unspecified compiler codegen details.
Make default S_LOCK macro more robust against syntax mistakes.
(I cleared these changes with David Gould a few days ago.)
1998-10-01 01:53:50 +00:00
Bruce Momjian 25a64f7519 Fix for \z formatting from Tom Lane. 1998-09-21 02:25:29 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian a738478ad8 Here are additional patches for the UnixWare 7 port.
Summary of changes:

In pqcomm.h, use the SUN_LEN macro if it is defined to calculate
the size of the sockaddr_un structure.

In unixware.h, drop the use of the UNIXWARE macro.  Everything can
be handled with the USE_UNIVEL_CC and DISABLE_COMPLEX_MACRO macros.

In s_lock.h, remove the reference to the UNIXWARE macro (see above).

In the unixware template, add the YFLAGS:-d line.

In various makefile templates, add (or cleanup) unixware and univel
port specific information.

-- Billy G. Allie
1998-08-22 04:24:41 +00:00
Bruce Momjian 0624f3dcbd My mailer munged the intro text in my last post. Here is the text
in a more readable form.  -- I am submitting the following patches
to the June 6, 1998 snapshot of PostgreSQL.  These patches implement
a port of PostgreSQL to SCO UnixWare 7, and updates the Univel port
(UnixWare 2.x).  The patched files, and the reason
 for the patch are:

File            Reason for the patch ---------------
---------------------------------------------------------------
src/backend/port/dynloader/unixware.c src/backend/port/dynloader/unixware.h
src/include/port/unixware.h src/makefiles/Makefile.unixware
src/template/unixware
		Created for the UNIXWARE port.

src/include/port/univel.h
		Modifed this file to work with the changes made to
		s_lock.[ch].

src/backend/storage/buffer/s_lock.c src/include/storage/s_lock.h
		Moved the UNIXWARE (and Univel) tas() function from
		s_lock.c to s_lock.h.  The UnixWare compiler asm
		construct is treated as a macro and needs to be in
		the s_lock.h file.  I also reworked the tas()
		function to correct some errors in the code.

src/include/version.h.in
		The use of the ## operator with quoted strings in
		the VERSION macro caused problems with the UnixWare
		C compiler.  I removed the ## operators since they
		were not needed in this case.  The macro expands
		into a sequence of quoted strings that will be
		concatenated by any ANSI C compiler.

src/config.guess
		This script was modified to recognize SCO UnixWare
		7.

src/configure src/configure.in
		The configure script was modified to recognize SCO
		UnixWare 7.

Billy G. Allie
1998-07-19 04:17:13 +00:00
Bruce Momjian 62cd6e7b75 Somewhere between 6.1 and 6.3 someone removed the support for the
NS32K machine I contributed.  In any case, I now have postgresql-6.3
running again on NetBSD/pc532, a NS32532 machine.  The following
changes are needed relative to the src directory.  (It looks like
support was partially removed when the files were moved from the
src/backend/storage/.... tree to the src/include tree.)

If you need me to get a current development version of postgresql
for this change let me know.  Also, let me know if this code needs
updating due to another code movement that deleted the old NS32K
support.

Thank you.

Phil Nelson
1998-07-19 01:19:54 +00:00
Bruce Momjian 8ae23e1305 Add DISABLE_COMPLEX_MACRO to sco. 1998-07-19 01:11:01 +00:00
Marc G. Fournier a0659e3e2c From: Tom Lane <tgl@sss.pgh.pa.us>
Making PQrequestCancel safe to call in a signal handler turned out to be
much easier than I feared.  So here are the diffs.

Some notes:
  * I modified the postmaster's packet "iodone" callback interface to allow
    the callback routine to return a continue-or-drop-connection return
    code; this was necessary to allow the connection to be closed after
    receiving a Cancel, rather than proceeding to launch a new backend...
    Being a neatnik, I also made the iodone proc have a typechecked
    parameter list.
  * I deleted all code I could find that had to do with OOB.
  * I made some edits to ensure that all signals mentioned in the code
    are referred to symbolically not by numbers ("SIGUSR2" not "2").
    I think Bruce may have already done at least some of the same edits;
    I hope that merging these patches is not too painful.
1998-07-09 03:29:11 +00:00
Bruce Momjian f8a4746208 Patches HPUX applied for Tom Lane. 1998-07-06 20:28:09 +00:00
Bruce Momjian 8ed5918faa Solaris cleanup. 1998-06-19 02:55:19 +00:00
Bruce Momjian 232dea3188 cleanup 1998-06-17 22:59:26 +00:00
Bruce Momjian b52c666a99 Make new DISABLE_COMPLEX_MACRO for compilers that can't handle our
macros.
1998-06-14 01:34:07 +00:00
Marc G. Fournier f9322c66d3 Missed the __alpha__ to __alpha change...
From: David Gould <dg@illustra.com>
1998-05-04 23:49:17 +00:00
Marc G. Fournier 1d36bdcfa6 Major screwed up s_lock patches...need to be fixed... 1998-05-04 15:45:03 +00:00
Marc G. Fournier 51a1741cfb From: Jeroen van Vianen <jeroenv@design.nl>
Attached patch will add a version() function to Postges, e.g.

template1=> select version();
version
------------------------------------------------------------
PostgreSQL 6.3.2 on i586-pc-linux-gnu, compiled by gcc 2.8.1
(1 row)
1998-04-29 12:41:29 +00:00
Marc G. Fournier 1af6b56427 From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
Ok, I have finally gotten all of the defines for Dec/Alpha and
Linux/Alpha sorted out as Marc asked. There is no longer any need for
'-Dalpha' or '-Dlinuxalpha' in either the Dec/Alpha or the Linux/Alpha
template files (./src/template/{alpha,linuxalpha}). I have replaced every
instance of 'alpha' or '__alpha__' with '__alpha', as that appears to be
the common symbol between C compilers on both operating systems (RH4.2 &
DecUnix 4.0b) for alpha.
1998-04-27 14:46:51 +00:00
Bruce Momjian 0435ecf5d5 What was LINUX_ELF doing in there? 1998-04-13 16:34:48 +00:00
Marc G. Fournier 56b3182241 From: "Billy G. Allie" <Bill.Allie@mug.org>
The following patches will allow postgreSQL 6.3 to compile and run on a
UNIXWARE 2.1.2 system with the native C compiler with the following library
change:

        The alloca function must be copied from the libucb.a archive and added
        to the libgen.a archive.

Also, the GNU flex program is needed to successfully build postgreSQL.
1998-03-01 04:47:38 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Marc G. Fournier 64e7adb07b From: Tom I Helbekkmo <tih@Hamartun.Priv.NO>
Apart from this Makefile hack, all I've done is to make dynamically
loaded code modules fail properly (as was already done for __mips__,
although I think this is too loose: I believe NetBSD for the pmax can
do dynamic linking), and to add test-and-set lock handling.  As Bruce
suggested, this is done in a maximally efficient inlined way: I was
not aware that this code was so important, speed-wise.
1998-02-13 05:10:06 +00:00
Marc G. Fournier 2bfc73f55e From: teunis <teunis@mauve.computersupportcentre.com>
Slight cleanups for glibc2.0
1998-02-03 00:57:42 +00:00
Marc G. Fournier 6e9558e639 From: "Billy G. Allie" <Bill.Allie@mug.org>
The following patches will bring the UNIVEL port in line with the new porting
model used in postgreSQL 6.3
1998-02-01 07:44:00 +00:00
Marc G. Fournier 36c1c94bca From: "Billy G. Allie" <Bill.Allie@mug.org>
The attached patches will allow postgreSQL to compile successfully on SCO
UNIXWARE 2.1.x.  The patches fix the following problems:

1.  Configure did not properly recognize the UNIXWARE system as needing the
    univel port.  It used the sys4 port.

2.  Configure did not properly process the CC flag in the template file.

3.  There was no working test and set locking implementation for the native
    UNIXWARE compiler.

4.  The test and set locking used for Intel X86 that was selected by defining
    NEED_I386_TAS_ASM could fail in a multi-processor environment.

5.  The makefiles for libpq and libpgtcl did not make a shared library for
    the univel port.
1998-01-17 23:33:58 +00:00
Marc G. Fournier 10ff1eea60 First clean compile without a "PORTNAME" variable being set... 1997-12-20 00:11:13 +00:00