--
--


-- Started on 2020-04-23 15:05:06 IST

SELECT pg_catalog.set_config('search_path', '', false);

--
-- TOC entry 2704 (class 3456 OID 125434)
-- Name: collat_test; Type: COLLATION; Schema: public; Owner: -
--

CREATE COLLATION public.collat_test (provider = libc, locale = 'C');


--
-- TOC entry 2 (class 3079 OID 125425)
-- Name: autoinc; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS autoinc WITH SCHEMA public;


--
-- TOC entry 3208 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION autoinc; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION autoinc IS 'functions for autoincrementing fields';


--
-- TOC entry 550 (class 1247 OID 125436)
-- Name: domain_test; Type: DOMAIN; Schema: public; Owner: -
--

CREATE DOMAIN public.domain_test AS boolean
	CONSTRAINT domcons_test CHECK ((1 = 1));


--
-- TOC entry 660 (class 1247 OID 134532)
-- Name: type_test; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.type_test AS (
	id integer
);


--
-- TOC entry 213 (class 1255 OID 125423)
-- Name: event_trig_func(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.event_trig_func() RETURNS event_trigger
    LANGUAGE plpgsql
    AS $$begin
RAISE NOTICE 'Hello from void function';
end;$$;


--
-- TOC entry 215 (class 1255 OID 134480)
-- Name: func_test(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.func_test() RETURNS integer
    LANGUAGE plpgsql
    AS $$begin
return 1;
end;$$;


--
-- TOC entry 216 (class 1255 OID 134485)
-- Name: proc_test(); Type: PROCEDURE; Schema: public; Owner: -
--

CREATE PROCEDURE public.proc_test()
    LANGUAGE plpgsql
    AS $$begin
raise notice 'hello';
end;$$;


--
-- TOC entry 212 (class 1255 OID 125420)
-- Name: trig_func(); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.trig_func() RETURNS trigger
    LANGUAGE plpgsql
    AS $$begin
select 1;
end;$$;


--
-- TOC entry 1680 (class 3601 OID 134474)
-- Name: fts_parse; Type: TEXT SEARCH PARSER; Schema: public; Owner: -
--

CREATE TEXT SEARCH PARSER public.fts_parse (
    START = prsd_start,
    GETTOKEN = prsd_nexttoken,
    END = prsd_end,
    HEADLINE = prsd_headline,
    LEXTYPES = prsd_lextype );


--
-- TOC entry 1686 (class 3764 OID 134475)
-- Name: fts_template; Type: TEXT SEARCH TEMPLATE; Schema: public; Owner: -
--

CREATE TEXT SEARCH TEMPLATE public.fts_template (
    INIT = dsimple_init,
    LEXIZE = dsimple_lexize );


--
-- TOC entry 1709 (class 3600 OID 134473)
-- Name: fts_dict; Type: TEXT SEARCH DICTIONARY; Schema: public; Owner: -
--

CREATE TEXT SEARCH DICTIONARY public.fts_dict (
    TEMPLATE = pg_catalog.simple );


--
-- TOC entry 1732 (class 3602 OID 134472)
-- Name: fts_conf; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: -
--

CREATE TEXT SEARCH CONFIGURATION public.fts_conf (
    PARSER = pg_catalog."default" );


--
-- TOC entry 1733 (class 2328 OID 125428)
-- Name: fdw_test; Type: FOREIGN DATA WRAPPER; Schema: -; Owner: -
--

CREATE FOREIGN DATA WRAPPER fdw_test;


--
-- TOC entry 1734 (class 1417 OID 125429)
-- Name: fdw_foreign_srv; Type: SERVER; Schema: -; Owner: -
--

CREATE SERVER fdw_foreign_srv FOREIGN DATA WRAPPER fdw_test;


--
-- TOC entry 3209 (class 0 OID 0)
-- Name: USER MAPPING postgres SERVER fdw_foreign_srv; Type: USER MAPPING; Schema: -; Owner: -
--

CREATE USER MAPPING FOR postgres SERVER fdw_foreign_srv OPTIONS (
    appname 'pgadmin'
);



--
-- TOC entry 203 (class 1259 OID 134476)
-- Name: foreign_tab; Type: FOREIGN TABLE; Schema: public; Owner: -
--

CREATE FOREIGN TABLE public.foreign_tab (
)
SERVER fdw_foreign_srv;



--
-- TOC entry 204 (class 1259 OID 134481)
-- Name: mview_test; Type: MATERIALIZED VIEW; Schema: public; Owner: -
--

CREATE MATERIALIZED VIEW public.mview_test AS
 SELECT 1
  WITH NO DATA;


--
-- TOC entry 208 (class 1259 OID 134518)
-- Name: part; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.part (
    id integer NOT NULL
)
PARTITION BY RANGE (id);


--
-- TOC entry 209 (class 1259 OID 134523)
-- Name: part1; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.part1 (
    id integer NOT NULL
);
ALTER TABLE ONLY public.part ATTACH PARTITION public.part1 FOR VALUES FROM (1) TO (10);


--
-- TOC entry 205 (class 1259 OID 134486)
-- Name: seq_test; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.seq_test
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 9999
    CACHE 1;


--
-- TOC entry 206 (class 1259 OID 134488)
-- Name: table_test; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.table_test (
    col1 integer NOT NULL,
    col2 character varying
);


--
-- TOC entry 207 (class 1259 OID 134500)
-- Name: table_test2; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.table_test2 (
    id integer,
    col1 character varying NOT NULL
);


--
-- TOC entry 211 (class 1259 OID 134533)
-- Name: view_pg_class; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.view_pg_class AS
 SELECT pg_class.oid,
    pg_class.relname,
    pg_class.relnamespace,
    pg_class.reltype,
    pg_class.reloftype,
    pg_class.relowner,
    pg_class.relam,
    pg_class.relfilenode,
    pg_class.reltablespace,
    pg_class.relpages,
    pg_class.reltuples,
    pg_class.relallvisible,
    pg_class.reltoastrelid,
    pg_class.relhasindex,
    pg_class.relisshared,
    pg_class.relpersistence,
    pg_class.relkind,
    pg_class.relnatts,
    pg_class.relchecks,
    pg_class.relhasrules,
    pg_class.relhastriggers,
    pg_class.relhassubclass,
    pg_class.relrowsecurity,
    pg_class.relforcerowsecurity,
    pg_class.relispopulated,
    pg_class.relreplident,
    pg_class.relispartition,
    pg_class.relrewrite,
    pg_class.relfrozenxid,
    pg_class.relminmxid,
    pg_class.relacl,
    pg_class.reloptions,
    pg_class.relpartbound
   FROM pg_class;


--
-- TOC entry 3054 (class 2606 OID 134516)
-- Name: table_test check_test; Type: CHECK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE public.table_test
    ADD CONSTRAINT check_test CHECK ((1 = 1)) NOT VALID;


--
-- TOC entry 3057 (class 2606 OID 134497)
-- Name: table_test exc_cons; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.table_test
    ADD CONSTRAINT exc_cons EXCLUDE USING btree (col1 NULLS FIRST WITH =) WHERE ((1 = 1));


--
-- TOC entry 3068 (class 2606 OID 134522)
-- Name: part part_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.part
    ADD CONSTRAINT part_pkey PRIMARY KEY (id);


--
-- TOC entry 3070 (class 2606 OID 134527)
-- Name: part1 part1_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.part1
    ADD CONSTRAINT part1_pkey PRIMARY KEY (id);


--
-- TOC entry 3066 (class 2606 OID 134507)
-- Name: table_test2 table_test2_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.table_test2
    ADD CONSTRAINT table_test2_pkey PRIMARY KEY (col1);


--
-- TOC entry 3055 (class 2606 OID 134515)
-- Name: table_test table_test_check; Type: CHECK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE public.table_test
    ADD CONSTRAINT table_test_check CHECK ((1 = 1)) NOT VALID;


--
-- TOC entry 3060 (class 2606 OID 134514)
-- Name: table_test table_test_col2_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.table_test
    ADD CONSTRAINT table_test_col2_key UNIQUE (col2);


--
-- TOC entry 3062 (class 2606 OID 134499)
-- Name: table_test table_test_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.table_test
    ADD CONSTRAINT table_test_pkey PRIMARY KEY (col1);


--
-- TOC entry 3064 (class 2606 OID 134492)
-- Name: table_test uniq_cons; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.table_test
    ADD CONSTRAINT uniq_cons UNIQUE (col1);


--
-- TOC entry 3058 (class 1259 OID 134517)
-- Name: index_test; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_test ON public.table_test USING btree (col2);


--
-- TOC entry 3071 (class 0 OID 0)
-- Name: part1_pkey; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.part_pkey ATTACH PARTITION public.part1_pkey;


--
-- TOC entry 3201 (class 2618 OID 134528)
-- Name: table_test ruletest; Type: RULE; Schema: public; Owner: -
--

CREATE RULE ruletest AS
    ON INSERT TO public.table_test
   WHERE (1 = 1) DO NOTHING;


--
-- TOC entry 3073 (class 2620 OID 134529)
-- Name: table_test trig_test; Type: TRIGGER; Schema: public; Owner: -
--

CREATE TRIGGER trig_test BEFORE INSERT ON public.table_test FOR EACH ROW EXECUTE FUNCTION public.trig_func();


--
-- TOC entry 3072 (class 2606 OID 134508)
-- Name: table_test table_test_col2_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.table_test
    ADD CONSTRAINT table_test_col2_fkey FOREIGN KEY (col2) REFERENCES public.table_test2(col1) NOT VALID;


--
-- TOC entry 3053 (class 3466 OID 125427)
-- Name: event_trig; Type: EVENT TRIGGER; Schema: -; Owner: -
--

CREATE EVENT TRIGGER event_trig ON ddl_command_start
   EXECUTE FUNCTION public.event_trig_func();


-- Completed on 2020-04-23 15:05:07 IST

--
--

