Commit Graph

206 Commits

Author SHA1 Message Date
Peter Eisentraut 8b5a3998a1 Remove whitespace from end of lines 2013-05-30 21:05:07 -04:00
Bruce Momjian 9af4159fce pgindent run for release 9.3
This is the first run of the Perl-based pgindent script.  Also update
pgindent instructions.
2013-05-29 16:58:43 -04:00
Andrew Dunstan 9e257a181c Add parallel pg_dump option.
New infrastructure is added which creates a set number of workers
(threads on Windows, forked processes on Unix). Jobs are then
handed out to these workers by the master process as needed.
pg_restore is adjusted to use this new infrastructure in place of the
old setup which created a new worker for each step on the fly. Parallel
dumps acquire a snapshot clone in order to stay consistent, if
available.

The parallel option is selected by the -j / --jobs command line
parameter of pg_dump.

Joachim Wieland, lightly editorialized by Andrew Dunstan.
2013-03-24 11:27:20 -04:00
Tom Lane e2a203a190 initdb needs pqsignal() even on Windows.
I had thought we weren't using this version of pqsignal() at all on
Windows, but that's wrong --- initdb is using it (and coping with the
POSIX-ish semantics of bare signal() :-().  So allow the file to be
built in WIN32+FRONTEND case, and add it to the MSVC build logic.
2013-03-17 15:19:47 -04:00
Heikki Linnakangas f70b1b2748 Fix MSVC build.
The new file in src/port needs to be listed in Mkvcbuild.pm as well.
2013-02-27 21:31:41 +02:00
Andrew Dunstan a64e33f030 Redo MSVC build implementation for pg_xlogdump.
The previous commit didn't work on MSVC editions earlier than
Visual Studio 2011, apparently. This works by copying files into the
contrib directory, and making provision to clean them up, which should
work on all editions.
2013-02-25 12:00:53 -05:00
Andrew Dunstan 786170d74f Provide MSVC build setup for pg_xlogdump. 2013-02-24 20:28:42 -05:00
Alvaro Herrera a730183926 Move relpath() to libpgcommon
This enables non-backend code, such as pg_xlogdump, to use it easily.
The previous location, in src/backend/catalog/catalog.c, made that
essentially impossible because that file depends on many backend-only
facilities; so this needs to live separately.
2013-02-21 22:46:17 -03:00
Tom Lane 699d70b2ec Teach MSVC build system about postgres_fdw.
Per buildfarm.
2013-02-21 06:43:15 -05:00
Alvaro Herrera 8396447cdb Create libpgcommon, and move pg_malloc et al to it
libpgcommon is a new static library to allow sharing code among the
various frontend programs and backend; this lets us eliminate duplicate
implementations of common routines.  We avoid libpgport, because that's
intended as a place for porting issues; per discussion, it seems better
to keep them separate.

The first use case, and the only implemented by this patch, is pg_malloc
and friends, which many frontend programs were already using.

At the same time, we can use this to provide palloc emulation functions
for the frontend; this way, some palloc-using files in the backend can
also be used by the frontend cleanly.  To do this, we change palloc() in
the backend to be a function instead of a macro on top of
MemoryContextAlloc().  This was previously believed to cause loss of
performance, but this implementation has been tweaked by Tom and Andres
so that on modern compilers it provides a slight improvement over the
previous one.

This lets us clean up some places that were already with
localized hacks.

Most of the pg_malloc/palloc changes in this patch were authored by
Andres Freund. Zoltán Böszörményi also independently provided a form of
that.  libpgcommon infrastructure was authored by Álvaro.
2013-02-12 11:21:05 -03:00
Magnus Hagander 940d136661 Centralize single quote escaping in src/port/quotes.c
For code-reuse in upcoming functionality in pg_basebackup.

