MCPcopy Create free account
hub / github.com/apache/cloudberry / initCreateFKeys

Function initCreateFKeys

src/bin/pgbench/pgbench.c:4421–4438  ·  view source on GitHub ↗

* Create foreign key constraints between the standard tables */

Source from the content-addressed store, hash-verified

4419 * Create foreign key constraints between the standard tables
4420 */
4421static void
4422initCreateFKeys(PGconn *con)
4423{
4424 static const char *const DDLKEYs[] = {
4425 "alter table pgbench_tellers add constraint pgbench_tellers_bid_fkey foreign key (bid) references pgbench_branches",
4426 "alter table pgbench_accounts add constraint pgbench_accounts_bid_fkey foreign key (bid) references pgbench_branches",
4427 "alter table pgbench_history add constraint pgbench_history_bid_fkey foreign key (bid) references pgbench_branches",
4428 "alter table pgbench_history add constraint pgbench_history_tid_fkey foreign key (tid) references pgbench_tellers",
4429 "alter table pgbench_history add constraint pgbench_history_aid_fkey foreign key (aid) references pgbench_accounts"
4430 };
4431 int i;
4432
4433 fprintf(stderr, "creating foreign keys...\n");
4434 for (i = 0; i < lengthof(DDLKEYs); i++)
4435 {
4436 executeStatement(con, DDLKEYs[i]);
4437 }
4438}
4439
4440/*
4441 * Validate an initialization-steps string

Callers 1

runInitStepsFunction · 0.85

Calls 1

executeStatementFunction · 0.85

Tested by

no test coverage detected