-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgschema.sql
More file actions
85 lines (58 loc) · 1.74 KB
/
Copy pathpgschema.sql
File metadata and controls
85 lines (58 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1)
-- Dumped by pg_dump version 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'standard public schema';
--
-- Name: notify_slides(); Type: FUNCTION; Schema: public; Owner: francois
--
CREATE FUNCTION public.notify_slides() RETURNS trigger
LANGUAGE plpgsql
AS $$
begin
perform pg_notify(old.name,new.hash);
return new;
end;
$$;
ALTER FUNCTION public.notify_slides() OWNER TO francois;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: slides; Type: TABLE; Schema: public; Owner: francois
--
CREATE TABLE public.slides (
name character varying(30) NOT NULL,
hash character varying(50)
);
ALTER TABLE public.slides OWNER TO francois;
--
-- Name: slides slides_pkey; Type: CONSTRAINT; Schema: public; Owner: francois
--
ALTER TABLE ONLY public.slides
ADD CONSTRAINT slides_pkey PRIMARY KEY (name);
--
-- Name: slides notify_update; Type: TRIGGER; Schema: public; Owner: francois
--
CREATE TRIGGER notify_update AFTER UPDATE ON public.slides FOR EACH ROW EXECUTE FUNCTION public.notify_slides();
--
-- PostgreSQL database dump complete
--