src.sql

text/plain

Filename: src.sql
Type: text/plain
Part: 0
Message: Fundamental scheduling bug in parallel restore of partitioned tables
--
-- PostgreSQL database dump
--

-- Dumped from database version 18devel
-- Dumped by pg_dump version 18devel

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'SQL_ASCII';
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;

SET default_tablespace = '';

--
-- Name: parent1; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.parent1 (
    id integer NOT NULL,
    b text
)
PARTITION BY LIST (id);


ALTER TABLE public.parent1 OWNER TO postgres;

SET default_table_access_method = heap;

--
-- Name: c11; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.c11 (
    id integer CONSTRAINT parent1_id_not_null NOT NULL,
    b text
);


ALTER TABLE public.c11 OWNER TO postgres;

--
-- Name: c12; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.c12 (
    id integer CONSTRAINT parent1_id_not_null NOT NULL,
    b text
);


ALTER TABLE public.c12 OWNER TO postgres;

--
-- Name: parent2; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.parent2 (
    id integer NOT NULL,
    ref integer,
    b text
)
PARTITION BY LIST (id);


ALTER TABLE public.parent2 OWNER TO postgres;

--
-- Name: c21; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.c21 (
    id integer CONSTRAINT parent2_id_not_null NOT NULL,
    ref integer,
    b text
);


ALTER TABLE public.c21 OWNER TO postgres;

--
-- Name: c22; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.c22 (
    id integer CONSTRAINT parent2_id_not_null NOT NULL,
    ref integer,
    b text
);


ALTER TABLE public.c22 OWNER TO postgres;

--
-- Name: c11; Type: TABLE ATTACH; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.parent1 ATTACH PARTITION public.c11 FOR VALUES IN (1);


--
-- Name: c12; Type: TABLE ATTACH; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.parent1 ATTACH PARTITION public.c12 FOR VALUES IN (2);


--
-- Name: c21; Type: TABLE ATTACH; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.parent2 ATTACH PARTITION public.c21 FOR VALUES IN (1);


--
-- Name: c22; Type: TABLE ATTACH; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.parent2 ATTACH PARTITION public.c22 FOR VALUES IN (2);


--
-- Data for Name: c11; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.c11 (id, b) FROM stdin;
1	foo
\.


--
-- Data for Name: c12; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.c12 (id, b) FROM stdin;
\.


--
-- Data for Name: c21; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.c21 (id, ref, b) FROM stdin;
\.


--
-- Data for Name: c22; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.c22 (id, ref, b) FROM stdin;
2	1	bar
\.


--
-- Statistics for Name: c11; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c11',
	'relpages', '1'::integer,
	'reltuples', '1'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: c12; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c12',
	'relpages', '0'::integer,
	'reltuples', '-1'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: c21; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c21',
	'relpages', '0'::integer,
	'reltuples', '-1'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: c22; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c22',
	'relpages', '1'::integer,
	'reltuples', '1'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: parent1; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'parent1',
	'relpages', '0'::integer,
	'reltuples', '-1'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: parent2; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'parent2',
	'relpages', '0'::integer,
	'reltuples', '-1'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Name: parent1 parent1_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.parent1
    ADD CONSTRAINT parent1_pkey PRIMARY KEY (id);


--
-- Name: c11 c11_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.c11
    ADD CONSTRAINT c11_pkey PRIMARY KEY (id);


--
-- Statistics for Name: c11_pkey; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c11_pkey',
	'relpages', '1'::integer,
	'reltuples', '0'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Name: c12 c12_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.c12
    ADD CONSTRAINT c12_pkey PRIMARY KEY (id);


--
-- Statistics for Name: c12_pkey; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c12_pkey',
	'relpages', '1'::integer,
	'reltuples', '0'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Name: parent2 parent2_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.parent2
    ADD CONSTRAINT parent2_pkey PRIMARY KEY (id);


--
-- Name: c21 c21_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.c21
    ADD CONSTRAINT c21_pkey PRIMARY KEY (id);


--
-- Statistics for Name: c21_pkey; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c21_pkey',
	'relpages', '1'::integer,
	'reltuples', '0'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Name: c22 c22_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.c22
    ADD CONSTRAINT c22_pkey PRIMARY KEY (id);


--
-- Statistics for Name: c22_pkey; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'c22_pkey',
	'relpages', '1'::integer,
	'reltuples', '0'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: parent1_pkey; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'parent1_pkey',
	'relpages', '0'::integer,
	'reltuples', '0'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Statistics for Name: parent2_pkey; Type: STATISTICS DATA; Schema: public; Owner: -
--

SELECT * FROM pg_catalog.pg_restore_relation_stats(
	'version', '180000'::integer,
	'schemaname', 'public',
	'relname', 'parent2_pkey',
	'relpages', '0'::integer,
	'reltuples', '0'::real,
	'relallvisible', '0'::integer,
	'relallfrozen', '0'::integer
);


--
-- Name: c11_pkey; Type: INDEX ATTACH; Schema: public; Owner: postgres
--

ALTER INDEX public.parent1_pkey ATTACH PARTITION public.c11_pkey;


--
-- Name: c12_pkey; Type: INDEX ATTACH; Schema: public; Owner: postgres
--

ALTER INDEX public.parent1_pkey ATTACH PARTITION public.c12_pkey;


--
-- Name: c21_pkey; Type: INDEX ATTACH; Schema: public; Owner: postgres
--

ALTER INDEX public.parent2_pkey ATTACH PARTITION public.c21_pkey;


--
-- Name: c22_pkey; Type: INDEX ATTACH; Schema: public; Owner: postgres
--

ALTER INDEX public.parent2_pkey ATTACH PARTITION public.c22_pkey;


--
-- Name: parent2 parent2_ref_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE public.parent2
    ADD CONSTRAINT parent2_ref_fkey FOREIGN KEY (ref) REFERENCES public.parent1(id);


--
-- PostgreSQL database dump complete
--