Re: pg_dump insert column GENERATED

Поиск
Список
Период
Сортировка
От Дмитрий Иванов
Тема Re: pg_dump insert column GENERATED
Дата
Msg-id CAPL5KHp6n+7vPjvi66=fiEAX5N7XQRhMJ8r-vxYusLzrSEeXJA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_dump insert column GENERATED  (Дмитрий Иванов <firstdismay@gmail.com>)
Список pgsql-general
It seems to me that you are right all round (I gave up COPY because of problems with the MONEY type):

sudo /usr/lib/postgresql/14/bin/pg_dump --file "/home/dismay/uchet/object.sql" --host "server" --port "5999" --username "back" --no-password --verbose --format=p --quote-all-identifiers --encoding="UTF8" --table "bpd".object --dbname "Uchet"
--
-- PostgreSQL database dump
--

-- Dumped from database version 12.9
-- Dumped by pg_dump version 14.1 (Debian 14.1-1.pgdg110+1)

-- Started on 2021-11-22 20:21:59 +05

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;

SET default_tablespace = '';

SET default_table_access_method = "heap";

--
-- TOC entry 353 (class 1259 OID 94786)
-- Name: object; Type: TABLE; Schema: bpd; Owner: IvanovDU
--

CREATE TABLE "bpd"."object" (
    "id" bigint DEFAULT "nextval"('"bpd"."object_general_id_seq"'::"regclass") NOT NULL,
    "id_class" bigint NOT NULL,
    "id_position" bigint DEFAULT '-1'::integer NOT NULL,
    "bquantity" numeric NOT NULL,
    "id_position_root" bigint NOT NULL,
    "id_conception" bigint NOT NULL,
    "barcode_unit" bigint DEFAULT 0 NOT NULL,
    "id_unit_conversion_rule" integer NOT NULL,
    "timestamp" timestamp without time zone DEFAULT LOCALTIMESTAMP NOT NULL,
    "on_freeze" boolean DEFAULT false NOT NULL,
    "timestamp_class" timestamp without time zone DEFAULT LOCALTIMESTAMP(3) NOT NULL,
    "name" character varying(255) NOT NULL,
    "id_class_root" bigint NOT NULL,
    "id_group" bigint NOT NULL,
    "id_group_root" bigint NOT NULL,
    "id_object_carrier" bigint DEFAULT '-1'::integer NOT NULL,
    "desc" character varying(2044) DEFAULT 'н/д'::character varying NOT NULL,
    "id_class_prop_object_carrier" bigint DEFAULT '-1'::integer NOT NULL,
    "id_pos_temp_prop" bigint DEFAULT '-1'::integer NOT NULL,
    "mc" numeric DEFAULT 0 NOT NULL,
    "is_inside" boolean GENERATED ALWAYS AS ((("id_object_carrier" > 0) OR ("id_pos_temp_prop" >= 0))) STORED,
    CONSTRAINT "check_self_integration" CHECK (("id" <> "id_object_carrier"))
);
ALTER TABLE "bpd"."object" OWNER TO "IvanovDU";
--
-- TOC entry 5225 (class 0 OID 94786)
-- Dependencies: 353
-- Data for Name: object; Type: TABLE DATA; Schema: bpd; Owner: IvanovDU
--
COPY "bpd"."object" ("id", "id_class", "id_position", "bquantity", "id_position_root", "id_conception", "barcode_unit", "id_unit_conversion_rule", "timestamp", "on_freeze", "timestamp_class", "name", "id_class_root", "id_group", "id_group_root", "id_object_carrier", "desc", "id_class_prop_object_carrier", "id_pos_temp_prop", "mc") FROM stdin;
51253 1015 461 1 461 84 2020000512530 14 2021-11-14 08:40:31.381 f 2021-02-19 11:01:28.402 NFC метка самоклеющаяся 1013 138 138 -1 -1 -1 1................

*************************************************************************************************************************************************************************************
sudo /usr/lib/postgresql/14/bin/pg_dump --file "/home/dismay/uchet/object2.sql" --host "server" --port "5999" --username "back" --no-password --verbose --format=p --quote-all-identifiers --column-inserts --inserts --encoding="UTF8" --table "bpd".object --dbname "Uchet"
--
-- PostgreSQL database dump
--

-- Dumped from database version 12.9
-- Dumped by pg_dump version 14.1 (Debian 14.1-1.pgdg110+1)

-- Started on 2021-11-22 20:24:31 +05

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;

SET default_tablespace = '';

SET default_table_access_method = "heap";

--
-- TOC entry 353 (class 1259 OID 94786)
-- Name: object; Type: TABLE; Schema: bpd; Owner: IvanovDU
--

CREATE TABLE "bpd"."object" (
    "id" bigint DEFAULT "nextval"('"bpd"."object_general_id_seq"'::"regclass") NOT NULL,
    "id_class" bigint NOT NULL,
    "id_position" bigint DEFAULT '-1'::integer NOT NULL,
    "bquantity" numeric NOT NULL,
    "id_position_root" bigint NOT NULL,
    "id_conception" bigint NOT NULL,
    "barcode_unit" bigint DEFAULT 0 NOT NULL,
    "id_unit_conversion_rule" integer NOT NULL,
    "timestamp" timestamp without time zone DEFAULT LOCALTIMESTAMP NOT NULL,
    "on_freeze" boolean DEFAULT false NOT NULL,
    "timestamp_class" timestamp without time zone DEFAULT LOCALTIMESTAMP(3) NOT NULL,
    "name" character varying(255) NOT NULL,
    "id_class_root" bigint NOT NULL,
    "id_group" bigint NOT NULL,
    "id_group_root" bigint NOT NULL,
    "id_object_carrier" bigint DEFAULT '-1'::integer NOT NULL,
    "desc" character varying(2044) DEFAULT 'н/д'::character varying NOT NULL,
    "id_class_prop_object_carrier" bigint DEFAULT '-1'::integer NOT NULL,
    "id_pos_temp_prop" bigint DEFAULT '-1'::integer NOT NULL,
    "mc" numeric DEFAULT 0 NOT NULL,
    "is_inside" boolean GENERATED ALWAYS AS ((("id_object_carrier" > 0) OR ("id_pos_temp_prop" >= 0))) STORED,
    CONSTRAINT "check_self_integration" CHECK (("id" <> "id_object_carrier"))
);


ALTER TABLE "bpd"."object" OWNER TO "IvanovDU";

--
-- TOC entry 5225 (class 0 OID 94786)
-- Dependencies: 353
-- Data for Name: object; Type: TABLE DATA; Schema: bpd; Owner: IvanovDU
--

INSERT INTO "bpd"."object" ("id", "id_class", "id_position", "bquantity", "id_position_root", "id_conception", "barcode_unit", "id_unit_conversion_rule", "timestamp", "on_freeze", "timestamp_class", "name", "id_class_root", "id_group", "id_group_root", "id_object_carrier", "desc", "id_class_prop_object_carrier", "id_pos_temp_prop", "mc", "is_inside") VALUES (51253, 1015, 461, 1, 461, 84, 2020000512530, 14, '2021-11-14 08:40:31.381', false, '2021-02-19 11:01:28.402', 'NFC метка самоклеющаяся', 1013, 138, 138, -1, '', -1, -1, 1, false);


--
С уважением, Дмитрий!

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: insert column monetary type ver 2
Следующее
От: Дмитрий Иванов
Дата:
Сообщение: Re: insert column monetary type ver 2