--
--

-- Started on 2014-11-21 11:20:58 GMT


--
-- TOC entry 173 (class 3079 OID 11645)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- TOC entry 1930 (class 0 OID 0)
-- Dependencies: 173
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';





--
-- TOC entry 166 (class 1259 OID 50402)
-- Dependencies: 6
-- Name: addresses; Type: TABLE; Schema: public; Owner: ords; Tablespace: 
--

CREATE TABLE addresses (
    id integer NOT NULL,
    street_address text,
    district text,
    start_date integer,
    end_date integer,
    club_id integer
);


ALTER TABLE public.addresses OWNER TO ords;

--
-- TOC entry 172 (class 1259 OID 50430)
-- Dependencies: 166 6
-- Name: addresses_id_seq; Type: SEQUENCE; Schema: public; Owner: ords
--

CREATE SEQUENCE addresses_id_seq
    START WITH 21
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.addresses_id_seq OWNER TO ords;

--
-- TOC entry 1931 (class 0 OID 0)
-- Dependencies: 172
-- Name: addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ords
--

ALTER SEQUENCE addresses_id_seq OWNED BY addresses.id;


--
-- TOC entry 161 (class 1259 OID 50342)
-- Dependencies: 6
-- Name: certainty; Type: TABLE; Schema: public; Owner: ords; Tablespace: 
--

CREATE TABLE certainty (
    id integer NOT NULL,
    certainty_status text,
    certainty_status_num integer
);


ALTER TABLE public.certainty OWNER TO ords;

--
-- TOC entry 167 (class 1259 OID 50415)
-- Dependencies: 161 6
-- Name: certainty_id_seq; Type: SEQUENCE; Schema: public; Owner: ords
--

CREATE SEQUENCE certainty_id_seq
    START WITH 5
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.certainty_id_seq OWNER TO ords;

--
-- TOC entry 1932 (class 0 OID 0)
-- Dependencies: 167
-- Name: certainty_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ords
--

ALTER SEQUENCE certainty_id_seq OWNED BY certainty.id;


--
-- TOC entry 165 (class 1259 OID 50374)
-- Dependencies: 6
-- Name: club_memberships; Type: TABLE; Schema: public; Owner: ords; Tablespace: 
--

CREATE TABLE club_memberships (
    id integer NOT NULL,
    club_id integer,
    people_id integer,
    verbatim_name text,
    certainty_of_identity integer,
    evidence_id integer,
    evidence_page_ref text,
    joining_date integer,
    leaving_date integer
);


ALTER TABLE public.club_memberships OWNER TO ords;

--
-- TOC entry 168 (class 1259 OID 50418)
-- Dependencies: 165 6
-- Name: club_memberships_id_seq; Type: SEQUENCE; Schema: public; Owner: ords
--

CREATE SEQUENCE club_memberships_id_seq
    START WITH 6
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.club_memberships_id_seq OWNER TO ords;

--
-- TOC entry 1933 (class 0 OID 0)
-- Dependencies: 168
-- Name: club_memberships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ords
--

ALTER SEQUENCE club_memberships_id_seq OWNED BY club_memberships.id;


--
-- TOC entry 162 (class 1259 OID 50350)
-- Dependencies: 6
-- Name: clubs; Type: TABLE; Schema: public; Owner: ords; Tablespace: 
--

CREATE TABLE clubs (
    club_name text,
    date_founded integer,
    id integer NOT NULL,
    notes text
);


ALTER TABLE public.clubs OWNER TO ords;

--
-- TOC entry 169 (class 1259 OID 50421)
-- Dependencies: 162 6
-- Name: clubs_id_seq; Type: SEQUENCE; Schema: public; Owner: ords
--

CREATE SEQUENCE clubs_id_seq
    START WITH 16
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clubs_id_seq OWNER TO ords;

--
-- TOC entry 1934 (class 0 OID 0)
-- Dependencies: 169
-- Name: clubs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ords
--

ALTER SEQUENCE clubs_id_seq OWNED BY clubs.id;


--
-- TOC entry 163 (class 1259 OID 50358)
-- Dependencies: 6
-- Name: evidence; Type: TABLE; Schema: public; Owner: ords; Tablespace: 
--

CREATE TABLE evidence (
    id integer NOT NULL,
    author text,
    title text,
    date text,
    type text,
    notes text
);


ALTER TABLE public.evidence OWNER TO ords;

--
-- TOC entry 170 (class 1259 OID 50424)
-- Dependencies: 163 6
-- Name: evidence_id_seq; Type: SEQUENCE; Schema: public; Owner: ords
--

CREATE SEQUENCE evidence_id_seq
    START WITH 6
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.evidence_id_seq OWNER TO ords;

--
-- TOC entry 1935 (class 0 OID 0)
-- Dependencies: 170
-- Name: evidence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ords
--

ALTER SEQUENCE evidence_id_seq OWNED BY evidence.id;


--
-- TOC entry 164 (class 1259 OID 50366)
-- Dependencies: 6
-- Name: people; Type: TABLE; Schema: public; Owner: ords; Tablespace: 
--

CREATE TABLE people (
    id integer NOT NULL,
    title text,
    first_name text,
    surname text,
    occupation text,
    birth_year integer,
    death_year integer,
    notes text
);


ALTER TABLE public.people OWNER TO ords;

--
-- TOC entry 171 (class 1259 OID 50427)
-- Dependencies: 6 164
-- Name: people_id_seq; Type: SEQUENCE; Schema: public; Owner: ords
--

CREATE SEQUENCE people_id_seq
    START WITH 9
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.people_id_seq OWNER TO ords;

--
-- TOC entry 1936 (class 0 OID 0)
-- Dependencies: 171
-- Name: people_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ords
--

ALTER SEQUENCE people_id_seq OWNED BY people.id;


--
-- TOC entry 1792 (class 2604 OID 50432)
-- Dependencies: 172 166
-- Name: id; Type: DEFAULT; Schema: public; Owner: ords
--

ALTER TABLE ONLY addresses ALTER COLUMN id SET DEFAULT nextval('addresses_id_seq'::regclass);


--
-- TOC entry 1787 (class 2604 OID 50417)
-- Dependencies: 167 161
-- Name: id; Type: DEFAULT; Schema: public; Owner: ords
--

ALTER TABLE ONLY certainty ALTER COLUMN id SET DEFAULT nextval('certainty_id_seq'::regclass);


--
-- TOC entry 1791 (class 2604 OID 50420)
-- Dependencies: 168 165
-- Name: id; Type: DEFAULT; Schema: public; Owner: ords
--

ALTER TABLE ONLY club_memberships ALTER COLUMN id SET DEFAULT nextval('club_memberships_id_seq'::regclass);


--
-- TOC entry 1788 (class 2604 OID 50423)
-- Dependencies: 169 162
-- Name: id; Type: DEFAULT; Schema: public; Owner: ords
--

ALTER TABLE ONLY clubs ALTER COLUMN id SET DEFAULT nextval('clubs_id_seq'::regclass);


--
-- TOC entry 1789 (class 2604 OID 50426)
-- Dependencies: 170 163
-- Name: id; Type: DEFAULT; Schema: public; Owner: ords
--

ALTER TABLE ONLY evidence ALTER COLUMN id SET DEFAULT nextval('evidence_id_seq'::regclass);


--
-- TOC entry 1790 (class 2604 OID 50429)
-- Dependencies: 171 164
-- Name: id; Type: DEFAULT; Schema: public; Owner: ords
--

ALTER TABLE ONLY people ALTER COLUMN id SET DEFAULT nextval('people_id_seq'::regclass);


--
-- TOC entry 1916 (class 0 OID 50402)
-- Dependencies: 166 1923
-- Data for Name: addresses; Type: TABLE DATA; Schema: public; Owner: ords
--

COPY addresses (id, street_address, district, start_date, end_date, club_id) FROM stdin;
14	9 Spring Gardens	City of Westminster	1868	1871	13
8	9–11 Ryder Street	St James&apos;s	1914	1986	9
15	12 Savile Row	Mayfair	1871	1882	13
7	21 Shaftesbury Avenue	Soho	1893	1914	9
20	4 Chesterfield Street	Mayfair	1693	1778	15
1	60 St James&apos;s Street	St James&apos;s	1778	2014	1
9	King Street	Covent Garden	1832	1864	10
10	15 Garrick Street	Covent Garden	1864	2014	10
19	37 St James&apos;s Street	St James&apos;s	1778	2014	15
3	9 Irving Street	City of Westminster	1876	2014	6
11	71-77 Pall Mall	City of Westminster	1838	2014	11
12	18 St James&apos;s Square	St James&apos;s	1831	1838	11
18	The Strand	City of Westminster	1881	1911	14
17	69 Brook Street	Mayfair	1927	2014	13
2	50 Pall Mall	City of Westminster	1762	1778	1
16	107 Piccadilly	City of Westminster	1882	1927	13
4	28 St James&apos;s Street	St James&apos;s	1782	2014	7
13	Pall Mall	City of Westminster	1837	2014	12
6	Denman Street	Soho	1890	1893	9
\.


--
-- TOC entry 1937 (class 0 OID 0)
-- Dependencies: 172
-- Name: addresses_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ords
--

SELECT pg_catalog.setval('addresses_id_seq', 21, false);


--
-- TOC entry 1911 (class 0 OID 50342)
-- Dependencies: 161 1923
-- Data for Name: certainty; Type: TABLE DATA; Schema: public; Owner: ords
--

COPY certainty (id, certainty_status, certainty_status_num) FROM stdin;
1	Definite	4
3	Possible	2
2	Probable	3
4	Doubtful	1
\.


--
-- TOC entry 1938 (class 0 OID 0)
-- Dependencies: 167
-- Name: certainty_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ords
--

SELECT pg_catalog.setval('certainty_id_seq', 5, false);


--
-- TOC entry 1915 (class 0 OID 50374)
-- Dependencies: 165 1923
-- Data for Name: club_memberships; Type: TABLE DATA; Schema: public; Owner: ords
--

COPY club_memberships (id, club_id, people_id, verbatim_name, certainty_of_identity, evidence_id, evidence_page_ref, joining_date, leaving_date) FROM stdin;
1	1	1	J. Albury Esq.	2	1	56	1822	1889
3	8	2	Stephen	2	3	46	1833	\N
2	6	4	The Hon. Julian Carstairs	1	4	34	1876	1887
4	5	3	Michael Swarney	1	2	102, 105, 110	1890	\N
5	8	3	M. Swarn??	3	5	354, 375, 393	1894	1926
6	9	3	M. Swarny	2	7	54	1890	1893
7	10	10	Julian Ponsonby	1	7	78	1845	1872
8	11	13	Ld Geo F.	3	3	46	1832	\N
9	12	22	Hilary Carmichael	1	7	142	1836	1865
10	13	5	Richard Gregson	1	7	88	1894	\N
11	12	11	Alistair Dunmore	1	7	52	1860	1865
12	11	12	Theo Baskin	2	3	76	1840	\N
13	7	13	Lord George Featherstonehaugh	1	7	4	1835	1842
14	14	14	Captain Corcoran	2	6	2	1881	1911
15	14	15	Sir Joseph Porter, K.C.B.	1	6	2	1881	1911
16	3	15	Sir J. Porter	3	7	47	1878	\N
\.


--
-- TOC entry 1939 (class 0 OID 0)
-- Dependencies: 168
-- Name: club_memberships_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ords
--

SELECT pg_catalog.setval('club_memberships_id_seq', 16, true);


--
-- TOC entry 1912 (class 0 OID 50350)
-- Dependencies: 162 1923
-- Data for Name: clubs; Type: TABLE DATA; Schema: public; Owner: ords
--

