Conversion of the Lahman Baseball Database to PostgreSQL.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

The Lahman Baseball Database (PostgreSQL)

Conversion of the Lahman Baseball Database structure to PostgreSQL.


Postgres doesn't like columns that begin with numbers without switching to quoted column names. So all 2B and 3B columns have been converted to H2B and H3B.


Download the CSV files from, or pull the latest download from chadwickbureau/baseballdatabank.

Once you have the CSV files downloaded, open the appropriate year folder and run the lahman_structure.sql file. You can then modify the import.sql file to point to the location of your files.

Copyright Notice & Limited Use License

This database is copyright 1996-2016 by Sean Lahman.

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. For details see:

Thanks to Ted Turocy of the Chadwick Baseball Bureau, who did the heavy lifting to make the 2015 update possible. Ted also hosts a version of the data at github, for folks who are inclined to interface with it that way. Adam McIntosh created the SQL version.