PostgreSQL
This guide walks you through preparing your PostgreSQL environment for MCPMark evaluation.
1. Setup PostgreSQL Environment
1.1 Start PostgreSQL with Docker
-
Run PostgreSQL Container Start a PostgreSQL instance using Docker:
Shell -
Verify Container is Running
Shell
1.2 Import Sample Databases
-
Download Database Backups Download the backup files from the provided source and place them in
./postgres_state/
directory. -
Create Databases and Restore from Backups
Shell -
Verify Databases are Imported
Shell
2. Configure Environment Variables
Configure environment variables: make sure the following enservice credentials are added in .mcp_env
:
3. Verify Connection
Verify the PostgreSQL setup is working correctly:
4. Common Operations
Stop PostgreSQL Container
docker stop mcpmark-postgres
Start PostgreSQL Container
docker start mcpmark-postgres
Remove PostgreSQL Container (Clean Setup)
Access PostgreSQL Shell
5. Running Postgres Experiment
For single task or task group, run
Here EXPNAME refers to customized experiment name, POSTGRESTASK refers to the postgres task or task group selected (see tasks/
for specific task information), MODEL refers to the selected model (see Introduction Page for model supported), K refers to the time of independent experiments.
6. Troubleshooting
Port Already in Use
If port 5432 is already in use, you can use a different port:
Remember to update POSTGRES_PORT="5433"
in your .mcp_env
file.
Connection Refused
Ensure the Docker container is running and the port mapping is correct: