--
-- PostgreSQL database dump
--
-- Dumped from database version 9.2.1
-- Dumped by pg_dump version 9.2.1
-- Started on 2013-08-08 20:21:48
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- TOC entry 174 (class 3079 OID 11727)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 1955 (class 0 OID 0)
-- Dependencies: 174
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
--
-- TOC entry 168 (class 1259 OID 24577)
-- Name: cod_grupo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE cod_grupo_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.cod_grupo_seq OWNER TO postgres;
--
-- TOC entry 1956 (class 0 OID 0)
-- Dependencies: 168
-- Name: cod_grupo_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('cod_grupo_seq', 17, true);
--
-- TOC entry 171 (class 1259 OID 24590)
-- Name: cod_jogador_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE cod_jogador_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.cod_jogador_seq OWNER TO postgres;
--
-- TOC entry 1957 (class 0 OID 0)
-- Dependencies: 171
-- Name: cod_jogador_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('cod_jogador_seq', 20, true);
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 170 (class 1259 OID 24585)
-- Name: domino; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE domino (
cod_peca integer NOT NULL,
face_direita integer NOT NULL,
face_esquerda integer NOT NULL
);
ALTER TABLE public.domino OWNER TO postgres;
--
-- TOC entry 169 (class 1259 OID 24579)
-- Name: grupo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE grupo (
cod_grupo integer DEFAULT nextval('cod_grupo_seq'::regclass) NOT NULL,
nome_grupo character varying(50) NOT NULL
);
ALTER TABLE public.grupo OWNER TO postgres;
--
-- TOC entry 172 (class 1259 OID 24592)
-- Name: jogador; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE jogador (
cod_jogador integer DEFAULT nextval('cod_jogador_seq'::regclass) NOT NULL,
nome_jogador character varying(50) NOT NULL,
cod_grupo integer
);
ALTER TABLE public.jogador OWNER TO postgres;
--
-- TOC entry 173 (class 1259 OID 24603)
-- Name: jogo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE jogo (
cod_grupo integer NOT NULL,
num_rodada integer NOT NULL,
ordem integer NOT NULL,
peca_esquerda integer NOT NULL,
peca_direita integer
);
ALTER TABLE public.jogo OWNER TO postgres;
--
-- TOC entry 1945 (class 0 OID 24585)
-- Dependencies: 170
-- Data for Name: domino; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY domino (cod_peca, face_direita, face_esquerda) FROM stdin;
15 3 2
5 1 3
12 2 0
4 0 5
24 4 4
18 4 0
26 3 6
11 1 6
9 1 1
3 1 5
8 0 0
2 2 2
14 3 4
16 5 4
21 6 2
17 2 4
10 3 5
19 5 5
27 6 0
23 1 4
28 1 2
20 2 5
1 3 3
25 6 6
22 5 6
6 0 1
13 6 4
7 3 0
\.
--
-- TOC entry 1944 (class 0 OID 24579)
-- Dependencies: 169
-- Data for Name: grupo; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY grupo (cod_grupo, nome_grupo) FROM stdin;
10 TheRevolts
11 Rodrigo&icaro
12 IFBAiano
13 Barrildobrado
14 Grinaldinho
15 Smoke
16 Mauricio/Gustavo
17 cssa
\.
--
-- TOC entry 1946 (class 0 OID 24592)
-- Dependencies: 172
-- Data for Name: jogador; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY jogador (cod_jogador, nome_jogador, cod_grupo) FROM stdin;
19 Fred 15
2 Gasakon 15
15 Brito 11
3 Icaro 10
4 Bruno 10
13 ícaro 11
17 Gustavo 16
20 Mauricio 16
18 Antonio 12
1 Grinaldo 14
5 Andre 12
6 Michel 13
7 Luis 13
12 cssa2 17
\.
--
-- TOC entry 1947 (class 0 OID 24603)
-- Dependencies: 173
-- Data for Name: jogo; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY jogo (cod_grupo, num_rodada, ordem, peca_esquerda, peca_direita) FROM stdin;
14 1 1 1 \N
14 1 2 4 \N
10 1 1 14 \N
10 1 2 28 \N
11 1 1 16 20
15 1 2 3 \N
15 1 1 12 \N
13 1 1 26 \N
13 1 2 2 \N
16 1 1 15 \N
16 1 2 23 \N
17 1 1 10 \N
17 1 2 8 \N
12 1 1 7 \N
12 1 2 11 \N
\.
--
-- TOC entry 1935 (class 2606 OID 24589)
-- Name: domino_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY domino
ADD CONSTRAINT domino_pkey PRIMARY KEY (cod_peca);
--
-- TOC entry 1933 (class 2606 OID 24584)
-- Name: grupo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY grupo
ADD CONSTRAINT grupo_pkey PRIMARY KEY (cod_grupo);
--
-- TOC entry 1937 (class 2606 OID 24597)
-- Name: jogador_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY jogador
ADD CONSTRAINT jogador_pkey PRIMARY KEY (cod_jogador);
--
-- TOC entry 1939 (class 2606 OID 24607)
-- Name: jogo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY jogo
ADD CONSTRAINT jogo_pkey PRIMARY KEY (cod_grupo, num_rodada, ordem);
--
-- TOC entry 1940 (class 2606 OID 24598)
-- Name: jogador_cod_grupo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY jogador
ADD CONSTRAINT jogador_cod_grupo_fkey FOREIGN KEY (cod_grupo) REFERENCES grupo(cod_grupo);
--
-- TOC entry 1941 (class 2606 OID 24608)
-- Name: jogo_cod_grupo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY jogo
ADD CONSTRAINT jogo_cod_grupo_fkey FOREIGN KEY (cod_grupo) REFERENCES grupo(cod_grupo);
--
-- TOC entry 1943 (class 2606 OID 24618)
-- Name: jogo_peca_direita_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY jogo
ADD CONSTRAINT jogo_peca_direita_fkey FOREIGN KEY (peca_direita) REFERENCES domino(cod_peca);
--
-- TOC entry 1942 (class 2606 OID 24613)
-- Name: jogo_peca_esquerda_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY jogo
ADD CONSTRAINT jogo_peca_esquerda_fkey FOREIGN KEY (peca_esquerda) REFERENCES domino(cod_peca);
--
-- TOC entry 1954 (class 0 OID 0)
-- Dependencies: 5
-- 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;
GRANT ALL ON SCHEMA public TO PUBLIC;
-- Completed on 2013-08-08 20:21:49
--
-- PostgreSQL database dump complete
--