· 10 years ago · Mar 23, 2016, 06:27 AM
1-- PostgreSQL database dump
2--
3SET statement_timeout = 0;
4SET lock_timeout = 0;
5SET client_encoding = 'UTF8';
6SET standard_conforming_strings = on;
7SET check_function_bodies = false;
8SET client_min_messages = warning;
9CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
10COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
11SET search_path = public, pg_catalog;
12SET default_tablespace = '';
13SET default_with_oids = false;
14
15-- Name: dc; Type: TABLE; Schema: public; Owner: profh; Tablespace:
16--
17CREATE TABLE dc (
18 hero_id integer NOT NULL,
19 name character varying(50),
20 power character varying(255),
21 active boolean DEFAULT true
22);
23ALTER TABLE dc OWNER TO profh;
24
25-- Name: dc_hero_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
26--
27CREATE SEQUENCE dc_hero_id_seq
28 START WITH 1
29 INCREMENT BY 1
30 NO MINVALUE
31 NO MAXVALUE
32 CACHE 1;
33ALTER TABLE dc_hero_id_seq OWNER TO profh;
34ALTER SEQUENCE dc_hero_id_seq OWNED BY dc.hero_id;
35
36-- Name: heroes; Type: TABLE; Schema: public; Owner: profh; Tablespace:
37--
38CREATE TABLE heroes (
39 hero_id integer NOT NULL,
40 name character varying(50),
41 power character varying(255),
42 active boolean DEFAULT true,
43 age integer
44);
45ALTER TABLE heroes OWNER TO profh;
46
47-- Name: heroes_hero_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
48--
49CREATE SEQUENCE heroes_hero_id_seq
50 START WITH 1
51 INCREMENT BY 1
52 NO MINVALUE
53 NO MAXVALUE
54 CACHE 1;
55ALTER TABLE heroes_hero_id_seq OWNER TO profh;
56ALTER SEQUENCE heroes_hero_id_seq OWNED BY heroes.hero_id;
57
58
59--
60-- Name: identities; Type: TABLE; Schema: public; Owner: profh; Tablespace:
61--
62
63CREATE TABLE identities (
64 hero_id integer NOT NULL,
65 person_id integer NOT NULL
66);
67ALTER TABLE identities OWNER TO profh;
68
69-- Name: marvel; Type: TABLE; Schema: public; Owner: profh; Tablespace:
70--
71
72CREATE TABLE marvel (
73 hero_id integer NOT NULL,
74 name character varying(50),
75 power character varying(255),
76 active boolean DEFAULT true
77);
78ALTER TABLE marvel OWNER TO profh;
79
80-- Name: marvel_hero_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
81--
82CREATE SEQUENCE marvel_hero_id_seq
83 START WITH 1
84 INCREMENT BY 1
85 NO MINVALUE
86 NO MAXVALUE
87 CACHE 1;
88ALTER TABLE marvel_hero_id_seq OWNER TO profh;
89ALTER SEQUENCE marvel_hero_id_seq OWNED BY marvel.hero_id;
90
91-- Name: people; Type: TABLE; Schema: public; Owner: profh; Tablespace:
92--
93CREATE TABLE people (
94 person_id integer NOT NULL,
95 first_name character varying(50),
96 last_name character varying(50),
97 height integer,
98 weight integer,
99 is_male boolean,
100 active boolean DEFAULT true,
101 email character varying(50)
102);
103ALTER TABLE people OWNER TO profh;
104
105-- Name: people_person_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
106--
107
108CREATE SEQUENCE people_person_id_seq
109 START WITH 1
110 INCREMENT BY 1
111 NO MINVALUE
112 NO MAXVALUE
113 CACHE 1;
114ALTER TABLE people_person_id_seq OWNER TO profh;
115ALTER SEQUENCE people_person_id_seq OWNED BY people.person_id;
116
117-- Name: victories; Type: TABLE; Schema: public; Owner: profh; Tablespace:
118--
119
120CREATE TABLE victories (
121 id integer NOT NULL,
122 hero_id integer NOT NULL,
123 major integer DEFAULT 0,
124 minor integer DEFAULT 0,
125 for_month date NOT NULL
126);
127ALTER TABLE victories OWNER TO profh;
128
129-- Name: victories_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
130--
131
132CREATE SEQUENCE victories_id_seq
133 START WITH 1
134 INCREMENT BY 1
135 NO MINVALUE
136 NO MAXVALUE
137 CACHE 1;
138ALTER TABLE victories_id_seq OWNER TO profh;
139ALTER SEQUENCE victories_id_seq OWNED BY victories.id;
140
141ALTER TABLE ONLY dc ALTER COLUMN hero_id SET DEFAULT nextval('dc_hero_id_seq'::regclass);
142ALTER TABLE ONLY heroes ALTER COLUMN hero_id SET DEFAULT nextval('heroes_hero_id_seq'::regclass);
143ALTER TABLE ONLY marvel ALTER COLUMN hero_id SET DEFAULT nextval('marvel_hero_id_seq'::regclass);
144ALTER TABLE ONLY people ALTER COLUMN person_id SET DEFAULT nextval('people_person_id_seq'::regclass);
145ALTER TABLE ONLY victories ALTER COLUMN id SET DEFAULT nextval('victories_id_seq'::regclass);
146
147-- Data for Name: dc; Type: TABLE DATA; Schema: public; Owner: profh
148--
149
150COPY dc (hero_id, name, power, active) FROM stdin;
1511 Batman None - just totally awesome t
1522 Superman Flies; great strength; xray vision t
1533 Green Lantern Power ring creates solid constructs based on will; flies t
1544 Hawkeye None, but exceptional archer; keen eyesight t
1555 Wonder Woman Enhanced strength; various weapons t
1566 Angel Teleportation; mind control t
1577 Aquaman Breathes underwater; communicates with marine life t
158\.
159
160SELECT pg_catalog.setval('dc_hero_id_seq', 7, true);
161
162-- Data for Name: heroes; Type: TABLE DATA; Schema: public; Owner: profh
163--
164
165COPY heroes (hero_id, name, power, active, age) FROM stdin;
1662 Superman flys; great strength; xray vision t \N
1673 Green Lantern Power ring creates solid constructs based on will t \N
1684 Wolverine Healing factor; adamantium skelton; retractable claws t \N
1697 Wonder Woman Enhanced strength; various weapons t \N
1708 Storm Control of weather; flys t \N
1719 Shadowcat Can phase between solid objects t \N
17210 Angel Has wings; flys t \N
17311 Archangel Has wings; flys; shoots projectiles from wings t \N
17412 Colossus Superhuman strength; body can turn into solid metal t \N
17513 Aquaman Breathes underwater; communicates with marine life t \N
17614 The Tickerina nigh-invulnerable t 48
1776 Nightcrawler Teleportation; superhuman agility t 37
1785 Spiderman Spider senses; web-slinging t 23
1791 Batman None - just totally awesome t 52
180\.
181
182SELECT pg_catalog.setval('heroes_hero_id_seq', 14, true);
183
184-- Data for Name: identities; Type: TABLE DATA; Schema: public; Owner: profh
185--
186
187COPY identities (hero_id, person_id) FROM stdin;
1882 1
1893 2
1903 3
1913 4
1921 6
1934 7
1946 8
19511 15
1968 10
1979 13
19810 15
1995 11
20014 9
201\.
202
203-- Data for Name: marvel; Type: TABLE DATA; Schema: public; Owner: profh
204--
205
206COPY marvel (hero_id, name, power, active) FROM stdin;
2071 Spiderman Spider senses; web-slinging t
2082 Wolverine Healing factor; adamantium skelton; retractable claws t
2093 Nightcrawler Teleportation; superhuman agility t
2104 Storm Control of weather; flies t
2115 Shadowcat Can phase through solid objects t
2126 Angel Has wings; flies t
2137 Archangel Has wings; flies; shoots projectiles from wings t
2148 Colossus Superhuman strength; body can turn into solid metal t
2159 Hawkeye None, but exceptional archer; keen eyesight t
216\.
217
218SELECT pg_catalog.setval('marvel_hero_id_seq', 10, true);
219
220-- Data for Name: people; Type: TABLE DATA; Schema: public; Owner: profh
221--
222
223COPY people (person_id, first_name, last_name, height, weight, is_male, active, email) FROM stdin;
2243 Guy Gardner 72 194 t t \N
2254 Kyle Rayner 73 209 t t \N
2267 Logan \N 68 195 t t \N
2278 Kurt Wagner 68 165 t t \N
22814 Elizabeth Braddock 68 165 f t \N
2299 Larry Heimann 76 230 t t profh@cmu.edu
2306 Bruce Wayne 75 230 t t bruce@wayne.net
23111 Peter Parker 70 180 t t ppaker@gmail.com
2321 Clark Kent 76 225 t t clarkk@yahoo.com
23315 Warren Worthington 72 190 t t flyboy@gmail.com
23412 Anna Marie \N 67 160 f t rogue99@gmail.com
2352 Hal Jordan 71 189 t t glearth@yahoo.com
23610 Ororo Munroe 71 180 f t stormy@gmail.com
23713 Kitty Pryde 66 155 f t kpryde@yahoo.com
2385 Dick Greyson 69 168 t t dgreyson@wayne.net
239\.
240
241SELECT pg_catalog.setval('people_person_id_seq', 15, true);
242
243-- Data for Name: victories; Type: TABLE DATA; Schema: public; Owner: profh
244--
245
246COPY victories (id, hero_id, major, minor, for_month) FROM stdin;
2471 1 1 23 2012-01-01
2482 1 2 16 2012-02-01
2493 1 1 35 2012-03-01
2504 1 0 17 2012-04-01
2515 1 1 24 2012-05-01
2526 1 0 12 2012-06-01
2537 1 3 42 2012-07-01
2548 1 1 19 2012-08-01
2559 2 0 2 2012-01-01
25610 2 1 1 2012-02-01
25712 2 0 0 2012-04-01
25813 2 1 3 2012-05-01
25914 2 0 0 2012-06-01
26015 2 0 0 2012-07-01
26116 2 1 4 2012-08-01
26211 2 0 3 2012-03-01
26317 5 1 12 2012-01-01
26419 5 0 29 2012-03-01
26520 5 2 8 2012-04-01
26621 5 1 17 2012-05-01
26722 5 0 26 2012-06-01
26823 5 1 20 2012-07-01
26924 5 1 16 2012-08-01
27018 5 1 18 2012-02-01
271\.
272
273SELECT pg_catalog.setval('victories_id_seq', 28, true);
274
275ALTER TABLE ONLY dc
276 ADD CONSTRAINT dc_pkey PRIMARY KEY (hero_id);
277
278ALTER TABLE ONLY heroes
279 ADD CONSTRAINT heroes_pkey PRIMARY KEY (hero_id);
280
281ALTER TABLE ONLY identities
282 ADD CONSTRAINT identities_pkey PRIMARY KEY (hero_id, person_id);
283
284ALTER TABLE ONLY marvel
285 ADD CONSTRAINT marvel_pkey PRIMARY KEY (hero_id);
286
287ALTER TABLE ONLY people
288 ADD CONSTRAINT people_pkey PRIMARY KEY (person_id);
289
290ALTER TABLE ONLY victories
291 ADD CONSTRAINT victories_pkey PRIMARY KEY (id);
292
293ALTER TABLE ONLY victories
294 ADD CONSTRAINT hero_fk FOREIGN KEY (hero_id) REFERENCES heroes(hero_id);
295
296REVOKE ALL ON SCHEMA public FROM PUBLIC;
297REVOKE ALL ON SCHEMA public FROM profh;
298GRANT ALL ON SCHEMA public TO profh;
299GRANT ALL ON SCHEMA public TO PUBLIC;
300
301-- PostgreSQL database dump complete