* Create foreign key constraints between the standard tables */
| 4419 | * Create foreign key constraints between the standard tables |
| 4420 | */ |
| 4421 | static void |
| 4422 | initCreateFKeys(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 |
no test coverage detected