Zoltan Boszormenyi
2013-01-05 15:40:19 +01:00
Magnus Hagander b10e9ae9f3 Add new file to MSVC build system as well 2013-01-01 18:29:48 +01:00
Peter Eisentraut 05346c131a PL/pgSQL: rename gram.y to pl_gram.y
This makes the naming inside plpgsql consistent and distinguishes the
file from the backend's gram.y file.  It will also allow easier
refactoring of the bison make rules later on.
2012-10-04 22:40:33 -04:00
Bruce Momjian 042d9ffc28 Run newly-configured perltidy script on Perl files.
Run on HEAD and 9.2.
2012-07-04 21:47:49 -04:00
Tom Lane 357c549334 Stamp library minor versions for 9.3.
This includes fixing the MSVC copy of ecpg/preproc's version info, which
seems to have been overlooked repeatedly.  Can't we fix that so there are
not two copies??
2012-06-13 22:06:26 -04:00
Bruce Momjian 927d61eeff Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
2012-06-10 15:20:04 -04:00
Andrew Dunstan d2c1740dc2 Remove now redundant pgpipe code. 2012-03-28 23:24:07 -04:00
Robert Haas 7f63527c82 Attempt to unbreak pg_test_timing on Windows.
Per buildfarm, and Álvaro Herrera.
2012-03-28 12:22:57 -04:00
Tom Lane 8cae5810eb Fix MSVC builds for previous patch's addition of a src/port file.
(And why in the world is this OBJS list not being scraped from the
corresponding Makefile?)
2012-02-29 00:24:01 -05:00
Robert Haas dd7c84185c Attempt to fix MSVC builds and other fls-related breakage.
Thanks to Andrew Dunstan for bringing this to my attention.
2012-02-09 12:39:33 -05:00
Andrew Dunstan 63876d3bac Support for building with MS Visual Studio 2010.
Brar Piening, reviewed by Craig Ringer.
2012-01-03 08:44:26 -05:00
Bruce Momjian 8b08deb0d1 Simplify the pg_dump/pg_restore error reporting macros, and allow
pg_dumpall to use the same memory allocation functions as the others.
2011-11-29 16:34:45 -05:00
Andrew Dunstan 91572ee0a6 Make pg_dumpall build with the right object files under MSVC.
This fixes a longstanding but up to now benign bug in the way pg_dumpall
was built. The bug was exposed by recent code adjustments. The Makefile
does not use $(OBJS) to build pg_dumpall, so this fix removes their source
files from the pg_dumpall object and adds in the one source file it
consequently needs.
2011-11-27 20:14:47 -05:00
Andrew Dunstan 4a9018135a Fix MSVC builds broken by xsubpp change 2011-11-27 01:23:47 -05:00
Andrew Dunstan ba00ab0b11 Use the preferred version of xsubpp, not necessarily the one that came with the
distro version of perl.

David Wheeler and Alex Hunsaker.

Backpatch to 9.1 where it applies cleanly. A simple workaround is available for earlier
branches, and further effort doesn't seem warranted.
2011-11-26 15:22:32 -05:00
Magnus Hagander d9bae53173 Implement streaming xlog for backup tools
Add option for parallel streaming of the transaction log while a
base backup is running, to get the logfiles before the server has
removed them.