COPY clubs (club_name, date_founded, id, notes) FROM stdin;
Savile Club	1868	13	\N
Boodle&apos;s Club	1762	7	
Savoy Club	1881	14	Fictional, as are all its members
Beefsteak Club	1876	6	\N
Brooks&apos;s	1764	1	\N
Carlton Club	1832	8	
Eccentric Club	1890	9	Other clubs with same name founded in 1781, 1858, and 2008
Army & Navy Club	1837	3	Also known as &apos;The Rag&apos;
Garrick Club	1831	10	\N
Oxford and Cambridge Club	1830	11	Merged in 1971 with the United University Club
Alpine Club	1857	2	\N
White&apos;s Club	1693	15	Oldest gentlemen&apos;s club in London
Arts Club	1863	4	\N
Reform Club	1836	12	\N
The Athenaeum	1824	5	\N
\.


--
-- TOC entry 1940 (class 0 OID 0)
-- Dependencies: 169
-- Name: clubs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ords
--

SELECT pg_catalog.setval('clubs_id_seq', 16, false);


--
-- TOC entry 1913 (class 0 OID 50358)
-- Dependencies: 163 1923
-- Data for Name: evidence; Type: TABLE DATA; Schema: public; Owner: ords
--

COPY evidence (id, author, title, date, type, notes) FROM stdin;
1	N/A	Brooks&apos;s Membership Register	1850-1900	Club record	\N
3	Arthur Phillips	London Diaries	1830-1842	Diary	\N
2	Michael Swarney	Collected Letters	1890-1914	Letters	\N
4	N/A	Beefsteak Club Members Book	1876-1900	Club record	\N
5	N/A	Carlton Club Membership Records	1832-1950	Club record	\N
6	N/A	Savoy Club Membership Records	1881-1911	Club record	See also The Savoy Operas, by W. S. Gilbert
7	Anthony Fallon	Clubland: an Incomplete and Biased History	1962	Book	\N
\.


--
-- TOC entry 1941 (class 0 OID 0)
-- Dependencies: 170
-- Name: evidence_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ords
--

SELECT pg_catalog.setval('evidence_id_seq', 7, true);


--
-- TOC entry 1914 (class 0 OID 50366)
-- Dependencies: 164 1923
-- Data for Name: people; Type: TABLE DATA; Schema: public; Owner: ords
--

COPY people (id, title, first_name, surname, occupation, birth_year, death_year, notes) FROM stdin;
1	Sir	John	Albury	Gentleman	1801	1889	\N
2	Dr	Stephen	Phillips	Doctor	1785	1854	Son of Arthur Phillips
3	Mr	Michael	Swarney	Lawyer	1860	1926	\N
4	The Hon.	Julian	Carstairs	Gentleman	1832	1893	Younger son of Lord Teasdale
5	Mt	Richrad	Gregson	Newspaper proprietor	1854	\N	\N
6	Mr	Barnabas	Stevens	Financier	1846	1913	\N
7	Mr	Barnabas	Stevens	Financier	1846	1913	\N
9	Sir	Arthur	Colcannon	Gentleman	1800	1874	\N
10	Mr	Julian	Ponsonby	Gentleman	1818	1872	Keen amateur painter
11	The Hon.	Alistair	Dunmore	Chemist	1813	1865	\N
12	Mr	Theodore	Baskin	Gentleman	1782	1863	\N
13	Lord	George	Featherstonehaugh	Gentleman	1799	1843	Second son of the Duke of Alcott
14	Sir	Edward	Corcoran	Naval Officer	1848	1920	\N
15	Sir	Joseph	Porter	First Lord of the Admiralty	1845	1919	Knight Commander of the Order of the Bath
16	Mr	Robin	Oakapple	Farmer	1853	1930	Possibly a pseudonym
17	Mr	John	Goldbury	Company promoter	1854	1905	\N
18	Captain	Arthur	Fitzbattleaxe	Soldier	1868	1936	Of the First Life Guards
19	Sir	Bailey	Barre	Lawyer	1850	1918	Q. C.
20	Mr	Benjamin	Blushington	County Councillor	1856	1920	\N
21	Sir	Marmaduke	Pointdextre	Gentleman	1807	1890	Baronet
22	Mr	Hilary	Carmichael	Politician	1795	1865	\N
\.


--
-- TOC entry 1942 (class 0 OID 0)
-- Dependencies: 171
-- Name: people_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ords
--

