· 6 years ago · May 06, 2019, 02:46 PM
1--
2-- PostgreSQL database dump
3--
4
5-- Dumped from database version 9.6.6
6-- Dumped by pg_dump version 9.6.6
7
8SET statement_timeout = 0;
9SET lock_timeout = 0;
10SET idle_in_transaction_session_timeout = 0;
11SET client_encoding = 'UTF8';
12SET standard_conforming_strings = on;
13SET check_function_bodies = false;
14SET client_min_messages = warning;
15SET row_security = off;
16
17--
18-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
19--
20
21CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
22
23
24--
25-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
26--
27
28COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
29
30
31SET search_path = public, pg_catalog;
32
33SET default_tablespace = '';
34
35SET default_with_oids = false;
36
37--
38-- Name: perguntas; Type: TABLE; Schema: public; Owner: postgres
39--
40
41CREATE TABLE perguntas (
42 idperg integer NOT NULL,
43 idquest integer,
44 pergunta character varying(300)
45);
46
47
48ALTER TABLE perguntas OWNER TO postgres;
49
50--
51-- Name: perguntas_idperg_seq; Type: SEQUENCE; Schema: public; Owner: postgres
52--
53
54CREATE SEQUENCE perguntas_idperg_seq
55 START WITH 1
56 INCREMENT BY 1
57 NO MINVALUE
58 NO MAXVALUE
59 CACHE 1;
60
61
62ALTER TABLE perguntas_idperg_seq OWNER TO postgres;
63
64--
65-- Name: perguntas_idperg_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
66--
67
68ALTER SEQUENCE perguntas_idperg_seq OWNED BY perguntas.idperg;
69
70
71--
72-- Name: questionarios; Type: TABLE; Schema: public; Owner: postgres
73--
74
75CREATE TABLE questionarios (
76 idquest integer NOT NULL,
77 titulo character varying(100)
78);
79
80
81ALTER TABLE questionarios OWNER TO postgres;
82
83--
84-- Name: questionarios_idquest_seq; Type: SEQUENCE; Schema: public; Owner: postgres
85--
86
87CREATE SEQUENCE questionarios_idquest_seq
88 START WITH 1
89 INCREMENT BY 1
90 NO MINVALUE
91 NO MAXVALUE
92 CACHE 1;
93
94
95ALTER TABLE questionarios_idquest_seq OWNER TO postgres;
96
97--
98-- Name: questionarios_idquest_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
99--
100
101ALTER SEQUENCE questionarios_idquest_seq OWNED BY questionarios.idquest;
102
103
104--
105-- Name: ratings; Type: TABLE; Schema: public; Owner: postgres
106--
107
108CREATE TABLE ratings (
109 idrat integer NOT NULL,
110 idperg integer,
111 idquest integer,
112 rating integer
113);
114
115
116ALTER TABLE ratings OWNER TO postgres;
117
118--
119-- Name: ratings_idrat_seq; Type: SEQUENCE; Schema: public; Owner: postgres
120--
121
122CREATE SEQUENCE ratings_idrat_seq
123 START WITH 1
124 INCREMENT BY 1
125 NO MINVALUE
126 NO MAXVALUE
127 CACHE 1;
128
129
130ALTER TABLE ratings_idrat_seq OWNER TO postgres;
131
132--
133-- Name: ratings_idrat_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
134--
135
136ALTER SEQUENCE ratings_idrat_seq OWNED BY ratings.idrat;
137
138
139--
140-- Name: perguntas idperg; Type: DEFAULT; Schema: public; Owner: postgres
141--
142
143ALTER TABLE ONLY perguntas ALTER COLUMN idperg SET DEFAULT nextval('perguntas_idperg_seq'::regclass);
144
145
146--
147-- Name: questionarios idquest; Type: DEFAULT; Schema: public; Owner: postgres
148--
149
150ALTER TABLE ONLY questionarios ALTER COLUMN idquest SET DEFAULT nextval('questionarios_idquest_seq'::regclass);
151
152
153--
154-- Name: ratings idrat; Type: DEFAULT; Schema: public; Owner: postgres
155--
156
157ALTER TABLE ONLY ratings ALTER COLUMN idrat SET DEFAULT nextval('ratings_idrat_seq'::regclass);
158
159
160--
161-- Data for Name: perguntas; Type: TABLE DATA; Schema: public; Owner: postgres
162--
163
164
165--
166-- Name: perguntas_idperg_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
167--
168
169SELECT pg_catalog.setval('perguntas_idperg_seq', 7, true);
170
171
172--
173-- Data for Name: questionarios; Type: TABLE DATA; Schema: public; Owner: postgres
174--
175
176
177
178--
179-- Name: questionarios_idquest_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
180--
181
182SELECT pg_catalog.setval('questionarios_idquest_seq', 2, true);
183
184
185--
186-- Data for Name: ratings; Type: TABLE DATA; Schema: public; Owner: postgres
187--
188
189
190
191
192--
193-- Name: ratings_idrat_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
194--
195
196SELECT pg_catalog.setval('ratings_idrat_seq', 7, true);
197
198
199--
200-- Name: perguntas perguntas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
201--
202
203ALTER TABLE ONLY perguntas
204 ADD CONSTRAINT perguntas_pkey PRIMARY KEY (idperg);
205
206
207--
208-- Name: questionarios questionarios_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
209--
210
211ALTER TABLE ONLY questionarios
212 ADD CONSTRAINT questionarios_pkey PRIMARY KEY (idquest);
213
214
215--
216-- Name: ratings ratings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
217--
218
219ALTER TABLE ONLY ratings
220 ADD CONSTRAINT ratings_pkey PRIMARY KEY (idrat);
221
222
223--
224-- Name: perguntas perguntas_idquest_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
225--
226
227ALTER TABLE ONLY perguntas
228 ADD CONSTRAINT perguntas_idquest_fkey FOREIGN KEY (idquest) REFERENCES questionarios(idquest) ON DELETE CASCADE;
229
230
231--
232-- Name: ratings ratings_idperg_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
233--
234
235ALTER TABLE ONLY ratings
236 ADD CONSTRAINT ratings_idperg_fkey FOREIGN KEY (idperg) REFERENCES perguntas(idperg) ON DELETE CASCADE;
237
238
239--
240-- Name: ratings ratings_idquest_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
241--
242
243ALTER TABLE ONLY ratings
244 ADD CONSTRAINT ratings_idquest_fkey FOREIGN KEY (idquest) REFERENCES questionarios(idquest) ON DELETE CASCADE;
245
246
247--
248-- PostgreSQL database dump complete
249--