31

I am looking for a sample database (schema+data) for PostgreSQL 9. Is there a repository somewhere for sample databases?

6 Answers 6

22

There's a PgFoundry project that contains several example PostgreSQL databases. Most of these haven't been updated for a while, but will still work with recent PostgreSQL versions.

If you need a bigger database, the MusicBrainz music metadata database has full database dumps available for download.

2
  • 2
    If you need a huge database, you can download tools to bulk generate data for the TPC-H benchmark from tpc.org/tpch
    – anon
    Mar 19, 2011 at 19:47
  • Great on Musicbrainz! I was searching pg data for testing some BI tools, I like this one!
    – franblay
    Jan 21, 2014 at 13:00
14

I just published a PostgreSQL port of the Open Source Shakespeare database: https://github.com/catherinedevlin/opensourceshakespeare. It's much more fun than all those other sample databases.

2
  • 2
    why don't you wrap it into dockerfile so can be used as a service using single command?
    – jangorecki
    Oct 24, 2015 at 20:41
  • License prohibits use in commercial software (e.g. for a test database)
    – Eloff
    Jul 29, 2019 at 16:29
10

You can find some in the PostgreSQL wiki: http://wiki.postgresql.org/wiki/Sample_Databases

1
  • 1
    the sample download file no longer exist
    – dez
    Dec 15, 2014 at 21:33
2

Many of the examples referenced here or in other places are defunct or require a good number of hoops to jump through to get working (more than I was willing to jump).

I finally discovered that the DBeaver SQL client has a "Generate Mock Data" tool that can fill in tables with sample data. It can handle various data types, you can give it strings to use for text, and it handles foreign keys. You can configure large numbers of rows (e.g. 900,000) for insert, and it is also DB agnostic so it should work for mySQL, SQL Server, etc.

menu item sample data config

1

I also made a sample PostgreSQL database based on IMDb. I also tried to update the sample exercises, so that a beginner can learn from it and practice on it.

Link: PostgreSQL Sample Database.

0

I have found: http://www.postgression.com/

But the dbsamples main page from pgfoundry disappeared... I have rediscovered http://pgfoundry.org/frs/?group_id=1000150

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.