Good afternoon.
Why does pg_dump generate an insertion script in the generated columns?
This causes insertion errors.
PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
is_inside - column should be excluded how to do it?

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, is_inside, mc) 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,
false, 1);

Table:
CREATE TABLE IF NOT EXISTS bpd.object
(
    id bigint NOT NULL DEFAULT
nextval('bpd.object_general_id_seq'::regclass),
    id_class bigint NOT NULL,
    id_position bigint NOT NULL DEFAULT '-1'::integer,
    bquantity numeric NOT NULL,
    id_position_root bigint NOT NULL,
    id_conception bigint NOT NULL,
    barcode_unit bigint NOT NULL DEFAULT 0,
    id_unit_conversion_rule integer NOT NULL,
    "timestamp" timestamp without time zone NOT NULL DEFAULT LOCALTIMESTAMP,
    on_freeze boolean NOT NULL DEFAULT false,
    timestamp_class timestamp without time zone NOT NULL DEFAULT
LOCALTIMESTAMP(3),
    name character varying(255) COLLATE pg_catalog."default" NOT NULL,
    id_class_root bigint NOT NULL,
    id_group bigint NOT NULL,
    id_group_root bigint NOT NULL,
    id_object_carrier bigint NOT NULL DEFAULT '-1'::integer,
    "desc" character varying(2044) COLLATE pg_catalog."default" NOT NULL
DEFAULT 'н/д'::character varying,
    id_class_prop_object_carrier bigint NOT NULL DEFAULT '-1'::integer,
    id_pos_temp_prop bigint NOT NULL DEFAULT '-1'::integer,
    is_inside boolean GENERATED ALWAYS AS (((id_object_carrier > 0) OR
(id_pos_temp_prop > 0))) STORED,
    mc numeric NOT NULL DEFAULT 0,
    CONSTRAINT object_pkey PRIMARY KEY (id),
    CONSTRAINT unique_id_object_id_object_prop UNIQUE (id,
id_class_prop_object_carrier),
    CONSTRAINT lnk_class_snapshot_object FOREIGN KEY (id_class,
timestamp_class)
        REFERENCES bpd.class_snapshot (id, "timestamp") MATCH FULL
        ON UPDATE CASCADE
        ON DELETE CASCADE,
    CONSTRAINT lnk_conception_object FOREIGN KEY (id_conception)
        REFERENCES bpd.conception (id) MATCH FULL
        ON UPDATE CASCADE
        ON DELETE CASCADE,
    CONSTRAINT lnk_position_object FOREIGN KEY (id_position)
        REFERENCES bpd."position" (id) MATCH FULL
        ON UPDATE CASCADE
        ON DELETE CASCADE,
    CONSTRAINT check_self_integration CHECK (id <> id_object_carrier)
)

Reply via email to