users/andresfreund/postgres.git
11 years agobdr: BGWorker exit with BGW_NO_RESTART is now respected, so simplify error handling
Craig Ringer [Fri, 16 May 2014 05:00:07 +0000 (13:00 +0800)]
bdr: BGWorker exit with BGW_NO_RESTART is now respected, so simplify error handling

11 years agobdr: Fix init_replica bug introduced by per-db workers in shmem
Craig Ringer [Thu, 15 May 2014 17:49:12 +0000 (01:49 +0800)]
bdr: Fix init_replica bug introduced by per-db workers in shmem

Two arrays that previously always had the same offsets for any given
connection no longer do after per-db workers were introduced. This
exposed a previous bug in init_replica where mapping between the two
arrays was not properly done.

11 years agofixup! bdr: Add db oid param to fetch_sysid_via_node_id, add bdr_ prefix
Craig Ringer [Thu, 15 May 2014 17:40:32 +0000 (01:40 +0800)]
fixup! bdr: Add db oid param to fetch_sysid_via_node_id, add bdr_ prefix

Failed to include a final correction in the fix. So fixup for the fixup.

(Working at 2am? Not clever).

11 years agofixup! bdr: Add db oid param to fetch_sysid_via_node_id, add bdr_ prefix
Craig Ringer [Thu, 15 May 2014 16:03:43 +0000 (00:03 +0800)]
fixup! bdr: Add db oid param to fetch_sysid_via_node_id, add bdr_ prefix

The original commit didn't handle the case for the local node.

11 years agoRevert "bdr: queue object drops more comprehensively"
Alvaro Herrera [Thu, 15 May 2014 14:41:08 +0000 (10:41 -0400)]
Revert "bdr: queue object drops more comprehensively"

This partly reverts commit 13c2d6d48fc3cbe06483fe13208fad8c5ec54b8c.

11 years agobdr: Add db oid param to fetch_sysid_via_node_id, add bdr_ prefix
Craig Ringer [Thu, 15 May 2014 12:40:23 +0000 (20:40 +0800)]
bdr: Add db oid param to fetch_sysid_via_node_id, add bdr_ prefix

Rename fetch_sysid_via_node_id to bdr_fetch_sysid_via_node_id and add a new
output parameter to return the database oid for the database that's local
to that RepNodeId.

This allows bdr_fetch_sysid_via_node_id to return the full identifying
key for a node now that we support intra-node replication.

11 years agobdr: Fixup for Mkvcbuild.pm typo
Andres Freund [Thu, 15 May 2014 13:10:17 +0000 (15:10 +0200)]
bdr: Fixup for Mkvcbuild.pm typo

11 years agobdr: fix: include header file for prototypes
Christian Kruse [Thu, 15 May 2014 13:09:05 +0000 (15:09 +0200)]
bdr: fix: include header file for prototypes

AdvanceCachedReplicationIdentifier() and AdvanceReplicationIdentifier()
are defined in replication/replication_identifier.h

11 years agobdr: Put files to be built into a consistent order. again.
Andres Freund [Thu, 15 May 2014 13:06:04 +0000 (15:06 +0200)]
bdr: Put files to be built into a consistent order. again.

Doing so makes resolving merge conflicts far easier.

11 years agobdr: move fetch_sysid_via_node_id into bdr_catalogs.c
Craig Ringer [Thu, 15 May 2014 11:25:05 +0000 (19:25 +0800)]
bdr: move fetch_sysid_via_node_id into bdr_catalogs.c

This allows fetch_sysid_via_node_id to be used by the output
plugin for resolving a local RepNodeId into a (sysid,tlid) tuple.

11 years agobdr: Add timeline ID to bdr.bdr_nodes, change sysid type to text
Craig Ringer [Thu, 15 May 2014 09:59:39 +0000 (17:59 +0800)]
bdr: Add timeline ID to bdr.bdr_nodes, change sysid type to text

The unique identifier for a given bdr node is (sysid, timelineid, dbname), so
make sure that's the correct key in bdr.bdr_nodes.

11 years agobdr: tests for DDL replication
Christian Kruse [Thu, 15 May 2014 07:41:00 +0000 (09:41 +0200)]
bdr: tests for DDL replication

11 years agobdr: fixing check target
Christian Kruse [Thu, 15 May 2014 07:39:57 +0000 (09:39 +0200)]
bdr: fixing check target

11 years agobdr: use get_database_name() not direct syscache lookup
Craig Ringer [Thu, 15 May 2014 07:40:49 +0000 (15:40 +0800)]
bdr: use get_database_name() not direct syscache lookup

Per review from Andres.

11 years agobdr: fix drops stuff for internal objects
Alvaro Herrera [Wed, 14 May 2014 20:00:08 +0000 (16:00 -0400)]
bdr: fix drops stuff for internal objects

Things such as TOAST tables were causing errors when tables having them
were dropped.

11 years agobdr: queue object drops more comprehensively
Alvaro Herrera [Mon, 12 May 2014 18:34:29 +0000 (14:34 -0400)]
bdr: queue object drops more comprehensively

We were skipping listing objects in the queued item that are only
reached by internal dependency links, but this doesn't work in some
cases, e.g. a table that depends on a view through column dependencies.

We're probably going to need to tweak this again in a later stage, for
example if we want local-only objects (such as unlogged matviews) to
depend on replicated objects; if we were to try that scenario today, the
drop would fail because the matview wouldn't be found on the remote node
when we tried to replicate the drop.  But this implementation doesn't
seem to be the way forward for that, anyway.

11 years agobdr: replicate all DDL commands
Alvaro Herrera [Mon, 12 May 2014 18:33:13 +0000 (14:33 -0400)]
bdr: replicate all DDL commands

11 years agobdr: Don't use send/recv protocol for array/composite types.
Andres Freund [Wed, 14 May 2014 11:17:31 +0000 (13:17 +0200)]
bdr: Don't use send/recv protocol for array/composite types.

11 years agobdr: Use GetSysCacheOidError2 to cut some code in conflict logging
Craig Ringer [Wed, 14 May 2014 11:09:55 +0000 (19:09 +0800)]
bdr: Use GetSysCacheOidError2 to cut some code in conflict logging

11 years agobdr: move GetSysCacheOidError2 into bdr_catalogs.c and bdr.h
Craig Ringer [Wed, 14 May 2014 11:05:54 +0000 (19:05 +0800)]
bdr: move GetSysCacheOidError2 into bdr_catalogs.c and bdr.h

Should be shareable between bdr apply and bdr output.

11 years agobdr: Better error message on slot creation for db where bdr not active
Craig Ringer [Wed, 14 May 2014 10:51:05 +0000 (18:51 +0800)]
bdr: Better error message on slot creation for db where bdr not active

We want to block slot creation on a database where there's no active
bdr connection configured for that db. Test to see whether there's a
bdr schema and refuse to create a slot in this case.

Doesn't protect against bdr being enabled then disabled, but nothing
exciting will happen in that case anyway.

11 years agobdr: minor header cleanup
Andres Freund [Tue, 13 May 2014 11:53:24 +0000 (13:53 +0200)]
bdr: minor header cleanup

11 years agobdr: don't perform ddl command filtering in non bdr databases.
Andres Freund [Mon, 12 May 2014 23:08:04 +0000 (01:08 +0200)]
bdr: don't perform ddl command filtering in non bdr databases.

11 years agobdr: disable commandfilter when running in single user mode
Andres Freund [Mon, 12 May 2014 22:18:15 +0000 (00:18 +0200)]
bdr: disable commandfilter when running in single user mode

11 years agobdr: test cases for cluster-internal drop replication and common conflicts
Christian Kruse [Wed, 14 May 2014 08:08:16 +0000 (10:08 +0200)]
bdr: test cases for cluster-internal drop replication and common conflicts

common_conflicts.spec: Generate the common conflicts
cluster-internal-drop.spec: Test case failing for a DROP bug in
cluster-internal replication

11 years agobdr: enabling cluster-internal replication
Christian Kruse [Wed, 14 May 2014 07:33:19 +0000 (09:33 +0200)]
bdr: enabling cluster-internal replication

11 years agobdr: implementing bdr.<name>_local_dbname
Christian Kruse [Tue, 13 May 2014 14:28:03 +0000 (16:28 +0200)]
bdr: implementing bdr.<name>_local_dbname

11 years agobdr: refactor BdrConnectionConfig to use char * instead of NameData
Christian Kruse [Tue, 13 May 2014 13:50:21 +0000 (15:50 +0200)]
bdr: refactor BdrConnectionConfig to use char * instead of NameData

11 years agobdr: Prevent slot creation until BDR is up and ready
Craig Ringer [Wed, 14 May 2014 01:47:39 +0000 (09:47 +0800)]
bdr: Prevent slot creation until BDR is up and ready

Checks bdr.bdr_nodes status field for the local node in the local DB during bdr
output plugin startup and ERRORs if status isn't set to ready yet. This ensures
that we cannot begin sending changes to other nodes while we're still applying
a dump or performing catchup.

The BDR per-db worker now creates an entry in the local bdr.bdr_nodes if
init_replica isn't configured on any connection and no such entry exists. That
makes sure BDR without init_replica keeps working properly.

An error like:

    ERROR:  bdr.bdr_nodes entry for local node (sysid=6013159507840554182, dbname=postgres): row missing, bdr not active on this database or is initializing.

is emitted if the DB isn't ready for BDR yet. This can be tested easily with
pg_recvlogical by deleting the bdr.bdr_nodes entry for the local node or
creating an init_replica script that pauses indefinitely.

11 years agobdr: At high debug levels log replication protocol commands
Craig Ringer [Wed, 14 May 2014 06:02:37 +0000 (14:02 +0800)]
bdr: At high debug levels log replication protocol commands

This makes getting a view of the parameters sent when starting logical
replication easier.

11 years agobdr: Prevent null pointer dereference for blank output plugin params
Craig Ringer [Wed, 14 May 2014 05:57:24 +0000 (13:57 +0800)]
bdr: Prevent null pointer dereference for blank output plugin params

bdr_output would crash with a segfault due to a null pointer dereference
if a parameter was specified but no corresponding value was supplied, e.g.

pg_recvlogical -P bdr_output -S test -d postgres --create
pg_recvlogical -P bdr_output -S test -d postgres --start -f - -o pg_version

This now fails with an ERROR instead of crashing and forcing postmaster
re-init, e.g.

    ERROR:  uint32 parameter "pg_version" had no value

11 years agobdr: Don't register duplicate apply workers on perdb worker restart
Craig Ringer [Wed, 14 May 2014 01:36:05 +0000 (09:36 +0800)]
bdr: Don't register duplicate apply workers on perdb worker restart

Previously we handled postmaster restarts, but not the case where a per-db
worker restarted without a postmaster restart being triggered (such as on an
ERROR in a per-db worker).

This solution is imperfect. The flag to detect postmaster restart is set after
shmem is populated with the apply worker info but before they're actually
registered. If a crash forces a postmaster restart before all apply workers are
registered by all each per-db worker we'll fail to launch any that weren't
launched before the restart, because we've lost the shmem launch state flags
and have to assume they were all launched.

A proper solution probably requires a way to query the list of registered
bgworkers to determine whether a particular worker is registered.

11 years agobdr: fix: always send 0 as timeframe for UPDATE vs DELETE
Christian Kruse [Tue, 13 May 2014 10:23:08 +0000 (12:23 +0200)]
bdr: fix: always send 0 as timeframe for UPDATE vs DELETE

11 years agobdr: integration of conflict handlers for UPDATE vs DELETE
Christian Kruse [Fri, 9 May 2014 13:21:19 +0000 (15:21 +0200)]
bdr: integration of conflict handlers for UPDATE vs DELETE

11 years agobdr: fix: use same datatype as bdr_max_workers to avoid compiler warning
Christian Kruse [Tue, 13 May 2014 08:42:37 +0000 (10:42 +0200)]
bdr: fix: use same datatype as bdr_max_workers to avoid compiler warning

11 years agobdr: adding errcodes to a lot of ereports
Christian Kruse [Tue, 13 May 2014 08:40:49 +0000 (10:40 +0200)]
bdr: adding errcodes to a lot of ereports

11 years agobdr: refactoring: remove duplicate enum for conflict handlers/logging
Christian Kruse [Tue, 13 May 2014 07:55:42 +0000 (09:55 +0200)]
bdr: refactoring: remove duplicate enum for conflict handlers/logging

11 years agobdr: fix: bdr_queued_commands has been changed, use new structure
Christian Kruse [Tue, 13 May 2014 07:54:26 +0000 (09:54 +0200)]
bdr: fix: bdr_queued_commands has been changed, use new structure

11 years agobdr: Move apply worker global state out of shmem
Craig Ringer [Tue, 13 May 2014 01:46:26 +0000 (09:46 +0800)]
bdr: Move apply worker global state out of shmem

11 years agobdr: implement per-db worker in shmem
Craig Ringer [Tue, 13 May 2014 01:45:52 +0000 (09:45 +0800)]
bdr: implement per-db worker in shmem

11 years agobdr: Be a bit more considerate when creating the necessary extensions.
Andres Freund [Mon, 12 May 2014 22:00:20 +0000 (00:00 +0200)]
bdr: Be a bit more considerate when creating the necessary extensions.

11 years agobdr: Be more careful about recursively entered ddl replication commands
Andres Freund [Mon, 12 May 2014 21:27:21 +0000 (23:27 +0200)]
bdr: Be more careful about recursively entered ddl replication commands

11 years agobdr: Try to be more consistent in bdr--0.5.sql
Andres Freund [Mon, 12 May 2014 21:12:13 +0000 (23:12 +0200)]
bdr: Try to be more consistent in bdr--0.5.sql

* indent with 4 spaces
* always revoke permissions from tables
* always have the revoke close to the table's definition
* creating object in a halfway meaningful order

11 years agobdr: queue command_tag rather than objtype/identity
Alvaro Herrera [Mon, 12 May 2014 18:11:02 +0000 (14:11 -0400)]
bdr: queue command_tag rather than objtype/identity

These are used for error messages anyway, so they aren't very important;
and it's hard to see what would be identity be for commands that act on
multiple objects such as GRANT.

11 years agobdr: Log conflicts to a bdr.bdr_conflict_history table
Craig Ringer [Mon, 5 May 2014 06:54:27 +0000 (14:54 +0800)]
bdr: Log conflicts to a bdr.bdr_conflict_history table

Creates a bdr.bdr_conflict_history table and logs conflicts to it when they're
detected, with details on both sides of the error.

Currently only logs insert/insert conflicts. The infrastructure for reporting
ERROR conflicts is present but not yet used.

11 years agobdr: move heap and index access routines into bdr_executor.c
Craig Ringer [Fri, 9 May 2014 12:19:17 +0000 (20:19 +0800)]
bdr: move heap and index access routines into bdr_executor.c

11 years agobdr: move bdr_process_remote_command into bdr_apply.c
Craig Ringer [Thu, 8 May 2014 08:35:27 +0000 (16:35 +0800)]
bdr: move bdr_process_remote_command into bdr_apply.c

11 years agobdr: fix: include timeframe in conflict handlers view
Christian Kruse [Mon, 12 May 2014 09:46:10 +0000 (11:46 +0200)]
bdr: fix: include timeframe in conflict handlers view

11 years agobdr: fix: partly reverting ff6fc55 due to mussjudgements
Christian Kruse [Fri, 9 May 2014 12:15:54 +0000 (14:15 +0200)]
bdr: fix: partly reverting ff6fc55 due to mussjudgements

11 years agobdr: we now use ereport() and elog(DEBUG1) in various cases
Christian Kruse [Fri, 9 May 2014 11:48:25 +0000 (13:48 +0200)]
bdr: we now use ereport() and elog(DEBUG1) in various cases

11 years agobdr: fix: get schema name from oid and don't use hard coded public
Christian Kruse [Fri, 9 May 2014 11:10:41 +0000 (13:10 +0200)]
bdr: fix: get schema name from oid and don't use hard coded public

11 years agobdr: fix: do not use vars named errmsg, generate proper log message
Christian Kruse [Fri, 9 May 2014 10:01:59 +0000 (12:01 +0200)]
bdr: fix: do not use vars named errmsg, generate proper log message

11 years agobdr: fix: use correct datatypes in various loops
Christian Kruse [Fri, 9 May 2014 09:50:52 +0000 (11:50 +0200)]
bdr: fix: use correct datatypes in various loops

This avoids compiler warnings for signed vs unsigned comparison.

11 years agobdr: command filter enhancements and fixes
Christian Kruse [Thu, 8 May 2014 12:33:25 +0000 (14:33 +0200)]
bdr: command filter enhancements and fixes

Forbidding renaming of ALTER AGGREGATE โ€ฆ RENAME TO โ€ฆ, ALTER COLLATION โ€ฆ
RENAME TO โ€ฆ, ALTER CONVERSION โ€ฆ RENAME TO โ€ฆ, ALTER OPERATOR CLASS โ€ฆ
RENAME TO โ€ฆ, ALTER OPERATOR FAMILY โ€ฆ RENAME TO โ€ฆ. Forbidding ALTER
TABLESPACE โ€ฆ MOVE โ€ฆ, too.

11 years agobdr: conflict handlers: refactored handler invocation
Christian Kruse [Thu, 8 May 2014 10:17:58 +0000 (12:17 +0200)]
bdr: conflict handlers: refactored handler invocation

In the previous code we forgot in one case to call conflict
handlers. This lead to calling them in each if branch. Thus we decided
to refactor the code to call the handlers above the code.

11 years agobdr: fix: use CreateCommandTag() for various commands
Christian Kruse [Thu, 8 May 2014 10:00:34 +0000 (12:00 +0200)]
bdr: fix: use CreateCommandTag() for various commands

Due to inernals completionCommand is not always available. Use
CreateCommandTag() in this cases.

11 years agobdr: fix: really disallow SECURITY LABEL for now
Christian Kruse [Thu, 8 May 2014 09:59:58 +0000 (11:59 +0200)]
bdr: fix: really disallow SECURITY LABEL for now

11 years agobdr: Don't use hack to avoid copying whole tuples when putting them in slots.
Craig Ringer [Thu, 8 May 2014 08:37:04 +0000 (16:37 +0800)]
bdr: Don't use hack to avoid copying whole tuples when putting them in slots.

The current hack isn't sufficient, instead more widespread changes to the slot
mechanism are required.

This caused errors like:

ERROR: could not access status of transaction 4294967295
DETAIL: Could not open file "pg_clog/0FFF": No such file or directory.

when getting a Datum for a tuple with ExecFetchSlotTupleDatum .

Author: Andres Freund

11 years agobdr: Send remote transaction ID in begin messages
Craig Ringer [Thu, 8 May 2014 03:43:07 +0000 (11:43 +0800)]
bdr: Send remote transaction ID in begin messages

Adds 4 bytes to each BEGIN, but allows better debugging information
by logging the remote transaction ID when conflicts are detected
or apply errors occur.

11 years agobdr: Remove unused field has_timetravel from ReorderBufferTXN
Craig Ringer [Thu, 8 May 2014 03:36:52 +0000 (11:36 +0800)]
bdr: Remove unused field has_timetravel from ReorderBufferTXN

This field is never used and doesn't appear in the copy of ReorderBufferTXN in
master. It looks like a merge oversight.

11 years agobdr: fix: use createCommandTag()
Christian Kruse [Wed, 7 May 2014 14:49:01 +0000 (16:49 +0200)]
bdr: fix: use createCommandTag()

Use createCommandTag() for T_DefineStmt/T_CreateTableAsStmt class
queries because completionTag isn't available in this case (due to
internals).

11 years agobdr: conflict handlers: always forbid conflict handlers on system tables
Christian Kruse [Wed, 7 May 2014 13:44:34 +0000 (15:44 +0200)]
bdr: conflict handlers: always forbid conflict handlers on system tables

11 years agobdr: isolationtester: some basic tests for generating conflicts
Christian Kruse [Wed, 7 May 2014 12:20:35 +0000 (14:20 +0200)]
bdr: isolationtester: some basic tests for generating conflicts

11 years agobdr: allow VALIDATE CONSTRAINT
Christian Kruse [Wed, 7 May 2014 09:35:41 +0000 (11:35 +0200)]
bdr: allow VALIDATE CONSTRAINT

11 years agobdr: fix: build bdr_relcache.c and bdr_conflict_handlers.c on Windows, too
Christian Kruse [Tue, 6 May 2014 20:09:23 +0000 (22:09 +0200)]
bdr: fix: build bdr_relcache.c and bdr_conflict_handlers.c on Windows, too

11 years agobdr: introducing conflict handlers
Christian Kruse [Wed, 9 Apr 2014 09:31:09 +0000 (11:31 +0200)]
bdr: introducing conflict handlers

Conflict handlers are user definable functions which get called when a
conflict appears. Currently there is only UPDATE vs UPDATE implemented

11 years agobdr: introducing a relcache
Christian Kruse [Fri, 25 Apr 2014 14:31:16 +0000 (16:31 +0200)]
bdr: introducing a relcache

The relcache caches relation dependent data to avoid gathering them again
for every action

11 years agobdr: fix: don't access relation after it's been closed
Christian Kruse [Tue, 6 May 2014 13:09:24 +0000 (15:09 +0200)]
bdr: fix: don't access relation after it's been closed

11 years agobdr: fix command filter to check on the transformed ALTER TABLE statements
Christian Kruse [Mon, 5 May 2014 15:32:18 +0000 (17:32 +0200)]
bdr: fix command filter to check on the transformed ALTER TABLE statements

11 years agobdr: Fix a couple of minor typos
Abhijit Menon-Sen [Mon, 5 May 2014 11:07:09 +0000 (16:37 +0530)]
bdr: Fix a couple of minor typos

11 years agobdr: Significantly improve the commandfilter.
Andres Freund [Thu, 1 May 2014 17:01:14 +0000 (19:01 +0200)]
bdr: Significantly improve the commandfilter.

Several previously allowed command are now forbidden and vice versa.

11 years agobdr: Place assertion forbidding expression unique indexes more precisely.
Andres Freund [Thu, 1 May 2014 13:50:23 +0000 (15:50 +0200)]
bdr: Place assertion forbidding expression unique indexes more precisely.

11 years agobdr: Use a more narrow START/END critical section in sequences code.
Andres Freund [Thu, 1 May 2014 13:47:27 +0000 (15:47 +0200)]
bdr: Use a more narrow START/END critical section in sequences code.

11 years agobdr: also replicate CREATE FUNCTION
Alvaro Herrera [Wed, 30 Apr 2014 22:39:20 +0000 (18:39 -0400)]
bdr: also replicate CREATE FUNCTION

11 years agobdr: don't replicate objects in extensions
Alvaro Herrera [Wed, 30 Apr 2014 22:38:50 +0000 (18:38 -0400)]
bdr: don't replicate objects in extensions

11 years agobdr: also replicate ALTER SEQUENCE
Alvaro Herrera [Wed, 30 Apr 2014 17:48:23 +0000 (13:48 -0400)]
bdr: also replicate ALTER SEQUENCE

11 years agobdr: Also accept ProcessedConstraints in the commandfilter.
Andres Freund [Wed, 30 Apr 2014 16:37:14 +0000 (18:37 +0200)]
bdr: Also accept ProcessedConstraints in the commandfilter.

That makes CREATE TABLE ..( ... REFERENCES ...) work.

11 years agobdr: WIP: add more info to ddl queues
Andres Freund [Wed, 30 Apr 2014 15:11:00 +0000 (17:11 +0200)]
bdr: WIP: add more info to ddl queues

11 years agobdr: in get_worker_option removal, it helps to increment the counter
Craig Ringer [Wed, 30 Apr 2014 12:21:37 +0000 (20:21 +0800)]
bdr: in get_worker_option removal, it helps to increment the counter

Failure to increment the loop counter led to >2 node configurations failing.

11 years agobdr: Supply a 'short_desc' for bdr.default_apply_delay.
Andres Freund [Wed, 30 Apr 2014 12:05:39 +0000 (14:05 +0200)]
bdr: Supply a 'short_desc' for bdr.default_apply_delay.

Otherwise SHOW ALL crashes.

11 years agobdr: Fix typo in the get_worker_option() removal patch.
Andres Freund [Wed, 30 Apr 2014 11:14:53 +0000 (13:14 +0200)]
bdr: Fix typo in the get_worker_option() removal patch.

11 years agobdr: Remove get_worker_option in favour of direct GUC access
Craig Ringer [Wed, 30 Apr 2014 06:21:08 +0000 (14:21 +0800)]
bdr: Remove get_worker_option in favour of direct GUC access

Store GUCs for each bdr.[connname] as members of a postmaster palloc'd struct
accessed via a global array. Pass BDR workers indexes into this array in shmem
so they know how to access their GUC values.

Fixes Andres's concerns with get_worker_option. This also makes it easier to
support EXEC_BACKEND later.

11 years agobdr: Don't include frontend libpq in generic bdr header.
Andres Freund [Tue, 29 Apr 2014 18:31:41 +0000 (20:31 +0200)]
bdr: Don't include frontend libpq in generic bdr header.

Otherwise we need to link to libpq on windows to get the right include
dir added.

11 years agobdr: Remove further pre C99 incompatibility.
Andres Freund [Tue, 29 Apr 2014 18:27:48 +0000 (20:27 +0200)]
bdr: Remove further pre C99 incompatibility.

11 years agobdr/deparse: don't use TG_TAG
Alvaro Herrera [Tue, 29 Apr 2014 18:07:04 +0000 (14:07 -0400)]
bdr/deparse: don't use TG_TAG

It's not useful in case of nested commands (maybe in other cases too);
rely on pg_event_trigger_get_creation_commands().command_tag instead.

11 years agobdr: Don't use c99-only const array initializers
Craig Ringer [Tue, 29 Apr 2014 13:42:19 +0000 (21:42 +0800)]
bdr: Don't use c99-only const array initializers

11 years agobdr: Windows? Not yet. #ifdef out bdr_exec_init_replica
Craig Ringer [Tue, 29 Apr 2014 13:15:03 +0000 (21:15 +0800)]
bdr: Windows? Not yet. #ifdef out bdr_exec_init_replica

In future we should CreateProcessEx for Windows. This really wants a new
function for port/ that uses fork()/exec() on *nix, and CreateProcessEx on
Windows.

That's not within the scope of BDR as specified, and time's a-'ticking, so for
now let's just make this feature unsupported on Windows so the buildfarm stops
whining.

11 years agobdr: Allow ALTER TABLE DROP COLUMN/SET NULL/DROP NULL
Andres Freund [Mon, 28 Apr 2014 23:00:12 +0000 (01:00 +0200)]
bdr: Allow ALTER TABLE DROP COLUMN/SET NULL/DROP NULL

11 years agobdr: fix compiler warning about unused variable
Christian Kruse [Mon, 28 Apr 2014 17:48:16 +0000 (19:48 +0200)]
bdr: fix compiler warning about unused variable

11 years agobdr: Always use the correct relation name in truncation triggers.
Andres Freund [Mon, 28 Apr 2014 18:47:32 +0000 (20:47 +0200)]
bdr: Always use the correct relation name in truncation triggers.

11 years agobdr: Adapt to postgresql upstream changes
Andres Freund [Mon, 28 Apr 2014 16:55:59 +0000 (18:55 +0200)]
bdr: Adapt to postgresql upstream changes

11 years agobdr: deparse: Support USING in CREATE SEQUENCE
Alvaro Herrera [Tue, 25 Feb 2014 16:18:55 +0000 (13:18 -0300)]
bdr: deparse: Support USING in CREATE SEQUENCE

11 years agobdr: fix: include header files instead of forward declare data structures
Christian Kruse [Mon, 28 Apr 2014 12:59:26 +0000 (14:59 +0200)]
bdr: fix: include header files instead of forward declare data structures

11 years agobdr: Include errno.h not sys/errno.h
Andres Freund [Sun, 27 Apr 2014 13:49:23 +0000 (15:49 +0200)]
bdr: Include errno.h not sys/errno.h

11 years agobdr: some cleanups for the init replica functionality.
Andres Freund [Sun, 27 Apr 2014 13:47:38 +0000 (15:47 +0200)]
bdr: some cleanups for the init replica functionality.

11 years agobdr: Build bdr_init_replica.c on Windows too
Craig Ringer [Sun, 27 Apr 2014 13:22:35 +0000 (21:22 +0800)]
bdr: Build bdr_init_replica.c on Windows too

11 years agobdr: clean up include file mess
Andres Freund [Sun, 27 Apr 2014 13:01:54 +0000 (15:01 +0200)]
bdr: clean up include file mess

11 years agobdr: document types of conflicts and their resolution (internals)
Andres Freund [Sun, 27 Apr 2014 11:14:44 +0000 (13:14 +0200)]
bdr: document types of conflicts and their resolution (internals)

11 years agobdr: Don't create TRUNCATE triggers for DDL replication during pg_restore
Craig Ringer [Sun, 27 Apr 2014 04:47:24 +0000 (12:47 +0800)]
bdr: Don't create TRUNCATE triggers for DDL replication during pg_restore

11 years agobdr: Use logical dump/reload and catchup mode during DB startup
Craig Ringer [Mon, 21 Apr 2014 05:22:39 +0000 (13:22 +0800)]
bdr: Use logical dump/reload and catchup mode during DB startup

Install BDR extension in remote, track progress in bdr.bdr_nodes,
support pg_dump --snapshot and pg_restore for dump+reload apply,
use catchup mode.