Also add a tool called pg_receivexlog, which streams the transaction
log into files, creating a log archive without having to wait for
segments to complete, thus decreasing the window of data loss without
having to waste space using archive_timeout. This works best in
combination with archive_command - suggested usage docs etc coming later.
2011-10-26 20:13:33 +02:00
Tom Lane 5a8de2f2e7 Try to un-break MSVC build.
I thought we had enough infrastructure to absorb CPPFLAGS changes from
the makefiles, but buildfarm says otherwise.
2011-09-09 22:57:08 -04:00
Heikki Linnakangas 65e899b2fb Fix MinGW build, broken by my previous patch to add a setlocale() wrapper
on Windows. ecpglib doesn't link with libpgport, but picks and compiles
the .c files it needs individually. To cope with that, move the setlocale()
wrapper from chklocale.c to a separate setlocale.c file, and include that
in ecpglib.
2011-09-01 14:02:40 +03:00
Alvaro Herrera 0d29c375cc Blind attempt at fixing isolation_tester on Win32 2011-07-13 01:10:26 -04:00
Magnus Hagander fd6913a189 perltidy run over msvc build system 2011-07-12 15:25:08 +01:00
Andrew Dunstan a9b6519606 Remove spurious underscore in name of isolation tester on MSVC. 2011-05-22 21:51:18 -04:00
Andrew Dunstan 840826e36c Build and run isolation test programs under MSVC. 2011-05-15 17:55:05 -04:00
Tom Lane bfd7f8cbb2 Make plpythonu language use plpython2 shared library directly.
The original scheme for this was to symlink plpython.$DLSUFFIX to
plpython2.$DLSUFFIX, but that doesn't work on Windows, and only
accidentally failed to fail because of the way that CREATE LANGUAGE created
or didn't create new C functions.  My changes of yesterday exposed the
weakness of that approach.  To fix, get rid of the symlink and make
pg_pltemplate show what's really going on.
2011-03-05 15:13:15 -05:00
Tom Lane 2ee69ff65d Remove no-longer-needed special case hacks in MSVC build scripts. 2011-02-13 23:42:57 -05:00
Andrew Dunstan 895ad83d70 Attempt to unbreak MSVC builds after pipe.c move. 2011-02-04 20:49:39 -05:00
Magnus Hagander 9752080942 Exclude sepgsql from MSVC regression testing as well
In passing, change exclusion in the build to follow the
same pattern as other always-excluded modules.
2011-01-24 08:24:31 +01:00
Robert Haas c26ac226e4 Blind attempt to exclude sepgsql from MSVC build system. 2011-01-23 22:57:32 -05:00
Magnus Hagander 048d148fe6 Add pg_basebackup tool for streaming base backups
This tool makes it possible to do the pg_start_backup/
copy files/pg_stop_backup step in a single command.

There are still some steps to be done before this is a
complete backup solution, such as the ability to stream
the required WAL logs, but it's still usable, and
could do with some buildfarm coverage.

In passing, make the checkpoint request optionally
fast instead of hardcoding it.

Magnus Hagander, reviewed by Fujii Masao and Dimitri Fontaine
2011-01-23 12:21:23 +01:00
Magnus Hagander f5a0fd2f3b Link libpgport into pg_test_fsync on msvc 2011-01-22 18:18:27 +01:00
Magnus Hagander fcd810c69a Use a lexer and grammar for parsing walsender commands
Makes it easier to parse mainly the BASE_BACKUP command
with it's options, and avoids having to manually deal
with quoted identifiers in the label (previously broken),
and makes it easier to add new commands and options in
the future.

In passing, refactor the case statement in the walsender
to put each command in it's own function.
2011-01-14 16:30:33 +01:00
Magnus Hagander c0e96b49e5 perltidy run on the MSVC build system
Forgot this with previuos commit, line it up so it's easier to
submit (readable) patches against the MSVC build system.
2011-01-03 10:44:56 +01:00
Magnus Hagander 20f3964291 Add required new port files to MSVC builds. 2010-12-11 14:19:08 +01:00
Bruce Momjian e6e38b4ac2 Add inet_net_ntop.c as needed by MSVC, per Magnus. 2010-11-26 14:39:13 -05:00
Peter Eisentraut fc946c39ae Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
Andrew Dunstan 52e2c12288 Attempt to fix MSVC builds broken by parallel make changes. 2010-11-12 22:55:15 -05:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Heikki Linnakangas 2746e5f21d Introduce latches. A latch is a boolean variable, with the capability to
wait until it is set. Latches can be used to reliably wait until a signal
arrives, which is hard otherwise because signals don't interrupt select()
on some platforms, and even when they do, there's race conditions.

On Unix, latches use the so called self-pipe trick under the covers to
implement the sleep until the latch is set, without race conditions. On
Windows, Windows events are used.

Use the new latch abstraction to sleep in walsender, so that as soon as
a transaction finishes, walsender is woken up to immediately send the WAL
to the standby. This reduces the latency between master and standby, which
is good.

