Automatic Index Creation and Foreign Key Constraint Creation Are Prohibited During the PostgreSQL Test.
Symptom
The error message "there is no unique constraint matching given keys for referenced table" is displayed when data is loaded for initialization during the PostgreSQL test.

Key Process and Cause Analysis
In the runDatabaseBuild.sh file, the content in line 17 AFTER LOAD-"indexCreates foreignKeys buildFinish" is commented out by default. That is, after data is loaded, operations such as automatic index creation and foreign key constraint creation are prohibited. If these operations are required after the data is loaded, uncomment this line. In addition, comment out AFTER LOAD-"foreignKeys buildFinish" in line 18 to disable the creation of foreign key relationships.
Conclusion and Solution
Modify the runDatabaseBuild.sh file to rectify the fault.
- Open the runDatabaseBuild.sh file.
vim /home/benchmarksql5.0-for-postgresql/run/runDatabaseBuild.sh
- Press i to enter the insert mode, delete the number sign # at the beginning of line 17, and add # at the beginning of line 18 to comment out the line. The following figure shows the modification result.

- Press Esc, type :wq!, and press Enter to save the file and exit.
Parent topic: Troubleshooting