/*
* If possible, clean up the old bucket. We might not be able to do this
* if someone else has a pin on it, but if not then we can go ahead. This
- * isn't absolutely necessary, but it reduces bloat; if we don't do it now,
- * VACUUM will do it eventually, but maybe not until new overflow pages
- * have been allocated. Note that there's no need to clean up the new
- * bucket.
+ * isn't absolutely necessary, but it reduces bloat; if we don't do it
+ * now, VACUUM will do it eventually, but maybe not until new overflow
+ * pages have been allocated. Note that there's no need to clean up the
+ * new bucket.
*/
if (IsBufferCleanupOK(bucket_obuf))
{
}
/* Should fit to estimated shmem size */
- Assert(ptr - (char *) shared <= SimpleLruShmemSize(nslots, nlsns));
+ Assert(ptr - (char *) shared <= SimpleLruShmemSize(nslots, nlsns));
}
else
Assert(found);
get_database_name(MyDatabaseId))));
/*
- * Do not allow a Hot Standby session to make temp tables. Aside
- * from problems with modifying the system catalogs, there is a naming
+ * Do not allow a Hot Standby session to make temp tables. Aside from
+ * problems with modifying the system catalogs, there is a naming
* conflict: pg_temp_N belongs to the session with BackendId N on the
- * master, not to a hot standby session with the same BackendId. We should not
- * be able to get here anyway due to XactReadOnly checks, but let's just
- * make real sure. Note that this also backstops various operations that
- * allow XactReadOnly transactions to modify temp tables; they'd need
- * RecoveryInProgress checks if not for this.
+ * master, not to a hot standby session with the same BackendId. We
+ * should not be able to get here anyway due to XactReadOnly checks, but
+ * let's just make real sure. Note that this also backstops various
+ * operations that allow XactReadOnly transactions to modify temp tables;
+ * they'd need RecoveryInProgress checks if not for this.
*/
if (RecoveryInProgress())
ereport(ERROR,
errmsg("empty range bound specified for partition \"%s\"",
relname),
errdetail("Specified lower bound %s is greater than or equal to upper bound %s.",
- get_range_partbound_string(spec->lowerdatums),
- get_range_partbound_string(spec->upperdatums)),
- parser_errposition(pstate, spec->location)));
+ get_range_partbound_string(spec->lowerdatums),
+ get_range_partbound_string(spec->upperdatums)),
+ parser_errposition(pstate, spec->location)));
}
if (partdesc->nparts > 0)
*/
if (cstate->transition_capture != NULL)
{
- int i;
+ int i;
cstate->transition_tupconv_maps = (TupleConversionMap **)
palloc0(sizeof(TupleConversionMap *) *
cstate->transition_capture->tcs_map = NULL;
}
}
+
/*
* We might need to convert from the parent rowtype to the
* partition rowtype.
LWLockAcquire(LogicalRepWorkerLock, LW_SHARED);
subworkers = logicalrep_workers_find(subid, false);
LWLockRelease(LogicalRepWorkerLock);
- foreach (lc, subworkers)
+ foreach(lc, subworkers)
{
LogicalRepWorker *w = (LogicalRepWorker *) lfirst(lc);
+
if (slotname)
logicalrep_worker_stop(w->subid, w->relid);
else
* having to construct this list again, so we request the strongest lock
* on all partitions. We need the strongest lock, because we may decide
* to scan them if we find out that the table being attached (or its leaf
- * partitions) may contain rows that violate the partition constraint.
- * If the table has a constraint that would prevent such rows, which by
+ * partitions) may contain rows that violate the partition constraint. If
+ * the table has a constraint that would prevent such rows, which by
* definition is present in all the partitions, we need not scan the
* table, nor its partitions. But we cannot risk a deadlock by taking a
* weaker lock now and the stronger one only when needed.
{
if (trigdesc != NULL)
{
- int i;
+ int i;
for (i = 0; i < trigdesc->numtriggers; ++i)
{
- Trigger *trigger = &trigdesc->triggers[i];
+ Trigger *trigger = &trigdesc->triggers[i];
if (trigger->tgoldtable != NULL || trigger->tgnewtable != NULL)
return trigger->tgname;
*/
if (row_trigger && transition_capture != NULL)
{
- HeapTuple original_insert_tuple = transition_capture->tcs_original_insert_tuple;
+ HeapTuple original_insert_tuple = transition_capture->tcs_original_insert_tuple;
TupleConversionMap *map = transition_capture->tcs_map;
- bool delete_old_table = transition_capture->tcs_delete_old_table;
- bool update_old_table = transition_capture->tcs_update_old_table;
- bool update_new_table = transition_capture->tcs_update_new_table;
- bool insert_new_table = transition_capture->tcs_insert_new_table;;
+ bool delete_old_table = transition_capture->tcs_delete_old_table;
+ bool update_old_table = transition_capture->tcs_update_old_table;
+ bool update_new_table = transition_capture->tcs_update_new_table;
+ bool insert_new_table = transition_capture->tcs_insert_new_table;;
if ((event == TRIGGER_EVENT_DELETE && delete_old_table) ||
(event == TRIGGER_EVENT_UPDATE && update_old_table))
* safely set for relfrozenxid or relminmxid.
*
* Before entering the main loop, establish the invariant that
- * next_unskippable_block is the next block number >= blkno that we
- * can't skip based on the visibility map, either all-visible for a
- * regular scan or all-frozen for an aggressive scan. We set it to
- * nblocks if there's no such block. We also set up the skipping_blocks
- * flag correctly at this stage.
+ * next_unskippable_block is the next block number >= blkno that we can't
+ * skip based on the visibility map, either all-visible for a regular scan
+ * or all-frozen for an aggressive scan. We set it to nblocks if there's
+ * no such block. We also set up the skipping_blocks flag correctly at
+ * this stage.
*
* Note: The value returned by visibilitymap_get_status could be slightly
* out-of-date, since we make this test before reading the corresponding
/*
* Perform stack depth check during the first execution of the node. We
* only do so the first time round because it turns out to not be cheap on
- * some common architectures (eg. x86). This relies on the assumption that
- * ExecProcNode calls for a given plan node will always be made at roughly
- * the same stack depth.
+ * some common architectures (eg. x86). This relies on the assumption
+ * that ExecProcNode calls for a given plan node will always be made at
+ * roughly the same stack depth.
*/
check_stack_depth();
ExecSetupTransitionCaptureState(ModifyTableState *mtstate, EState *estate)
{
ResultRelInfo *targetRelInfo = getASTriggerResultRelInfo(mtstate);
- int i;
+ int i;
/* Check for transition tables on the directly targeted relation. */
mtstate->mt_transition_capture =
if (mtstate->mt_transition_capture != NULL)
{
ResultRelInfo *resultRelInfos;
- int numResultRelInfos;
+ int numResultRelInfos;
/* Find the set of partitions so that we can find their TupleDescs. */
if (mtstate->mt_partition_dispatch_info != NULL)
else if (relkind == RELKIND_FOREIGN_TABLE)
{
/*
- * When there is a row-level trigger, there should be a
- * wholerow attribute.
+ * When there is a row-level trigger, there should be
+ * a wholerow attribute.
*/
j->jf_junkAttNo = ExecFindJunkAttribute(j, "wholerow");
}
n = -1;
break;
case SSL_ERROR_ZERO_RETURN:
+
/*
- * the SSL connnection was closed, leave it to the caller
- * to ereport it
+ * the SSL connnection was closed, leave it to the caller to
+ * ereport it
*/
errno = ECONNRESET;
n = -1;
*/
int
cx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring,
- int num_gene, City *city_table)
+ int num_gene, City * city_table)
{
int i,
start_pos,
*/
void
ox1(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene,
- City *city_table)
+ City * city_table)
{
int left,
right,
* position crossover
*/
void
-ox2(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
+ox2(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City * city_table)
{
int k,
j,
*/
void
px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene,
- City *city_table)
+ City * city_table)
{
int num_positions;
int i,
* deallocate memory of city table
*/
void
-free_city_table(PlannerInfo *root, City *city_table)
+free_city_table(PlannerInfo *root, City * city_table)
{
pfree(city_table);
}
/*
* If creating a new table (but not a foreign table), we can safely skip
- * validation of check constraints, and nonetheless mark them valid.
- * (This will override any user-supplied NOT VALID flag.)
+ * validation of check constraints, and nonetheless mark them valid. (This
+ * will override any user-supplied NOT VALID flag.)
*/
if (skipValidation)
{
typedef struct LogicalRepWorkerId
{
- Oid subid;
- Oid relid;
+ Oid subid;
+ Oid relid;
} LogicalRepWorkerId;
static List *on_commit_stop_workers = NIL;
logicalrep_worker_stop_at_commit(Oid subid, Oid relid)
{
LogicalRepWorkerId *wid;
- MemoryContext oldctx;
+ MemoryContext oldctx;
/* Make sure we store the info in context that survives until commit. */
oldctx = MemoryContextSwitchTo(TopTransactionContext);
{
if (isCommit)
{
- ListCell *lc;
+ ListCell *lc;
- foreach (lc, on_commit_stop_workers)
+ foreach(lc, on_commit_stop_workers)
{
LogicalRepWorkerId *wid = lfirst(lc);
+
logicalrep_worker_stop(wid->subid, wid->relid);
}
{
if (state->acquired_by != 0)
{
- ConditionVariable *cv;
+ ConditionVariable *cv;
if (nowait)
ereport(ERROR,
static void
ReplicationOriginExitCleanup(int code, Datum arg)
{
- ConditionVariable *cv = NULL;
+ ConditionVariable *cv = NULL;
LWLockAcquire(ReplicationOriginLock, LW_EXCLUSIVE);
void
replorigin_session_reset(void)
{
- ConditionVariable *cv;
+ ConditionVariable *cv;
Assert(max_replication_slots != 0);
* only ever look at those.
*
* NB: We only increase xmax when a catalog modifying transaction commits
- * (see SnapBuildCommitTxn). Because of this, xmax can be lower than xmin,
- * which looks odd but is correct and actually more efficient, since we hit
- * fast paths in tqual.c.
+ * (see SnapBuildCommitTxn). Because of this, xmax can be lower than
+ * xmin, which looks odd but is correct and actually more efficient, since
+ * we hit fast paths in tqual.c.
*/
builder->xmin = running->oldestRunningXid;
if (s->in_use && strcmp(name, NameStr(s->data.name)) == 0)
{
/*
- * This is the slot we want. We don't know yet if it's active,
- * so get ready to sleep on it in case it is. (We may end up not
+ * This is the slot we want. We don't know yet if it's active, so
+ * get ready to sleep on it in case it is. (We may end up not
* sleeping, but we don't want to do this while holding the
* spinlock.)
*/
goto retry;
}
else
- ConditionVariableCancelSleep(); /* no sleep needed after all */
+ ConditionVariableCancelSleep(); /* no sleep needed after all */
/* Let everybody know we've modified this slot */
ConditionVariableBroadcast(&slot->active_cv);
* WalSender has checked our LSN and has removed us from queue. Clean up
* state and leave. It's OK to reset these shared memory fields without
* holding SyncRepLock, because any walsenders will ignore us anyway when
- * we're not on the queue. We need a read barrier to make sure we see
- * the changes to the queue link (this might be unnecessary without
+ * we're not on the queue. We need a read barrier to make sure we see the
+ * changes to the queue link (this might be unnecessary without
* assertions, but better safe than sorry).
*/
pg_read_barrier();
for (i = 0; i < max_wal_senders; i++)
{
XLogRecPtr flush;
- WalSndState state;
+ WalSndState state;
int pid;
walsnd = &WalSndCtl->walsnds[i];
for (i = 0; i < max_wal_senders; i++)
{
XLogRecPtr flush;
- WalSndState state;
+ WalSndState state;
int pid;
walsnd = &WalSndCtl->walsnds[i];
* being careful not to generate a "permanent" XID.
*
* vacuum_defer_cleanup_age provides some additional "slop" for the
- * benefit of hot standby queries on standby servers. This is quick and
- * dirty, and perhaps not all that useful unless the master has a
+ * benefit of hot standby queries on standby servers. This is quick
+ * and dirty, and perhaps not all that useful unless the master has a
* predictable transaction rate, but it offers some protection when
* there's no walsender connection. Note that we are assuming
* vacuum_defer_cleanup_age isn't large enough to cause wraparound ---
list_length(spec->upperdatums));
appendStringInfo(buf, "FOR VALUES FROM %s TO %s",
- get_range_partbound_string(spec->lowerdatums),
- get_range_partbound_string(spec->upperdatums));
+ get_range_partbound_string(spec->lowerdatums),
+ get_range_partbound_string(spec->upperdatums));
break;
default:
print $conf "listen_addresses = '127.0.0.1'\n";
}
close $conf;
-my $ctlcmd = [ 'pg_ctl', 'start', '-D', "$tempdir/data",
- '-l', "$TestLib::log_path/001_start_stop_server.log" ];
+my $ctlcmd = [
+ 'pg_ctl', 'start', '-D', "$tempdir/data", '-l',
+ "$TestLib::log_path/001_start_stop_server.log" ];
if ($Config{osname} ne 'msys')
{
command_like($ctlcmd, qr/done.*server started/s, 'pg_ctl start');
}
else
{
+
# use the version of command_like that doesn't hang on Msys here
command_like_safe($ctlcmd, qr/done.*server started/s, 'pg_ctl start');
}
ret = gzread(fp->compressedfp, ptr, size);
if (ret != size && !gzeof(fp->compressedfp))
{
- int errnum;
+ int errnum;
const char *errmsg = gzerror(fp->compressedfp, &errnum);
exit_horribly(modulename,
if (res != len && !GZEOF(th->zFH))
{
#ifdef HAVE_LIBZ
- int errnum;
+ int errnum;
const char *errmsg = gzerror(th->zFH, &errnum);
exit_horribly(modulename,
dopt.no_security_labels = 1;
/*
- * On hot standbys, never try to dump unlogged table data, since it
- * will just throw an error.
+ * On hot standbys, never try to dump unlogged table data, since it will
+ * just throw an error.
*/
if (fout->isStandby)
dopt.no_unlogged_table_data = true;
*/
if (dopt->outputClean)
appendPQExpBuffer(query, " AND pip.objoid <> "
- "coalesce((select oid from pg_namespace "
- "where nspname = 'public'),0)");
+ "coalesce((select oid from pg_namespace "
+ "where nspname = 'public'),0)");
appendPQExpBuffer(query, ") ");
defaults_no_public => {
database => 'regress_pg_dump_test',
dump_cmd => [
- 'pg_dump',
- '--no-sync',
- '-f',
- "$tempdir/defaults_no_public.sql",
+ 'pg_dump', '--no-sync', '-f', "$tempdir/defaults_no_public.sql",
'regress_pg_dump_test', ], },
defaults_no_public_clean => {
database => 'regress_pg_dump_test',
dump_cmd => [
- 'pg_dump',
- '--no-sync',
- '-c',
- '-f',
+ 'pg_dump', '--no-sync', '-c', '-f',
"$tempdir/defaults_no_public_clean.sql",
'regress_pg_dump_test', ], },
with_oids => 1, }, },
'ALTER COLLATION test0 OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER COLLATION test0 OWNER TO .*;/m,
collation => 1,
like => {
test_schema_plus_blobs => 1, }, },
'ALTER FOREIGN DATA WRAPPER dummy OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER FOREIGN DATA WRAPPER dummy OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER FOREIGN DATA WRAPPER dummy OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
test_schema_plus_blobs => 1, }, },
'ALTER SERVER s1 OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER SERVER s1 OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER SERVER s1 OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
test_schema_plus_blobs => 1, }, },
'ALTER FUNCTION dump_test.pltestlang_call_handler() OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^
\QALTER FUNCTION dump_test.pltestlang_call_handler() \E
\QOWNER TO \E
.*;/xm,
role => 1, }, },
'ALTER OPERATOR FAMILY dump_test.op_family OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^
\QALTER OPERATOR FAMILY dump_test.op_family USING btree \E
\QOWNER TO \E
.*;/xm,
role => 1, }, },
'ALTER OPERATOR CLASS dump_test.op_class OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^
\QALTER OPERATOR CLASS dump_test.op_class USING btree \E
\QOWNER TO \E
.*;/xm,
section_post_data => 1, }, },
'ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
test_schema_plus_blobs => 1, }, },
'ALTER SCHEMA dump_test OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER SCHEMA dump_test OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER SCHEMA dump_test OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
role => 1, }, },
'ALTER SCHEMA dump_test_second_schema OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
section_post_data => 1, }, },
'ALTER TABLE test_table OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER TABLE test_table OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER TABLE test_table OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
role => 1, }, },
'ALTER TABLE test_second_table OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER TABLE test_second_table OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER TABLE test_second_table OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
role => 1, }, },
'ALTER TABLE test_third_table OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER TABLE test_third_table OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER TABLE test_third_table OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
test_schema_plus_blobs => 1, }, },
'ALTER TABLE measurement OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER TABLE measurement OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER TABLE measurement OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
role => 1, }, },
'ALTER TABLE measurement_y2006m2 OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER TABLE measurement_y2006m2 OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER TABLE measurement_y2006m2 OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
test_schema_plus_blobs => 1, }, },
'ALTER FOREIGN TABLE foreign_table OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
- regexp => qr/^ALTER FOREIGN TABLE foreign_table OWNER TO .*;/m,
- like => {
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
+ regexp => qr/^ALTER FOREIGN TABLE foreign_table OWNER TO .*;/m,
+ like => {
binary_upgrade => 1,
clean => 1,
clean_if_exists => 1,
role => 1, }, },
'ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
regexp =>
qr/^ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 OWNER TO .*;/m,
like => {
role => 1, }, },
'ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 OWNER TO' => {
- all_runs => 1,
- catch_all =>
- 'ALTER ... OWNER commands (except post-data objects)',
+ all_runs => 1,
+ catch_all => 'ALTER ... OWNER commands (except post-data objects)',
regexp =>
qr/^ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 OWNER TO .*;/m,
like => {
test_schema_plus_blobs => 1, }, },
'CREATE SCHEMA public' => {
- all_runs => 1,
- catch_all => 'CREATE ... commands',
- regexp => qr/^CREATE SCHEMA public;/m,
- like => {
- clean => 1,
- clean_if_exists => 1, },
+ all_runs => 1,
+ catch_all => 'CREATE ... commands',
+ regexp => qr/^CREATE SCHEMA public;/m,
+ like => {
+ clean => 1,
+ clean_if_exists => 1, },
unlike => {
binary_upgrade => 1,
createdb => 1,
section_data => 1, }, },
'DROP SCHEMA public (for testing without public schema)' => {
- all_runs => 1,
- database => 'regress_pg_dump_test',
+ all_runs => 1,
+ database => 'regress_pg_dump_test',
create_order => 100,
- create_sql => 'DROP SCHEMA public;',
- regexp => qr/^DROP SCHEMA public;/m,
- like => { },
- unlike => { defaults_no_public => 1,
- defaults_no_public_clean => 1, } },
+ create_sql => 'DROP SCHEMA public;',
+ regexp => qr/^DROP SCHEMA public;/m,
+ like => {},
+ unlike => {
+ defaults_no_public => 1,
+ defaults_no_public_clean => 1, } },
'DROP SCHEMA public' => {
all_runs => 1,
catch_all => 'DROP ... commands',
regexp => qr/^DROP SCHEMA public;/m,
- like => { clean => 1 },
- unlike => {
- clean_if_exists => 1,
+ like => { clean => 1 },
+ unlike => {
+ clean_if_exists => 1,
pg_dumpall_globals_clean => 1, }, },
'DROP SCHEMA IF EXISTS public' => {
all_runs => 1,
catch_all => 'DROP ... commands',
regexp => qr/^DROP SCHEMA IF EXISTS public;/m,
- like => { clean_if_exists => 1 },
- unlike => {
- clean => 1,
+ like => { clean_if_exists => 1 },
+ unlike => {
+ clean => 1,
pg_dumpall_globals_clean => 1, }, },
'DROP EXTENSION plpgsql' => {
}
# Create a second database for certain tests to work against
-$node->psql('postgres','create database regress_pg_dump_test;');
+$node->psql('postgres', 'create database regress_pg_dump_test;');
# Start with number of command_fails_like()*2 tests below (each
# command_fails_like is actually 2 tests)
foreach my $run (sort keys %pgdump_runs)
{
my $test_key = $run;
- my $run_db = 'postgres';
+ my $run_db = 'postgres';
- if (defined($pgdump_runs{$run}->{database})) {
+ if (defined($pgdump_runs{$run}->{database}))
+ {
$run_db = $pgdump_runs{$run}->{database};
}
# Then count all the tests run against each run
foreach my $test (sort keys %tests)
{
+
# postgres is the default database, if it isn't overridden
my $test_db = 'postgres';
# Specific tests can override the database to use
- if (defined($tests{$test}->{database})) {
+ if (defined($tests{$test}->{database}))
+ {
$test_db = $tests{$test}->{database};
}
# The database to test against needs to match the database the run is
# for, so skip combinations where they don't match up.
- if ($run_db ne $test_db) {
+ if ($run_db ne $test_db)
+ {
next;
}
{
my $test_db = 'postgres';
- if (defined($tests{$test}->{database})) {
+ if (defined($tests{$test}->{database}))
+ {
$test_db = $tests{$test}->{database};
}
{
union
{
- int64 i64;
- uint32 i32[2];
- } swap;
- int64 result;
+ int64 i64;
+ uint32 i32[2];
+ } swap;
+ int64 result;
swap.i64 = value;
/*
* The tuplestores backing the transition tables. We use separate
- * tuplestores for INSERT and UPDATE, because INSERT ... ON CONFLICT
- * ... DO UPDATE causes INSERT and UPDATE triggers to fire and needs a way
- * to keep track of the new tuple images resulting from the two cases
+ * tuplestores for INSERT and UPDATE, because INSERT ... ON CONFLICT ...
+ * DO UPDATE causes INSERT and UPDATE triggers to fire and needs a way to
+ * keep track of the new tuple images resulting from the two cases
* separately. We only need a single old image tuplestore, because there
* is no statement that can both update and delete at the same time.
*/
- Tuplestorestate *tcs_old_tuplestore; /* for DELETE and UPDATE old images */
+ Tuplestorestate *tcs_old_tuplestore; /* for DELETE and UPDATE old
+ * images */
Tuplestorestate *tcs_insert_tuplestore; /* for INSERT new images */
Tuplestorestate *tcs_update_tuplestore; /* for UPDATE new images */
} TransitionCaptureState;
/* Per partition tuple conversion map */
TupleTableSlot *mt_partition_tuple_slot;
struct TransitionCaptureState *mt_transition_capture;
- /* controls transition table population */
+ /* controls transition table population */
TupleConversionMap **mt_transition_tupconv_maps;
- /* Per plan/partition tuple conversion */
+ /* Per plan/partition tuple conversion */
} ModifyTableState;
/* ----------------
int tour1_position;
int used;
int select_list;
-} City;
+} City;
-extern City *alloc_city_table(PlannerInfo *root, int num_gene);
-extern void free_city_table(PlannerInfo *root, City *city_table);
+extern City * alloc_city_table(PlannerInfo *root, int num_gene);
+extern void free_city_table(PlannerInfo *root, City * city_table);
/* cycle crossover [CX] */
extern int cx(PlannerInfo *root, Gene *tour1, Gene *tour2,
- Gene *offspring, int num_gene, City *city_table);
+ Gene *offspring, int num_gene, City * city_table);
/* position crossover [PX] */
extern void px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring,
- int num_gene, City *city_table);
+ int num_gene, City * city_table);
/* order crossover [OX1] according to Davis */
extern void ox1(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
- int num_gene, City *city_table);
+ int num_gene, City * city_table);
/* order crossover [OX2] according to Syswerda */
extern void ox2(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
- int num_gene, City *city_table);
+ int num_gene, City * city_table);
#endif /* GEQO_RECOMBINATION_H */
{
my ($self, $dbname, $query, $expected) = @_;
- $expected = 't' unless defined($expected); # default value
+ $expected = 't' unless defined($expected); # default value
- my $cmd =
- [ 'psql', '-XAt', '-c', $query, '-d', $self->connstr($dbname) ];
+ my $cmd = [ 'psql', '-XAt', '-c', $query, '-d', $self->connstr($dbname) ];
my ($stdout, $stderr);
my $max_attempts = 180 * 10;
my $attempts = 0;
sub command_like_safe
{
+
# Doesn't rely on detecting end of file on the file descriptors,
# which can fail, causing the process to hang, notably on Msys
# when used with 'pg_ctl start'
{
my ($node, $slotname, $check_expr) = @_;
- $node->poll_query_until('postgres', qq[
+ $node->poll_query_until(
+ 'postgres', qq[
SELECT $check_expr
FROM pg_catalog.pg_replication_slots
WHERE slot_name = '$slotname';
- ])
- or die "Timed out waiting for slot xmins to advance";
+ ]) or die "Timed out waiting for slot xmins to advance";
my $slotinfo = $node->slot($slotname);
return ($slotinfo->{'xmin'}, $slotinfo->{'catalog_xmin'});
# There's no hot standby feedback and there are no logical slots on either peer
# so xmin and catalog_xmin should be null on both slots.
my ($xmin, $catalog_xmin) = get_slot_xmins($node_master, $slotname_1,
- "xmin IS NULL AND catalog_xmin IS NULL");
-is($xmin, '', 'xmin of non-cascaded slot null with no hs_feedback');
-is($catalog_xmin, '', 'catalog xmin of non-cascaded slot null with no hs_feedback');
+ "xmin IS NULL AND catalog_xmin IS NULL");
+is($xmin, '', 'xmin of non-cascaded slot null with no hs_feedback');
+is($catalog_xmin, '',
+ 'catalog xmin of non-cascaded slot null with no hs_feedback');
($xmin, $catalog_xmin) = get_slot_xmins($node_standby_1, $slotname_2,
- "xmin IS NULL AND catalog_xmin IS NULL");
-is($xmin, '', 'xmin of cascaded slot null with no hs_feedback');
-is($catalog_xmin, '', 'catalog xmin of cascaded slot null with no hs_feedback');
+ "xmin IS NULL AND catalog_xmin IS NULL");
+is($xmin, '', 'xmin of cascaded slot null with no hs_feedback');
+is($catalog_xmin, '',
+ 'catalog xmin of cascaded slot null with no hs_feedback');
# Replication still works?
$node_master->safe_psql('postgres', 'CREATE TABLE replayed(val integer);');
replay_check();
($xmin, $catalog_xmin) = get_slot_xmins($node_master, $slotname_1,
- "xmin IS NOT NULL AND catalog_xmin IS NULL");
+ "xmin IS NOT NULL AND catalog_xmin IS NULL");
isnt($xmin, '', 'xmin of non-cascaded slot non-null with hs feedback');
is($catalog_xmin, '',
'catalog xmin of non-cascaded slot still null with hs_feedback');
my ($xmin1, $catalog_xmin1) = get_slot_xmins($node_standby_1, $slotname_2,
- "xmin IS NOT NULL AND catalog_xmin IS NULL");
+ "xmin IS NOT NULL AND catalog_xmin IS NULL");
isnt($xmin1, '', 'xmin of cascaded slot non-null with hs feedback');
is($catalog_xmin1, '',
'catalog xmin of cascaded slot still null with hs_feedback');
note "doing some work to advance xmin";
-$node_master->safe_psql('postgres', q{
+$node_master->safe_psql(
+ 'postgres', q{
do $$
begin
for i in 10000..11000 loop
$node_master->safe_psql('postgres', 'VACUUM;');
$node_master->safe_psql('postgres', 'CHECKPOINT;');
-my ($xmin2, $catalog_xmin2) = get_slot_xmins($node_master, $slotname_1,
- "xmin <> '$xmin'");
+my ($xmin2, $catalog_xmin2) =
+ get_slot_xmins($node_master, $slotname_1, "xmin <> '$xmin'");
note "master slot's new xmin $xmin2, old xmin $xmin";
isnt($xmin2, $xmin, 'xmin of non-cascaded slot with hs feedback has changed');
is($catalog_xmin2, '',
- 'catalog xmin of non-cascaded slot still null with hs_feedback unchanged');
+ 'catalog xmin of non-cascaded slot still null with hs_feedback unchanged'
+);
-($xmin2, $catalog_xmin2) = get_slot_xmins($node_standby_1, $slotname_2,
- "xmin <> '$xmin1'");
+($xmin2, $catalog_xmin2) =
+ get_slot_xmins($node_standby_1, $slotname_2, "xmin <> '$xmin1'");
note "standby_1 slot's new xmin $xmin2, old xmin $xmin1";
isnt($xmin2, $xmin1, 'xmin of cascaded slot with hs feedback has changed');
is($catalog_xmin2, '',
replay_check();
($xmin, $catalog_xmin) = get_slot_xmins($node_master, $slotname_1,
- "xmin IS NULL AND catalog_xmin IS NULL");
+ "xmin IS NULL AND catalog_xmin IS NULL");
is($xmin, '', 'xmin of non-cascaded slot null with hs feedback reset');
is($catalog_xmin, '',
- 'catalog xmin of non-cascaded slot still null with hs_feedback reset');
+ 'catalog xmin of non-cascaded slot still null with hs_feedback reset');
($xmin, $catalog_xmin) = get_slot_xmins($node_standby_1, $slotname_2,
- "xmin IS NULL AND catalog_xmin IS NULL");
-is($xmin, '', 'xmin of cascaded slot null with hs feedback reset');
+ "xmin IS NULL AND catalog_xmin IS NULL");
+is($xmin, '', 'xmin of cascaded slot null with hs feedback reset');
is($catalog_xmin, '',
'catalog xmin of cascaded slot still null with hs_feedback reset');
'ALTER SYSTEM SET hot_standby_feedback = off;');
$node_standby_2->stop;
-($xmin, $catalog_xmin) = get_slot_xmins($node_standby_1, $slotname_2,
- "xmin IS NOT NULL");
+($xmin, $catalog_xmin) =
+ get_slot_xmins($node_standby_1, $slotname_2, "xmin IS NOT NULL");
isnt($xmin, '', 'xmin of cascaded slot non-null with postgres shut down');
# Xmin from a previous run should be cleared on startup.
$node_standby_2->start;
-($xmin, $catalog_xmin) = get_slot_xmins($node_standby_1, $slotname_2,
- "xmin IS NULL");
+($xmin, $catalog_xmin) =
+ get_slot_xmins($node_standby_1, $slotname_2, "xmin IS NULL");
is($xmin, '',
'xmin of cascaded slot reset after startup with hs feedback reset');
'-S', 'otherdb_slot', '-f', '-', '--start' ]);
$node_master->poll_query_until('otherdb',
"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NOT NULL)"
- )
- or die "slot never became active";
+ ) or die "slot never became active";
is($node_master->psql('postgres', 'DROP DATABASE otherdb'),
3, 'dropping a DB with active logical slots fails');
$pg_recvlogical->kill_kill;
$node_master->poll_query_until('otherdb',
"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NULL)"
-)
- or die "slot never became inactive";
+) or die "slot never became inactive";
is($node_master->psql('postgres', 'DROP DATABASE otherdb'),
0, 'dropping a DB with inactive logical slots succeeds');
$self->reload;
}
- ok( $self->poll_query_until('postgres', $check_sql, $expected), $msg);
+ ok($self->poll_query_until('postgres', $check_sql, $expected), $msg);
}
# Initialize master node
'postgresql.conf', qq(
$parameter
));
- $node->psql('postgres', "SELECT pg_reload_conf()",
- stdout => \$psql_out);
+ $node->psql('postgres', "SELECT pg_reload_conf()", stdout => \$psql_out);
is($psql_out, 't', "reload node $name with $parameter");
}
# Switch to synchronous replication in both directions
configure_and_reload($node_london, "synchronous_standby_names = 'paris'");
-configure_and_reload($node_paris, "synchronous_standby_names = 'london'");
+configure_and_reload($node_paris, "synchronous_standby_names = 'london'");
# Set up nonce names for current master and standby nodes
note "Initially, london is master and paris is standby";
'postgres',
"SELECT * FROM t_009_tbl ORDER BY id",
stdout => \$psql_out);
-is($psql_out, qq{1|issued to london
+is( $psql_out, qq{1|issued to london
2|issued to london
5|issued to london
6|issued to london
24|issued to paris
25|issued to london
26|issued to london},
- "Check expected t_009_tbl data on master");
+ "Check expected t_009_tbl data on master");
$cur_master->psql(
'postgres',
"SELECT * FROM t_009_tbl2",
stdout => \$psql_out);
-is($psql_out, qq{27|issued to paris},
- "Check expected t_009_tbl2 data on master");
+is( $psql_out,
+ qq{27|issued to paris},
+ "Check expected t_009_tbl2 data on master");
$cur_standby->psql(
'postgres',
'postgres',
"SELECT * FROM t_009_tbl ORDER BY id",
stdout => \$psql_out);
-is($psql_out, qq{1|issued to london
+is( $psql_out, qq{1|issued to london
2|issued to london
5|issued to london
6|issued to london
24|issued to paris
25|issued to london
26|issued to london},
- "Check expected t_009_tbl data on standby");
+ "Check expected t_009_tbl data on standby");
$cur_standby->psql(
'postgres',
"SELECT * FROM t_009_tbl2",
stdout => \$psql_out);
-is($psql_out, qq{27|issued to paris},
- "Check expected t_009_tbl2 data on standby");
+is( $psql_out,
+ qq{27|issued to paris},
+ "Check expected t_009_tbl2 data on standby");
SELECT catalog_xmin IS NOT NULL
FROM pg_replication_slots
WHERE slot_name = 'phys_slot'
- ])
- or die "slot's catalog_xmin never became set";
+ ]) or die "slot's catalog_xmin never became set";
my $phys_slot = $node_master->slot('phys_slot');
isnt($phys_slot->{'xmin'}, '', 'xmin assigned on physical slot of master');
"CREATE TABLE tab_ins AS SELECT generate_series(1,1002) AS a");
$node_publisher->safe_psql('postgres',
"CREATE TABLE tab_full AS SELECT generate_series(1,10) AS a");
-$node_publisher->safe_psql('postgres',
- "CREATE TABLE tab_full2 (x text)");
+$node_publisher->safe_psql('postgres', "CREATE TABLE tab_full2 (x text)");
$node_publisher->safe_psql('postgres',
"INSERT INTO tab_full2 VALUES ('a'), ('b'), ('b')");
$node_publisher->safe_psql('postgres',
"CREATE TABLE tab_rep (a int primary key)");
$node_publisher->safe_psql('postgres',
- "CREATE TABLE tab_mixed (a int primary key, b text)");
+ "CREATE TABLE tab_mixed (a int primary key, b text)");
$node_publisher->safe_psql('postgres',
- "INSERT INTO tab_mixed (a, b) VALUES (1, 'foo')");
+ "INSERT INTO tab_mixed (a, b) VALUES (1, 'foo')");
# Setup structure on subscriber
$node_subscriber->safe_psql('postgres', "CREATE TABLE tab_notrep (a int)");
$node_subscriber->safe_psql('postgres', "CREATE TABLE tab_full2 (x text)");
$node_subscriber->safe_psql('postgres',
"CREATE TABLE tab_rep (a int primary key)");
+
# different column count and order than on publisher
$node_subscriber->safe_psql('postgres',
- "CREATE TABLE tab_mixed (c text, b text, a int primary key)");
+ "CREATE TABLE tab_mixed (c text, b text, a int primary key)");
# Setup logical replication
my $publisher_connstr = $node_publisher->connstr . ' dbname=postgres';
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION tap_pub_ins_only WITH (publish = insert)");
$node_publisher->safe_psql('postgres',
- "ALTER PUBLICATION tap_pub ADD TABLE tab_rep, tab_full, tab_full2, tab_mixed");
+"ALTER PUBLICATION tap_pub ADD TABLE tab_rep, tab_full, tab_full2, tab_mixed"
+);
$node_publisher->safe_psql('postgres',
"ALTER PUBLICATION tap_pub_ins_only ADD TABLE tab_ins");
$node_publisher->safe_psql('postgres', "DELETE FROM tab_rep WHERE a > 20");
$node_publisher->safe_psql('postgres', "UPDATE tab_rep SET a = -a");
-$node_publisher->safe_psql('postgres', "INSERT INTO tab_mixed VALUES (2, 'bar')");
+$node_publisher->safe_psql('postgres',
+ "INSERT INTO tab_mixed VALUES (2, 'bar')");
$node_publisher->poll_query_until('postgres', $caughtup_query)
or die "Timed out while waiting for subscriber to catch up";
"SELECT count(*), min(a), max(a) FROM tab_rep");
is($result, qq(20|-20|-1), 'check replicated changes on subscriber');
-$result = $node_subscriber->safe_psql('postgres',
- "SELECT c, b, a FROM tab_mixed");
-is($result, qq(|foo|1
+$result =
+ $node_subscriber->safe_psql('postgres', "SELECT c, b, a FROM tab_mixed");
+is( $result, qq(|foo|1
|bar|2), 'check replicated changes with different column order');
# insert some duplicate rows
# and do the updates
$node_publisher->safe_psql('postgres', "UPDATE tab_full SET a = a * a");
-$node_publisher->safe_psql('postgres', "UPDATE tab_full2 SET x = 'bb' WHERE x = 'b'");
+$node_publisher->safe_psql('postgres',
+ "UPDATE tab_full2 SET x = 'bb' WHERE x = 'b'");
# Wait for subscription to catch up
$node_publisher->poll_query_until('postgres', $caughtup_query)
$result = $node_subscriber->safe_psql('postgres',
"SELECT x FROM tab_full2 ORDER BY 1");
-is($result, qq(a
+is( $result, qq(a
bb
bb),
'update works with REPLICA IDENTITY FULL and text datums');
# Add defines from Perl's ccflags; see PGAC_CHECK_PERL_EMBED_CCFLAGS
my @perl_embed_ccflags;
- foreach my $f (split(" ",$Config{ccflags}))
+ foreach my $f (split(" ", $Config{ccflags}))
{
- if ($f =~ /^-D[^_]/ ||
- $f =~ /^-D_USE_32BIT_TIME_T/)
+ if ( $f =~ /^-D[^_]/
+ || $f =~ /^-D_USE_32BIT_TIME_T/)
{
$f =~ s/\-D//;
push(@perl_embed_ccflags, $f);
{
next unless $_[$arg] =~ /^PROVE_FLAGS=(.*)/;
@flags = split(/\s+/, $1);
- splice(@_,$arg,1);
+ splice(@_, $arg, 1);
last;
}
die "no tests found!" unless -d "$topdir/$dir/t";
- push(@args,"$topdir/$dir");
+ push(@args, "$topdir/$dir");
InstallTemp();
my $status = tap_check(@args);
# Update for pg_bsd_indent version
my $INDENT_VERSION = "2.0";
+
# Our standard indent settings
my $indent_opts =
- "-bad -bap -bbb -bc -bl -cli1 -cp33 -cdb -nce -d0 -di12 -nfc1 -i4 -l79 -lp -lpl -nip -npro -sac -tpg -ts4";
+"-bad -bap -bbb -bc -bl -cli1 -cp33 -cdb -nce -d0 -di12 -nfc1 -i4 -l79 -lp -lpl -nip -npro -sac -tpg -ts4";
-my $devnull = File::Spec->devnull;
+my $devnull = File::Spec->devnull;
my ($typedefs_file, $typedef_str, $code_base, $excludes, $indent, $build);
if ($? == 0)
{
print STDERR
- "You appear to have GNU indent rather than BSD indent.\n";
+ "You appear to have GNU indent rather than BSD indent.\n";
exit 1;
}
}
my $source = shift;
my $error_message = shift;
- my $cmd =
- "$indent $indent_opts -U" . $filtered_typedefs_fh->filename;
+ my $cmd = "$indent $indent_opts -U" . $filtered_typedefs_fh->filename;
my $tmp_fh = new File::Temp(TEMPLATE => "pgsrcXXXXX");
my $filename = $tmp_fh->filename;
foreach my $source_filename (@files)
{
+
# Automatically ignore .c and .h files that correspond to a .y or .l
# file. indent tends to get badly confused by Bison/flex output,
# and there's no value in indenting derived files anyway.
CheckpointerRequest
CheckpointerShmemStruct
Chromosome
-City
CkptSortItem
CkptTsStatus
ClientAuthentication_hook_type
CoercionContext
CoercionForm
CoercionPathType
+CollAliasData
CollInfo
CollateClause
CollateExpr
ExecParallelEstimateContext
ExecParallelInitializeDSMContext
ExecPhraseData
+ExecProcNodeMtd
ExecRowMark
ExecScanAccessMtd
ExecScanRecheckMtd
LogicalRepTupleData
LogicalRepTyp
LogicalRepWorker
+LogicalRepWorkerId
LogicalRewriteMappingData
LogicalTape
LogicalTapeSet
Range
RangeBound
RangeBox
-RangeDatumContent
RangeFunction
RangeIOData
RangeQueryClause
ResourceReleaseCallbackItem
ResourceReleasePhase
RestoreOptions
+RestorePass
RestrictInfo
Result
ResultPath
TransactionStmtKind
TransformInfo
TransformJsonStringValuesState
+TransitionCaptureState
TrgmArc
TrgmArcInfo
TrgmColor
WaitEventIPC
WaitEventSet
WaitEventTimeout
+WaitPMResult
WalCloseMethod
WalLevel
WalRcvData