SELECT pg_catalog.setval('people_id_seq', 22, true);


--
-- TOC entry 1804 (class 2606 OID 50409)
-- Dependencies: 166 166 1924
-- Name: addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: ords; Tablespace: 
--

ALTER TABLE ONLY addresses
    ADD CONSTRAINT addresses_pkey PRIMARY KEY (id);


--
-- TOC entry 1794 (class 2606 OID 50349)
-- Dependencies: 161 161 1924
-- Name: certainty_pkey; Type: CONSTRAINT; Schema: public; Owner: ords; Tablespace: 
--

ALTER TABLE ONLY certainty
    ADD CONSTRAINT certainty_pkey PRIMARY KEY (id);


--
-- TOC entry 1802 (class 2606 OID 50381)
-- Dependencies: 165 165 1924
-- Name: club_memberships_pkey; Type: CONSTRAINT; Schema: public; Owner: ords; Tablespace: 
--

ALTER TABLE ONLY club_memberships
    ADD CONSTRAINT club_memberships_pkey PRIMARY KEY (id);


--
-- TOC entry 1796 (class 2606 OID 50357)
-- Dependencies: 162 162 1924
-- Name: clubs_pkey; Type: CONSTRAINT; Schema: public; Owner: ords; Tablespace: 
--

ALTER TABLE ONLY clubs
    ADD CONSTRAINT clubs_pkey PRIMARY KEY (id);


--
-- TOC entry 1798 (class 2606 OID 50365)
-- Dependencies: 163 163 1924
-- Name: evidence_pkey; Type: CONSTRAINT; Schema: public; Owner: ords; Tablespace: 
--

ALTER TABLE ONLY evidence
    ADD CONSTRAINT evidence_pkey PRIMARY KEY (id);


--
-- TOC entry 1800 (class 2606 OID 50373)
-- Dependencies: 164 164 1924
-- Name: people_pkey; Type: CONSTRAINT; Schema: public; Owner: ords; Tablespace: 
--

ALTER TABLE ONLY people
    ADD CONSTRAINT people_pkey PRIMARY KEY (id);


--
-- TOC entry 1809 (class 2606 OID 50410)
-- Dependencies: 166 162 1795 1924
-- Name: addresses_club_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: ords
--

ALTER TABLE ONLY addresses
    ADD CONSTRAINT addresses_club_id_fkey FOREIGN KEY (club_id) REFERENCES clubs(id);


--
-- TOC entry 1807 (class 2606 OID 50392)
-- Dependencies: 1793 161 165 1924
-- Name: club_memberships_certainty_of_identity_fkey; Type: FK CONSTRAINT; Schema: public; Owner: ords
--

ALTER TABLE ONLY club_memberships
    ADD CONSTRAINT club_memberships_certainty_of_identity_fkey FOREIGN KEY (certainty_of_identity) REFERENCES certainty(id);


--
-- TOC entry 1805 (class 2606 OID 50382)
-- Dependencies: 165 1795 162 1924
-- Name: club_memberships_club_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: ords
--

ALTER TABLE ONLY club_memberships
    ADD CONSTRAINT club_memberships_club_id_fkey FOREIGN KEY (club_id) REFERENCES clubs(id);


--
-- TOC entry 1808 (class 2606 OID 50397)
-- Dependencies: 165 163 1797 1924
-- Name: club_memberships_evidence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: ords
--

ALTER TABLE ONLY club_memberships
    ADD CONSTRAINT club_memberships_evidence_id_fkey FOREIGN KEY (evidence_id) REFERENCES evidence(id);


--
-- TOC entry 1806 (class 2606 OID 50387)
-- Dependencies: 1799 165 164 1924
-- Name: club_memberships_people_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: ords
--

ALTER TABLE ONLY club_memberships
    ADD CONSTRAINT club_memberships_people_id_fkey FOREIGN KEY (people_id) REFERENCES people(id);


--
-- TOC entry 1929 (class 0 OID 0)
-- Dependencies: 6
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;


-- Completed on 2014-11-21 11:20:58 GMT

--
--

