Re: pg_dump insert column GENERATED

From: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump insert column GENERATED
Date: 2021-11-20 18:25:11
Message-ID: CAPL5KHoCqd3=Z5CmygTTkQmk6G8oG-y1Tunq93N4eu2hMzQXKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ok, I see.
This is actually an interesting question. I don't understand which approach
to use. I am using pd_dump and pg_restore of the receiving server. It might
make sense to use pg_dump source, pg_restore sink

сб, 20 нояб. 2021 г. в 22:33, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
> > On 11/20/21 04:27, Дмитрий Иванов wrote:
> >> Why does pg_dump generate an insertion script in the generated columns?
>
> > Actually I think it should be DEFAULT.
>
> It should be, and it is when I try this example. I get output like
>
> --
> -- Data for Name: object; Type: TABLE DATA; Schema: bpd; Owner: postgres
> --
>
> 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,
> DEFAULT, 1);
>
> I wonder what version of pg_dump is actually being used there.
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Дмитрий Иванов 2021-11-20 18:33:37 Re: pg_dump insert column GENERATED
Previous Message Tom Lane 2021-11-20 17:33:04 Re: pg_dump insert column GENERATED