Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- PostgreSQL database dump
- --
- -- Dumped from database version 14.5
- -- Dumped by pg_dump version 14.5
- 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: database_name; Type: DATABASE; Schema: -; Owner: postgres
- --
- CREATE DATABASE database_name WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'Russian_Russia.1251';
- ALTER DATABASE database_name OWNER TO postgres;
- \connect database_name
- 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: schema; Type: SCHEMA; Schema: -; Owner: postgres
- --
- CREATE SCHEMA schema;
- ALTER SCHEMA schema OWNER TO postgres;
- SET default_tablespace = '';
- SET default_table_access_method = heap;
- --
- -- Name: galaxy; Type: TABLE; Schema: schema; Owner: postgres
- --
- CREATE TABLE schema.galaxy (
- size integer,
- class text,
- name text,
- id_galaxy uuid DEFAULT gen_random_uuid() NOT NULL
- );
- ALTER TABLE schema.galaxy OWNER TO postgres;
- --
- -- Name: planet; Type: TABLE; Schema: schema; Owner: postgres
- --
- CREATE TABLE schema.planet (
- name text,
- id_planet uuid DEFAULT gen_random_uuid() NOT NULL,
- id_system uuid NOT NULL,
- radius integer
- );
- ALTER TABLE schema.planet OWNER TO postgres;
- --
- -- Name: system; Type: TABLE; Schema: schema; Owner: postgres
- --
- CREATE TABLE schema.system (
- name text,
- id_system uuid DEFAULT gen_random_uuid() NOT NULL,
- id_galaxy uuid NOT NULL
- );
- ALTER TABLE schema.system OWNER TO postgres;
- --
- -- Data for Name: galaxy; Type: TABLE DATA; Schema: schema; Owner: postgres
- --
- COPY schema.galaxy (size, class, name, id_galaxy) FROM stdin;
- 16 spiral Milky Way c3ccdb16-3886-46dd-a680-e4e71b254b61
- \.
- --
- -- Data for Name: planet; Type: TABLE DATA; Schema: schema; Owner: postgres
- --
- COPY schema.planet (name, id_planet, id_system, radius) FROM stdin;
- Earth e4c32a15-f29b-417d-905f-f99e33825d0a 80ac4fe6-05f0-47ba-a1fd-6a4f7c7b2208 6371000
- Venus 37a5c663-55c3-4e64-af96-7d74dc00d969 80ac4fe6-05f0-47ba-a1fd-6a4f7c7b2208 6051000
- Mars 869ea851-43f2-483c-9d5e-816925a6a199 80ac4fe6-05f0-47ba-a1fd-6a4f7c7b2208 3389000
- \.
- --
- -- Data for Name: system; Type: TABLE DATA; Schema: schema; Owner: postgres
- --
- COPY schema.system (name, id_system, id_galaxy) FROM stdin;
- solar system 80ac4fe6-05f0-47ba-a1fd-6a4f7c7b2208 c3ccdb16-3886-46dd-a680-e4e71b254b61
- \.
- --
- -- Name: galaxy galaxy_key; Type: CONSTRAINT; Schema: schema; Owner: postgres
- --
- ALTER TABLE ONLY schema.galaxy
- ADD CONSTRAINT galaxy_key PRIMARY KEY (id_galaxy);
- --
- -- Name: planet id_planet; Type: CONSTRAINT; Schema: schema; Owner: postgres
- --
- ALTER TABLE ONLY schema.planet
- ADD CONSTRAINT id_planet PRIMARY KEY (id_planet);
- --
- -- Name: system key_system; Type: CONSTRAINT; Schema: schema; Owner: postgres
- --
- ALTER TABLE ONLY schema.system
- ADD CONSTRAINT key_system PRIMARY KEY (id_system);
- --
- -- Name: system foreign_key_galaxy; Type: FK CONSTRAINT; Schema: schema; Owner: postgres
- --
- ALTER TABLE ONLY schema.system
- ADD CONSTRAINT foreign_key_galaxy FOREIGN KEY (id_galaxy) REFERENCES schema.galaxy(id_galaxy);
- --
- -- Name: planet foreign_key_system; Type: FK CONSTRAINT; Schema: schema; Owner: postgres
- --
- ALTER TABLE ONLY schema.planet
- ADD CONSTRAINT foreign_key_system FOREIGN KEY (id_system) REFERENCES schema.system(id_system);
- --
- -- PostgreSQL database dump complete
- --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement