Re: pg_dump insert column GENERATED
Дмитрий Иванов <firstdismay@gmail.com>
From: Дмитрий Иванов <firstdismay@gmail.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Date: 2021-11-20T18:33:37Z
Lists: pgsql-general
I don't know. sudo /usr/lib/postgresql/14/bin/pg_dump --file "/home/dismay/uchet/Uchet.backup" --host "server" --port "5999" --username "back" --no-password --verbose --format=c --quote-all-identifiers --blobs --column-inserts --inserts --create --disable-triggers --encoding="UTF8" "Uchet" I used the pg_dump version of the receiving server, but the pg_dump of the source server initially gave almost the same result, a COPY error of the empty table PostgreSQL 12.9, compiled by Visual C++ build 1914, 64-bit to 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 сб, 20 нояб. 2021 г. в 22:00, Adrian Klaver <adrian.klaver@aklaver.com>: > On 11/20/21 04:27, Дмитрий Иванов wrote: > > 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? > > Actually I think it should be DEFAULT. > > What is your pg_dump version? > > It shouldn't unless you are specifying --inserts. > > What is the full pg_dump command you are using? > > What are the errors? > > > > > 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); > > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com >
Commits
-
Fix pg_dump --inserts mode for generated columns with dropped columns.
- aedc4600d84d 14.2 landed
- 6fc8b145e743 13.6 landed
- 1e7f588ad625 12.10 landed
- 0b126c6a4b00 15.0 landed