· 6 years ago · Aug 22, 2019, 12:56 PM
1--
2-- PostgreSQL database dump
3--
4
5-- Dumped from database version 9.6.15
6-- Dumped by pg_dump version 9.6.15
7
8-- Started on 2019-08-22 09:51:00
9
10SET statement_timeout = 0;
11SET lock_timeout = 0;
12SET idle_in_transaction_session_timeout = 0;
13SET client_encoding = 'UTF8';
14SET standard_conforming_strings = on;
15SELECT pg_catalog.set_config('search_path', '', false);
16SET check_function_bodies = false;
17SET xmloption = content;
18SET client_min_messages = warning;
19SET row_security = off;
20
21--
22-- TOC entry 1 (class 3079 OID 12387)
23-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
24--
25
26CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
27
28
29--
30-- TOC entry 2184 (class 0 OID 0)
31-- Dependencies: 1
32-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
33--
34
35COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
36
37
38SET default_tablespace = '';
39
40SET default_with_oids = false;
41
42--
43-- TOC entry 188 (class 1259 OID 24667)
44-- Name: commnt; Type: TABLE; Schema: public; Owner: postgres
45--
46
47CREATE TABLE public.commnt (
48 author character varying(31) NOT NULL,
49 pauthor character varying(31) NOT NULL,
50 pdate timestamp without time zone NOT NULL,
51 datestamp timestamp without time zone NOT NULL,
52 ctext character varying(255)
53);
54
55
56ALTER TABLE public.commnt OWNER TO postgres;
57
58--
59-- TOC entry 186 (class 1259 OID 24639)
60-- Name: post; Type: TABLE; Schema: public; Owner: postgres
61--
62
63CREATE TABLE public.post (
64 author character varying(31) NOT NULL,
65 datestamp timestamp without time zone NOT NULL,
66 ptext character varying(255) NOT NULL,
67 foto character varying(1023)
68);
69
70
71ALTER TABLE public.post OWNER TO postgres;
72
73--
74-- TOC entry 191 (class 1259 OID 24722)
75-- Name: tagcommntuser; Type: TABLE; Schema: public; Owner: postgres
76--
77
78CREATE TABLE public.tagcommntuser (
79 cauthor character varying(31) NOT NULL,
80 cdate timestamp without time zone NOT NULL,
81 cpauthor character varying(31),
82 cpdate timestamp without time zone,
83 taguser character varying(31) NOT NULL
84);
85
86
87ALTER TABLE public.tagcommntuser OWNER TO postgres;
88
89--
90-- TOC entry 190 (class 1259 OID 24707)
91-- Name: tagpostuser; Type: TABLE; Schema: public; Owner: postgres
92--
93
94CREATE TABLE public.tagpostuser (
95 pauthor character varying(31) NOT NULL,
96 pdate timestamp without time zone NOT NULL,
97 taguser character varying(31) NOT NULL
98);
99
100
101ALTER TABLE public.tagpostuser OWNER TO postgres;
102
103--
104-- TOC entry 189 (class 1259 OID 24692)
105-- Name: topic; Type: TABLE; Schema: public; Owner: postgres
106--
107
108CREATE TABLE public.topic (
109 tname character varying(31) NOT NULL,
110 datestamp timestamp without time zone,
111 pauthor character varying(31),
112 pdate timestamp without time zone,
113 cauthor character varying(31),
114 cpauthor character varying(31),
115 cpdate timestamp without time zone,
116 cdate timestamp without time zone
117);
118
119
120ALTER TABLE public.topic OWNER TO postgres;
121
122--
123-- TOC entry 185 (class 1259 OID 24628)
124-- Name: userprofile; Type: TABLE; Schema: public; Owner: postgres
125--
126
127CREATE TABLE public.userprofile (
128 login character varying(31) NOT NULL,
129 passw character varying(255) NOT NULL,
130 passhash character varying(255) DEFAULT '-1'::character varying,
131 visibility boolean DEFAULT false NOT NULL,
132 bio character varying(4095) DEFAULT 'Hello i am new to /cuckoo!!'::character varying NOT NULL,
133 realname character varying(255) NOT NULL
134);
135
136
137ALTER TABLE public.userprofile OWNER TO postgres;
138
139--
140-- TOC entry 187 (class 1259 OID 24652)
141-- Name: userrel; Type: TABLE; Schema: public; Owner: postgres
142--
143
144CREATE TABLE public.userrel (
145 srcuser character varying(31) NOT NULL,
146 tgtuser character varying(31) NOT NULL,
147 datestamp timestamp without time zone NOT NULL,
148 status smallint NOT NULL
149);
150
151
152ALTER TABLE public.userrel OWNER TO postgres;
153
154--
155-- TOC entry 2173 (class 0 OID 24667)
156-- Dependencies: 188
157-- Data for Name: commnt; Type: TABLE DATA; Schema: public; Owner: postgres
158--
159
160COPY public.commnt (author, pauthor, pdate, datestamp, ctext) FROM stdin;
161\.
162
163
164--
165-- TOC entry 2171 (class 0 OID 24639)
166-- Dependencies: 186
167-- Data for Name: post; Type: TABLE DATA; Schema: public; Owner: postgres
168--
169
170COPY public.post (author, datestamp, ptext, foto) FROM stdin;
171\.
172
173
174--
175-- TOC entry 2176 (class 0 OID 24722)
176-- Dependencies: 191
177-- Data for Name: tagcommntuser; Type: TABLE DATA; Schema: public; Owner: postgres
178--
179
180COPY public.tagcommntuser (cauthor, cdate, cpauthor, cpdate, taguser) FROM stdin;
181\.
182
183
184--
185-- TOC entry 2175 (class 0 OID 24707)
186-- Dependencies: 190
187-- Data for Name: tagpostuser; Type: TABLE DATA; Schema: public; Owner: postgres
188--
189
190COPY public.tagpostuser (pauthor, pdate, taguser) FROM stdin;
191\.
192
193
194--
195-- TOC entry 2174 (class 0 OID 24692)
196-- Dependencies: 189
197-- Data for Name: topic; Type: TABLE DATA; Schema: public; Owner: postgres
198--
199
200COPY public.topic (tname, datestamp, pauthor, pdate, cauthor, cpauthor, cpdate, cdate) FROM stdin;
201\.
202
203
204--
205-- TOC entry 2170 (class 0 OID 24628)
206-- Dependencies: 185
207-- Data for Name: userprofile; Type: TABLE DATA; Schema: public; Owner: postgres
208--
209
210COPY public.userprofile (login, passw, passhash, visibility, bio, realname) FROM stdin;
211\.
212
213
214--
215-- TOC entry 2172 (class 0 OID 24652)
216-- Dependencies: 187
217-- Data for Name: userrel; Type: TABLE DATA; Schema: public; Owner: postgres
218--
219
220COPY public.userrel (srcuser, tgtuser, datestamp, status) FROM stdin;
221\.
222
223
224--
225-- TOC entry 2035 (class 2606 OID 24671)
226-- Name: commnt commnt_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
227--
228
229ALTER TABLE ONLY public.commnt
230 ADD CONSTRAINT commnt_pkey PRIMARY KEY (author, pauthor, pdate, datestamp);
231
232
233--
234-- TOC entry 2031 (class 2606 OID 24646)
235-- Name: post post_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
236--
237
238ALTER TABLE ONLY public.post
239 ADD CONSTRAINT post_pkey PRIMARY KEY (author, datestamp);
240
241
242--
243-- TOC entry 2041 (class 2606 OID 24726)
244-- Name: tagcommntuser tagcommntuser_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
245--
246
247ALTER TABLE ONLY public.tagcommntuser
248 ADD CONSTRAINT tagcommntuser_pkey PRIMARY KEY (taguser, cauthor, cdate);
249
250
251--
252-- TOC entry 2039 (class 2606 OID 24711)
253-- Name: tagpostuser tagpostuser_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
254--
255
256ALTER TABLE ONLY public.tagpostuser
257 ADD CONSTRAINT tagpostuser_pkey PRIMARY KEY (taguser, pauthor, pdate);
258
259
260--
261-- TOC entry 2037 (class 2606 OID 24696)
262-- Name: topic topic_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
263--
264
265ALTER TABLE ONLY public.topic
266 ADD CONSTRAINT topic_pkey PRIMARY KEY (tname);
267
268
269--
270-- TOC entry 2029 (class 2606 OID 24638)
271-- Name: userprofile userprofile_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
272--
273
274ALTER TABLE ONLY public.userprofile
275 ADD CONSTRAINT userprofile_pkey PRIMARY KEY (login);
276
277
278--
279-- TOC entry 2033 (class 2606 OID 24656)
280-- Name: userrel userrel_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
281--
282
283ALTER TABLE ONLY public.userrel
284 ADD CONSTRAINT userrel_pkey PRIMARY KEY (srcuser, tgtuser);
285
286
287--
288-- TOC entry 2045 (class 2606 OID 24672)
289-- Name: commnt commnt_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
290--
291
292ALTER TABLE ONLY public.commnt
293 ADD CONSTRAINT commnt_author_fkey FOREIGN KEY (author) REFERENCES public.userprofile(login);
294
295
296--
297-- TOC entry 2046 (class 2606 OID 24677)
298-- Name: commnt commnt_pauthor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
299--
300
301ALTER TABLE ONLY public.commnt
302 ADD CONSTRAINT commnt_pauthor_fkey FOREIGN KEY (pauthor, pdate) REFERENCES public.post(author, datestamp);
303
304
305--
306-- TOC entry 2042 (class 2606 OID 24647)
307-- Name: post post_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
308--
309
310ALTER TABLE ONLY public.post
311 ADD CONSTRAINT post_author_fkey FOREIGN KEY (author) REFERENCES public.userprofile(login);
312
313
314--
315-- TOC entry 2051 (class 2606 OID 24727)
316-- Name: tagcommntuser tagcommntuser_cauthor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
317--
318
319ALTER TABLE ONLY public.tagcommntuser
320 ADD CONSTRAINT tagcommntuser_cauthor_fkey FOREIGN KEY (cauthor, cdate, cpauthor, cpdate) REFERENCES public.commnt(author, datestamp, pauthor, pdate);
321
322
323--
324-- TOC entry 2052 (class 2606 OID 24732)
325-- Name: tagcommntuser tagcommntuser_taguser_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
326--
327
328ALTER TABLE ONLY public.tagcommntuser
329 ADD CONSTRAINT tagcommntuser_taguser_fkey FOREIGN KEY (taguser) REFERENCES public.userprofile(login);
330
331
332--
333-- TOC entry 2049 (class 2606 OID 24712)
334-- Name: tagpostuser tagpostuser_pauthor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
335--
336
337ALTER TABLE ONLY public.tagpostuser
338 ADD CONSTRAINT tagpostuser_pauthor_fkey FOREIGN KEY (pauthor, pdate) REFERENCES public.post(author, datestamp);
339
340
341--
342-- TOC entry 2050 (class 2606 OID 24717)
343-- Name: tagpostuser tagpostuser_taguser_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
344--
345
346ALTER TABLE ONLY public.tagpostuser
347 ADD CONSTRAINT tagpostuser_taguser_fkey FOREIGN KEY (taguser) REFERENCES public.userprofile(login);
348
349
350--
351-- TOC entry 2048 (class 2606 OID 24702)
352-- Name: topic topic_cauthor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
353--
354
355ALTER TABLE ONLY public.topic
356 ADD CONSTRAINT topic_cauthor_fkey FOREIGN KEY (cauthor, cpauthor, cpdate, cdate) REFERENCES public.commnt(author, pauthor, pdate, datestamp);
357
358
359--
360-- TOC entry 2047 (class 2606 OID 24697)
361-- Name: topic topic_pauthor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
362--
363
364ALTER TABLE ONLY public.topic
365 ADD CONSTRAINT topic_pauthor_fkey FOREIGN KEY (pauthor, pdate) REFERENCES public.post(author, datestamp);
366
367
368--
369-- TOC entry 2043 (class 2606 OID 24657)
370-- Name: userrel userrel_srcuser_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
371--
372
373ALTER TABLE ONLY public.userrel
374 ADD CONSTRAINT userrel_srcuser_fkey FOREIGN KEY (srcuser) REFERENCES public.userprofile(login);
375
376
377--
378-- TOC entry 2044 (class 2606 OID 24662)
379-- Name: userrel userrel_tgtuser_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
380--
381
382ALTER TABLE ONLY public.userrel
383 ADD CONSTRAINT userrel_tgtuser_fkey FOREIGN KEY (tgtuser) REFERENCES public.userprofile(login);
384
385
386-- Completed on 2019-08-22 09:51:00
387
388--
389-- PostgreSQL database dump complete
390--