Preliminary work by Fujii Masao. The latch implementation is by me, with
helpful comments from many people.
2010-09-11 15:48:04 +00:00
Andrew Dunstan 97301ab189 Unbreak MSVC builds by removing copydir.c from list of libpgport files 2010-07-02 23:25:27 +00:00
Andrew Dunstan 540113dc96 Unbreak MSVC builds for pg_archivecleanup by linking with libpgport 2010-06-15 12:48:36 +00:00
Andrew Dunstan 2a73ee59db Fix MSVC builds for recent plperl changes. Go back to version 8.2, which is
where we started supporting MSVC builds.

Security: CVE-2010-1169
2010-05-13 21:33:00 +00:00
Magnus Hagander 12bc72db60 Properly support multi-line entires (such as OBJS=) when building
PROGRAM, not just MODULE, in contrib.
2010-05-13 15:56:22 +00:00
Andrew Dunstan 52d0b49f5e Add missing library and include support for pg_upgrade to MSVC build system. 2010-05-13 13:40:03 +00:00
Magnus Hagander 93f35f0955 Perltidy run over the MSVC build system files, to clean up code formatting
and indentation styles.
2010-04-09 13:05:58 +00:00
Magnus Hagander ec86ef7a21 Fix another stupid typo...
Jan Urbanski
2010-02-15 17:10:50 +00:00
Magnus Hagander a05af1d404 Make the msvc build system ask python about details of version and installation
prefix, instead of assuming it will always be following the default layout.

All information we need is not available on Windows, but the number of
assumptions are at least fewer this way than before.

Based on suggestions from James William Pye.
2010-02-14 14:10:23 +00:00
Heikki Linnakangas 55d877184e Adjust MSVC build script too, now that the walreceiver dynamic module
has been renamed.
2010-01-20 09:22:43 +00:00
Andrew Dunstan 60e2fdf092 Fix typo in Mkvcbuild.pl 2010-01-20 04:29:07 +00:00
Andrew Dunstan 3d3616cc2f Build plperl's new Util.xs 2010-01-20 04:14:06 +00:00
Magnus Hagander ee3b4188a7 Add include directory for dblink to find fmgroids.h on VS2008 builds. 2010-01-17 13:21:50 +00:00
Magnus Hagander 40b91b3a8d Build the walreceiver library on MSVC as well. 2010-01-16 11:55:38 +00:00
Andrew Dunstan ccaad19112 remove use of temp file for perlchunks.h, as in recent change to plperl GNUmakefile 2010-01-11 14:16:18 +00:00
Andrew Dunstan 0346442b5d Build perlchunks.h for plperl on MSVC 2010-01-09 14:45:47 +00:00
Tom Lane 2dee828cac Remove plpgsql's separate lexer (finally!), in favor of using the core lexer
directly.  This was a lot of trouble, but should be worth it in terms of
not having to keep the plpgsql lexer in step with core anymore.  In addition
the handling of keywords is significantly better-structured, allowing us to
de-reserve a number of words that plpgsql formerly treated as reserved.
2009-11-12 00:13:00 +00:00
Tom Lane f3aec2c7f5 Support "samehost" and "samenet" specifications in pg_hba.conf,
by enumerating the machine's IP interfaces to look for a match.

Stef Walter
2009-10-01 01:58:58 +00:00
Peter Eisentraut 7798147a76 Expand test coverage support to entire tree
Test coverage support now covers the entire source tree, including
contrib, instead of just src/backend.  In a related but independent
development, the commands make coverage and make coverage-html can be run
in any directory.

This turned out to be much easier than feared.  Besides a few ad hoc fixes
to pass the make target down the tree, change all affected makefiles to
list their directories in the SUBDIRS variable, changed from variants like
DIRS and WANTED_DIRS.  MSVC build fix was attempted as well.
2009-08-07 20:50:22 +00:00
Tom Lane c43feefa80 Add erand48() to the set of functions supported by our src/port/ library,
and extend configure to test for it properly instead of hard-wiring
an assumption that everybody but Windows has the rand48 functions.
(We do cheat to the extent of assuming that probing for erand48 will do
for the entire rand48 family.)

