- (Optional) Create Database:
createdb -U musicbrainz musicbrainz
- Create Schema in your Table:
CREATE SCHEMA musicbrainz;
- Import Schema(There are some errors...let's ignore them):
psql -U musicbrainz -d musicbrainz -f schema_dump.sql
- Import actual dump(Takes a while):
psql -U musicbrainz -d musicbrainz -f dump.sql
- (Optional) Connect to DB & check data:
psql -U musicbrainz -d musicbrainz
- Something like:
musicbrainz=# select name from artist limit 10;
name
----------------------
HEATWAVE
Maria Robin
Olivier Bernex
Jose Montealegre
ブライアン・ロスコー
Rumberos Catalans
Karyn Williams
Sulfur
オグ
Masia One
(10 rows)
musicbrainz=# select count(*) from artist;
count
---------
2280863
(1 row)
musicbrainz=# \d+ artist
Table "musicbrainz.artist"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
------------------+--------------------------+-----------+----------+------------------------------------+----------+-------------+--------------+-------------
id | integer | | not null | nextval('artist_id_seq'::regclass) | plain | | |
gid | uuid | | not null | | plain | | |
name | character varying | | not null | | extended | | |
sort_name | character varying | | not null | | extended | | |
begin_date_year | smallint | | | | plain | | |
begin_date_month | smallint | | | | plain | | |
begin_date_day | smallint | | | | plain | | |
end_date_year | smallint | | | | plain | | |
end_date_month | smallint | | | | plain | | |
end_date_day | smallint | | | | plain | | |
type | integer | | | | plain | | |
area | integer | | | | plain | | |
gender | integer | | | | plain | | |
comment | character varying(255) | | not null | ''::character varying | extended | | |
edits_pending | integer | | not null | 0 | plain | | |
last_updated | timestamp with time zone | | | now() | plain | | |
ended | boolean | | not null | false | plain | | |
begin_area | integer | | | | plain | | |
end_area | integer | | | | plain | | |
Indexes:
"artist_pkey" PRIMARY KEY, btree (id)
"artist_idx_area" btree (area)
"artist_idx_begin_area" btree (begin_area)
"artist_idx_end_area" btree (end_area)
"artist_idx_gid" UNIQUE, btree (gid)
"artist_idx_name" btree (name)
"artist_idx_null_comment" UNIQUE, btree (name) WHERE comment IS NULL
"artist_idx_sort_name" btree (sort_name)
"artist_idx_uniq_name_comment" UNIQUE, btree (name, comment) WHERE comment IS NOT NULL
Check constraints:
"artist_edits_pending_check" CHECK (edits_pending >= 0)
"artist_ended_check" CHECK ((end_date_year IS NOT NULL OR end_date_month IS NOT NULL OR end_date_day IS NOT NULL) AND ended = true OR end_date_year IS NULL AND end_date_month IS NULL AND end_date_day IS NULL)
Access method: heap
musicbrainz=#