Commit Graph

98 Commits

Author SHA1 Message Date
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