erand48() is unused as of this commit, but a followon patch will cause
GEQO to depend on it.

Andres Freund, additional hacking by Tom
2009-07-16 17:43:52 +00:00
Andrew Dunstan 8b78428fc0 Search for versioned perl library instead of using hardcoded name on Windows. Backpatch to release 8.3 2009-06-05 18:29:56 +00:00
Magnus Hagander 2762e5555c Support Perl 5.10 and TCL 8.5 in MSVC builds.
We should probably have a better way to do this (meaning
something not hardcoded) eventually, but this fixes the
problem for 8.4.

Dave Page
2009-04-07 19:35:57 +00:00
Magnus Hagander ace2b067d5 Fix MSVC build for new ways to pull in keywords.c and kwlookup.c. 2009-03-08 19:13:38 +00:00
Magnus Hagander 59a64e381c Remove references to foreign data wrapper libraries, since they have
been removed. This should unbreak the msvc build again.
2009-02-25 17:42:19 +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
Magnus Hagander 4fc6e2fdcf Teach MSVC build system about building foreign data wrappers.
Should fix recent buildfarm breakage.
2008-12-20 22:04:02 +00:00
Magnus Hagander 2c69fa0c38 Change wildcard cerfificate mapping to be much simler - we now only match
the * character at the beginning of a pattern, and it does not match
subdomains.

Since this means we no longer need fnmatch, remove the imported implementation
from port, along with the autoconf check for it.
2008-12-02 10:39:31 +00:00
Magnus Hagander cb10467d30 Add support for matching wildcard server certificates to the new SSL code.
This uses the function fnmatch() which is not available on all platforms
(notably Windows), so import the implementation from NetBSD into src/port.
2008-11-24 09:15:16 +00:00
Magnus Hagander 772eedb6bb Exclude contrib/intagg from the list of MSVC project files to be generated,
since it's now just a SQL module and no C code.
2008-11-14 22:12:37 +00:00
Michael Meskes d82e7c84fa Link in keywords file instead of copying it.
Use #define/#ifdef instead of sed to fix include files, this should work on Windows too.
2008-05-21 19:51:01 +00:00
Magnus Hagander 42ad6631cd Add include directory required after the latest changes to the ecpg build.
Per red Windows buildfarm members.
2008-05-21 18:15:29 +00:00
Andrew Dunstan a86a9bf9fe Remaining pieces of fix for contrib makefiles 2008-05-10 15:30:11 +00:00
Andrew Dunstan 3159040627 Improve logic for finding object files on OBJS lines in contrib Makefiles. If this unbreaks buildfarm mastodon, apply everywhere. 2008-05-09 16:01:05 +00:00
Andrew Dunstan e8d11ade56 Avoid using unnecessary pgwin32_safestat in libpq. 2008-04-16 14:19:56 +00:00
Magnus Hagander b13635ce59 Support for building contrib/uuid-ossp with MSVC.
Original patch from Hiroshi Saito, modified by me.
2008-02-28 12:17:59 +00:00
Magnus Hagander 03e4dc9ef2 Handle libraries in directories with spaces in them.
Gevik Babakhani
2008-02-05 14:17:23 +00:00
Tom Lane 07c23731f2 contrib/tsearch2 need not be special-cased any longer. 2007-11-13 22:49:47 +00:00
Tom Lane cd8e1f50dd Ooops, forgot about adding -DFRONTEND. 2007-10-13 23:22:46 +00:00
Tom Lane 041a8b37f5 Try to fix msvc build for recent initdb changes. 2007-10-13 22:55:38 +00:00
Magnus Hagander 2890c33084 Build two more .DEF files for ecpg instead of using default ones. 2007-10-03 13:43:24 +00:00
Magnus Hagander f83e44aecd Use snprintf from libpgport in ecpg compatlib. Required since
we restricted exports from ecpglib.
2007-10-03 12:34:29 +00:00
Magnus Hagander c8792c86f2 Build DEF file for libecpg instead of generating a default one. 2007-10-03 12:11:00 +00:00
Magnus Hagander bdee83e7e4 Add chklocale.c to pgport files for msvc builds, per
buildfarm failures.
2007-09-29 07:15:33 +00:00
Tom Lane 314ed5de6d Define the FRONTEND symbol in postgres_fe.h, which allows us to eliminate
duplicative -DFRONTEND flags from many Makefiles.  We still need Makefile
control of the symbol in a few places that compile frontend-or-backend
src/port/ files, but it's a lot cleaner than before.

Hiroshi Saito
2007-09-27 19:53:44 +00:00
Magnus Hagander b913a94d0a Build snowball DLL for tsearch-in-core.
(Still needs to build the .sql output files, but this handles the C part
of the build)
2007-08-21 15:10:41 +00:00
Magnus Hagander f70866fb23 SSPI authentication on Windows. GSSAPI compatible client when doing Kerberos
against a Unix server, and Windows-specific server-side authentication
using SSPI "negotiate" method (Kerberos or NTLM).

Only builds properly with MSVC for now.
2007-07-23 10:16:54 +00:00
Magnus Hagander d5eaa637ce Move parse.h into src/backend on msvc, which is where it is on Unix.
Fixes builds from tarballs where the file is pre-generated.

Yoshiyuki Asaba
2007-07-07 07:43:21 +00:00
Magnus Hagander ee0d34ab64 ECPG requires a local include directory to override the project-wide ones.
Add ability to add "prefix include directories", and use it...

With this, ecpg regression tests now pass on MSVC builds.
2007-06-12 18:31:28 +00:00
Magnus Hagander 09922597c5 Rewrite ECPG regression test driver in C, by splitting the standard
regression driver into two parts and reusing half of it. Required to
run ECPG tests without a shell on MSVC builds.

Fix ECPG thread tests for MSVC build (incl output files).

Joachim Wieland and Magnus Hagander
2007-06-12 11:07:34 +00:00
Magnus Hagander 6cc02136a4 Properly set MODULE_PATHNAME based on module name instead of incorrectly based
on directory name. Fixes the generation of .sql files in contrib/spi.

Per complaint from Dave Page.
2007-04-27 16:45:54 +00:00
Magnus Hagander 5ea27a4b28 libpgtypes is a client lib, should not link with backend. 2007-04-26 14:09:12 +00:00
Magnus Hagander adf7788c5e Don't try to build uuid-ossp on msvc. 2007-04-21 19:04:51 +00:00
Magnus Hagander 4dd3365086 Enable IPV6 when building with MSVC. 2007-04-12 07:03:00 +00:00
Magnus Hagander 96b171903d Make ECPG regression tests use native threading instead of pthreads, now that
ecpglib supports it.
Change configure (patch from Bruce) and msvc build system to no longer require
 pthreads on win32, since all parts of postgresql can be thread-safe using the
 native platform functions.
2007-03-29 15:30:52 +00:00
Magnus Hagander ecfb932a5a Properly parse the name of contrib modules that aren't named the same
way as their directory (notably xml2/pgxml and intarray/_int)
2007-03-24 14:13:27 +00:00
Magnus Hagander e69f7f450c Generate SQL files for /contrib (based on .sql.in) 2007-03-23 09:53:33 +00:00
Magnus Hagander 18d82d03b5 Native shared memory implementation for win32.
Uses same underlying tech as before, but not the sysv emulation layer.
2007-03-21 14:39:23 +00:00
Magnus Hagander 62df7c31c0 ecpglib requires libpgport, per Andrew Dunstan 2007-03-19 09:34:09 +00:00
Magnus Hagander 7bb40f9b82 Add cvs tags to msvc build files, along with a (very short) comment about
what each script does.
2007-03-17 14:01:01 +00:00
Magnus Hagander 08bb618561 Turn most vc build scripts into modules instead of scripts, and just have
skeleton scripts calling them. To make it easier for the buildfarm
(or other "outside callers") to use these modules directly.

Per suggestion from Andrew Dunstan.
2007-03-17 13:50:42 +00:00