Sample database for PostgreSQL
Asked Answered
B

7

34

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

Breechloader answered 19/3, 2011 at 17:28 Comment(0)
C
24

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.

Cann answered 19/3, 2011 at 17:41 Comment(2)
If you need a huge database, you can download tools to bulk generate data for the TPC-H benchmark from tpc.org/tpchRafaellle
Great on Musicbrainz! I was searching pg data for testing some BI tools, I like this one!Modular
C
15

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.

Cutaway answered 10/3, 2013 at 3:59 Comment(2)
why don't you wrap it into dockerfile so can be used as a service using single command?Luxuriant
License prohibits use in commercial software (e.g. for a test database)Mccune
C
10

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

Correctitude answered 19/3, 2011 at 17:42 Comment(1)
the sample download file no longer existKumiss
A
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

Acquah answered 13/8, 2019 at 2:59 Comment(0)
T
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.

Terraterrace answered 1/2, 2018 at 6:10 Comment(0)
A
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

Alber answered 28/4, 2015 at 10:2 Comment(0)
S
0

You can find sample database schemas in https://databasesample.com/databases.

You can also export to PostgreSQL but unfortunately there is no data sample.

Smallsword answered 12/6 at 14:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.