pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Дмитрий Иванов <firstdismay@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: pg_dump insert column GENERATED
Date: Mon, 22 Nov 2021 09:55:44 -0500
Message-ID: <3698208.1637592944@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPL5KHo6m8evMZHzrK5QZ3Ct9v2EKOAC8q7OW3-a03TLwntG8A@mail.gmail.com>
References: <CAPL5KHrkBniyQt5e1rafm5DdXvbgiiqfEQEJ9GjtVzN71Jj5pA@mail.gmail.com>
	<d0d559a9-f5f8-dcb6-673c-edeb64f6cf65@aklaver.com>
	<CAPL5KHqj6Tixp5vc4gye7SG6czfSu1ctLVPRd+-sXE0DAN5tYQ@mail.gmail.com>
	<2ea33714-149f-f614-4cdb-012f252d57c0@aklaver.com>
	<CAPL5KHqpj+MZKS6hC-i0T3DynTEJf00J4oPFgKw+KSO9axz9jg@mail.gmail.com>
	<a3ba4919-107b-1ec9-64e4-fb1f77bd2163@aklaver.com>
	<CAPL5KHqxyp2Rd+NQVYVVNd_4xz9jdtYM+JJK3-ys9dQ5j=W7Pg@mail.gmail.com>
	<a978d4ee-905a-1321-f103-d055f08dfbea@aklaver.com>
	<CAPL5KHobYgdgLj0E0ppUp1Y7MDf9QQX2V+hb7uxKM6E-TWKJsQ@mail.gmail.com>
	<3443243.1637511849@sss.pgh.pa.us>
	<CAPL5KHo6m8evMZHzrK5QZ3Ct9v2EKOAC8q7OW3-a03TLwntG8A@mail.gmail.com>

=?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= <firstdismay@gmail.com> writes:
> Uchet=# select attname, attgenerated from pg_attribute
> Uchet-# where attrelid = 'bpd.object'::regclass and attnum > 0;
>             attname            | attgenerated
> -------------------------------+--------------
>  id                            |
>  id_class                      |
>  id_position                   |
>  ........pg.dropped.4........  |
>  ........pg.dropped.5........  |
>  ........pg.dropped.6........  |
>  bquantity                     |
>  ........pg.dropped.8........  |
>  ........pg.dropped.9........  |
>  id_position_root              |
>  id_conception                 |
>  barcode_unit                  |
>  id_unit_conversion_rule       |
>  ........pg.dropped.14........ |
>  timestamp                     |
>  on_freeze                     |
>  timestamp_class               |
>  name                          |
>  id_class_root                 |
>  id_group                      |
>  id_group_root                 |
>  id_object_carrier             |
>  desc                          |
>  ........pg.dropped.24........ |
>  ........pg.dropped.25........ |
>  ........pg.dropped.26........ |
>  id_class_prop_object_carrier  |
>  id_pos_temp_prop              |
>  ........pg.dropped.29........ |
>  mc                            |
>  is_inside                     | s

Hah ... that gave me the clue I needed.  If there are dropped
column(s) before the GENERATED one, pg_dump gets it wrong ---
but only in --inserts mode, not the default COPY mode, which
no doubt explains why nobody noticed.  There is code in there
to inject DEFAULT, but it must be indexing the flag array wrong.

Will fix, thanks for the report!

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <3698208.1637592944@sss.pgh.pa.us>
Permalink:  ../3698208.1637592944@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3698208.1637592944@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, firstdismay@gmail.com, adrian.klaver@aklaver.com
  Subject: Re: pg_dump insert column GENERATED
  In-Reply-To: <3698208.1637592944@sss.pgh.pa.us>
  References: <CAPL5KHrkBniyQt5e1rafm5DdXvbgiiqfEQEJ9GjtVzN71Jj5pA@mail.gmail.com> <d0d559a9-f5f8-dcb6-673c-edeb64f6cf65@aklaver.com> <CAPL5KHqj6Tixp5vc4gye7SG6czfSu1ctLVPRd+-sXE0DAN5tYQ@mail.gmail.com> <2ea33714-149f-f614-4cdb-012f252d57c0@aklaver.com> <CAPL5KHqpj+MZKS6hC-i0T3DynTEJf00J4oPFgKw+KSO9axz9jg@mail.gmail.com> <a3ba4919-107b-1ec9-64e4-fb1f77bd2163@aklaver.com> <CAPL5KHqxyp2Rd+NQVYVVNd_4xz9jdtYM+JJK3-ys9dQ5j=W7Pg@mail.gmail.com> <a978d4ee-905a-1321-f103-d055f08dfbea@aklaver.com> <CAPL5KHobYgdgLj0E0ppUp1Y7MDf9QQX2V+hb7uxKM6E-TWKJsQ@mail.gmail.com> <3443243.1637511849@sss.pgh.pa.us> <CAPL5KHo6m8evMZHzrK5QZ3Ct9v2EKOAC8q7OW3-a03TLwntG8A@mail.gmail.com> <3698208.1637592944@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox