--- /dev/null
+* whitespace=space-before-tab,trailing-space
+*.[chly] whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
+*.sgml whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eol
+
+# Test output files that contain extra whitespace
+*.out -whitespace
+
+
+# These files are maintained or generated elsewhere. We take them as is.
+configure -whitespace
git name-rev --tags --name-only `cat .distgitrev` > .distgittag
git ls-tree -r -t --full-tree HEAD --name-only |\
tar cjf "${distdir}.tar.bz2" --transform="s|^|${distdir}/|" -T - \
- .distgitrev .distgittag
+ .distgitrev .distgittag
echo >&2 "Prepared ${distdir}.tar.bz2 for rev=`cat .distgitrev`, tag=`cat .distgittag`"
rm -f .distgitrev .distgittag
* "git log -- bdr--[ver].sql" to see if there were any changes since it
was created. If there are, you MUST bump the version in bdr.control to
- the current release version.
+ the current release version.
* For non-point releases (e.g. 0.6 to 0.7), increase the version in
bdr.control even if nothing changed in the bdr extension script.
extension version 0.7.1 with code version 0.7.2 .
* If bdr.control's version was changed since the last release, as shown by
- "git diff bdr/prevver bdr-next -- bdr.control" ensure that a
+ "git diff bdr/prevver bdr-next -- bdr.control" ensure that a
"bdr--[oldver]--[ver].sql" script exists and is listed in the Makefile's
DATA section. Make sure it actually produces the expected results.
At a version bump a control file upgrade script must be created, e.g
bdr--0.6--0.7.sql. This needs to be *tested* whenever the main control file is
-modified. It needs to be listed in bdr.control .
+modified. It needs to be listed in bdr.control .
Dist tarballs
-------------
* Raises an error on failure, will not return null.
*
* Arguments:
- * connection_name: bdr conn name from bdr.connections to get dsn from
+ * connection_name: bdr conn name from bdr.connections to get dsn from
*
* Returns:
* the libpq connection
sprintf(optname_replication_sets, "bdr.%s_replication_sets", name);
DefineCustomStringVariable(optname_replication_sets,
optname_replication_sets,
- NULL,
+ NULL,
&opts->replication_sets,
NULL, PGC_POSTMASTER,
GUC_LIST_INPUT | GUC_LIST_QUOTE,
# Generally you want to set max_wal_senders to the same value plus a few for
# pg_basebackup runs, streaming replicas, etc.
-#
+#
# This is a suitable setting for a small installation.
max_wal_senders = 10
# bdr.node2_init_replica=on
# # and apply it to the local db using this dsn
# bdr.node2_replica_local_dsn="dbname=mydb user=postgres"
-#
+#
# bdr.node3_dsn = "host=node3 dbname=mydb"
#
tlid = cfg->init_replica ? ri->tlid + 1 : ri->tlid;
snprintf(system_identifier_s, sizeof(system_identifier_s), UINT64_FORMAT, system_identifier);
- snprintf(NameStr(slot_name), NAMEDATALEN, BDR_SLOT_NAME_FORMAT,
+ snprintf(NameStr(slot_name), NAMEDATALEN, BDR_SLOT_NAME_FORMAT,
ri->dboid, system_identifier_s, tlid,
dboid, "");
NameStr(slot_name)[NAMEDATALEN - 1] = '\0';
/* Check whether one of our connections has init_replica set */
for (off = 0; off < bdr_max_workers; off++)
{
- BdrApplyWorker *aw;
+ BdrApplyWorker *aw;
BdrConnectionConfig *cfg;
if (BdrWorkerCtl->slots[off].worker_type != BDR_WORKER_APPLY)
static char
bdr_get_remote_status(PGconn *pgconn)
{
- PGresult *res;
- char status;
- Oid param_types[] = {TEXTOID, OIDOID, OIDOID};
- const char *param_values[3];
+ PGresult *res;
+ char status;
+ Oid param_types[] = {TEXTOID, OIDOID, OIDOID};
+ const char *param_values[3];
/* Needs to fit max length of UINT64_FORMAT */
char sysid_str[33];
char tlid_str[33];
bdr_set_remote_status(PGconn *pgconn, const char status,
const char prev_status)
{
- PGresult *res;
+ PGresult *res;
char *status_str;
const uint64 sysid = GetSystemIdentifier();
/* Needs to fit max length of UINT64_FORMAT */
- char sysid_str[33];
+ char sysid_str[33];
char tlid_str[33];
char mydatabaseid_str[33];
{
Oid param_types[] = {TEXTOID, OIDOID, OIDOID};
const char *param_values[3];
- char new_status;
+ char new_status;
param_values[0] = sysid_str;
param_values[1] = tlid_str;
NameStr(*bdr_conn_name)),
errdetail("no entry with name 'bdr' in pg_extensions"),
errhint("add 'bdr' to shared_preload_libraries in postgresql.conf "
- "on the target server and restart it.")));
+ "on the target server and restart it.")));
}
}
else if (PQntuples(res) == 0)
get_parent_directory(bindir);
if (find_other_exec(my_exec_path, BDR_INIT_REPLICA_CMD,
- BDR_INIT_REPLICA_CMD " (PostgreSQL " PG_VERSION ", BDR " BDR_VERSION ")\n",
- &bdr_init_replica_script_path[0]) < 0)
+ BDR_INIT_REPLICA_CMD " (PostgreSQL " PG_VERSION ", BDR " BDR_VERSION ")\n",
+ &bdr_init_replica_script_path[0]) < 0)
{
elog(ERROR, "bdr: failed to find " BDR_INIT_REPLICA_CMD
" relative to binary %s or wrong version. Expected (PostgreSQL %s, BDR %s)",
}
if (find_other_exec(my_exec_path, BDR_DUMP_CMD,
- "pg_dump (PostgreSQL) " PG_VERSION "\n",
- &bdr_dump_path[0]) < 0)
+ "pg_dump (PostgreSQL) " PG_VERSION "\n",
+ &bdr_dump_path[0]) < 0)
{
elog(ERROR, "bdr: failed to find " BDR_DUMP_CMD
" relative to binary %s or wrong version (expected %s)",
}
if (find_other_exec(my_exec_path, BDR_RESTORE_CMD,
- BDR_RESTORE_CMD " (PostgreSQL) " PG_VERSION "\n",
- &bdr_restore_path[0]) < 0)
+ BDR_RESTORE_CMD " (PostgreSQL) " PG_VERSION "\n",
+ &bdr_restore_path[0]) < 0)
{
elog(ERROR, "bdr: failed to find " BDR_RESTORE_CMD
" relative to binary %s or wrong version (expected %s)",
LWLockAcquire(BdrWorkerCtl->lock, LW_SHARED);
for (off = 0; off < bdr_max_workers; off++)
{
- BdrWorker *worker = &BdrWorkerCtl->slots[off];
+ BdrWorker *worker = &BdrWorkerCtl->slots[off];
if (worker->worker_type == BDR_WORKER_APPLY)
{
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("Did not find local DDL lock entry for a remotely released global DDL lock"),
errdetail("node ("BDR_LOCALID_FORMAT") sent a release message but the lock isn't held locally",
- lock_sysid, lock_tli, lock_datid, "")));
+ lock_sysid, lock_tli, lock_datid, "")));
LWLockAcquire(bdr_locks_ctl->lock, LW_EXCLUSIVE);
if (bdr_my_locks_database->lockcount > 0)
if (get_namespace_oid("bdr", true) == InvalidOid)
{
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("bdr extension does not exist on " BDR_LOCALID_FORMAT,
BDR_LOCALID_FORMAT_ARGS),
errdetail("Cannot create a BDR slot without the BDR extension installed")));
echo "ERROR: data in databases differ, check $DATADIR/chksum.diff"
exit 1
fi
-
* Used by GetReplicationInfoByIdentifier()
*/
typedef struct {
- Oid riident;
- text riname;
+ Oid riident;
+ text riname;
} FormData_pg_replication_identifier;
typedef FormData_pg_replication_identifier *Form_pg_replication_identifier;
ereport(ERROR,
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("global sequence %s.%s is not initialized yet",
- get_namespace_name(RelationGetNamespace(seqrel)),
+ get_namespace_name(RelationGetNamespace(seqrel)),
RelationGetRelationName(seqrel)),
errhint("All nodes must agree before the sequence is usable. "
- "Try again soon. Check all nodes are up if the condition "
+ "Try again soon. Check all nodes are up if the condition "
"persists.")));
curval = (BdrSequenceValues *) VARDATA_ANY(DatumGetByteaP(values));
ereport(ERROR,
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("could not find free sequence value for global sequence %s.%s",
- get_namespace_name(RelationGetNamespace(seqrel)),
+ get_namespace_name(RelationGetNamespace(seqrel)),
RelationGetRelationName(seqrel)),
errhint("The sequence is refilling from remote nodes. Try again soon. "
- "Check that all nodes are up if the condition persists.")));
+ "Check that all nodes are up if the condition persists.")));
}
if (wakeup)
$$
BEGIN
PERFORM E'\t\r\n\b\f';
- \r
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
\df+ test_fn
public | test_fn | SETOF record | inpar character varying, INOUT inoutpar integer, OUT timestamp with time zone | normal | invoker | immutable | super | plpgsql | +|
| | | | | | | | | BEGIN +|
| | | | | | | | | PERFORM E'\t\r\n\b\f';+|
- | | | | | | | | | \r +|
| | | | | | | | | END; +|
| | | | | | | | | |
(1 row)
public | test_fn | SETOF record | inpar character varying, INOUT inoutpar integer, OUT timestamp with time zone | normal | invoker | immutable | super | plpgsql | +|
| | | | | | | | | BEGIN +|
| | | | | | | | | PERFORM E'\t\r\n\b\f';+|
- | | | | | | | | | \r +|
| | | | | | | | | END; +|
| | | | | | | | | |
(1 row)
public | test_fn | SETOF record | inpar character varying, INOUT inoutpar integer, OUT timestamp with time zone | normal | definer | volatile | super | plpgsql | +|
| | | | | | | | | BEGIN +|
| | | | | | | | | PERFORM E'\t\r\n\b\f';+|
- | | | | | | | | | \r +|
| | | | | | | | | END; +|
| | | | | | | | | |
(1 row)
public | test_fn | SETOF record | inpar character varying, INOUT inoutpar integer, OUT timestamp with time zone | normal | definer | volatile | super | plpgsql | +|
| | | | | | | | | BEGIN +|
| | | | | | | | | PERFORM E'\t\r\n\b\f';+|
- | | | | | | | | | \r +|
| | | | | | | | | END; +|
| | | | | | | | | |
(1 row)
step "n2s2" { UPDATE tst SET b = 'changed' WHERE a = 1; }
permutation "n1s1" "n1sync" "n2read" "n1s2" "n1sync" "n2read" "n1s3" "n1s4" "n1sync" "n2read" "n1s5" "n1s6" "n1sync" "n2read" "n1s7" "n1sync" "n2read" "n1s8" "n1s9" "n1s10" "n2s1" "n2sync" "n1s11" "n1sync" "n2sync" "n2read" "n1read" "n2s2" "n2sync" "n1read"
-
$$
BEGIN
PERFORM E'\t\r\n\b\f';
- \r
END;
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
\df+ test_fn
SELECT pg_xlog_wait_remote_apply(pg_current_xlog_location(), pid) FROM pg_stat_replication;
\c regression
SELECT id, data, other FROM add_column ORDER BY id;
-