Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpBvL-0007vZ-IN for pgsql-general@arkaria.postgresql.org; Mon, 22 Nov 2021 16:12:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mpBvK-0005Aw-BJ for pgsql-general@arkaria.postgresql.org; Mon, 22 Nov 2021 16:12:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpBvJ-0005Am-8d for pgsql-general@lists.postgresql.org; Mon, 22 Nov 2021 16:12:06 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpBv7-00083D-VV for pgsql-general@lists.postgresql.org; Mon, 22 Nov 2021 16:12:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8BF005C013C; Mon, 22 Nov 2021 11:11:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 22 Nov 2021 11:11:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=b 0BDPPA4zhO4xXFgWI9dNyEXngAtGaPcbEz76KL7L+I=; b=IspUHqmPLSYCHo91A RPYeRdFajztp1yuUQcHrJggH0a2JhV/JwF34i1twJBhYMrJklJuD/8yTGb3UIUTi 8tP+q/yf7y8QYTBn7ZvN94MJ76rSETfy+SHSwbD04ujc+NrnWuBabtgHmjsF7rwY dJhrN4vxr8JW+0w/Uw3TOz081F6scdvmxNyoWDX1aZ8i/odgnx1WUd9IPyfiN4Pc 0tbIJLRX1H15yijBtLR14XTUtSnEPd38X4pQoZHe8NuECzBaoCe/HL6KxxkhauaP qq2G5PvK5jCb/sZovr7RSevgdChdVKxJY8f9JZZzN1iY+NrUCvQ7f0bY3H/OfBAw cKeqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=b0BDPPA4zhO4xXFgWI9dNyEXngAtGaPcbEz76KL7L +I=; b=S0UkOhh0fDJ6PCqKJstAPTsE6HUKtbky4ffy1f1HYrU0QWn+kAZNDPge6 fhBo0WQsnlQOsHJL0rIyx9LiAyJdvllg1uC2IKHy1ewHAv26loNYa+5B5rXMTmVB SqzpofZt/3qit3WituTNk7yOIro4KIR2b1latkKvuTDLccndC4sv+VdtfMjHS7bm prKigm9msZLvmbd8wF+JeSqAR93TrS76HvoKguemP8jCUczTo2IXut6KsYqShMRw ZrjkWbQOj++Pam6/37eMoXxnJ9YdFsodreCS7MFgLsSEPClKxFO7RQlyTySZ5Vp4 e/GajgcGt5/4gcsCWnRmpcX3Lq7dw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeeggdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpedugfeuleegve ffhfegleejhefhtedtgeeileeggfehfefffeevgeejtdeutefftdenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Nov 2021 11:11:51 -0500 (EST) Message-ID: <098e52bc-31d0-a4e8-adcb-0f039f771308@aklaver.com> Date: Mon, 22 Nov 2021 08:11:51 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: pg_dump insert column GENERATED Content-Language: en-US To: =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= Cc: pgsql-general References: <2ea33714-149f-f614-4cdb-012f252d57c0@aklaver.com> <15ee1aef-6b36-dc58-a610-b0f665ac652a@aklaver.com> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/22/21 03:32, Дмитрий Иванов wrote: > Got it. > > > >You are going need to provide more information about the above: > >1) Define regular results. > >2) The query used. > >3) The outcome vs what you expected. > > I will continue to experiment. The question is which option is better > (this would reduce the number of options): > pd_dump is the source server; > pg_restore - receiver server; > or > pd_dump - receiver server; > pg_restore - server-receiver; pg_dump is backwards compatible not forwards. In the explanations below Postgres versioning(major/minor) is determined as: Pre-version 10: X.x.x 10+: X.x Where X is major and x is minor. This means if are moving forwards in Postgres major version then: 1) Use pg_dump from newer version of Postgres to dump from older version of Postgres. In your case pg_dump(v14) dump Postgres server v12. 2) To restore use the version of pg_restore for the Postgres version you are restoring to. In your case pg_restore(v14). Staying on the same version: 1) Use the pg_dump/pg_restore for the version your are on. 2) If you are moving from one minor release to another then it would be better to use the latest minor release version to get any bug fixes. Going backwards from newer version to older version: This is not supported. -- Adrian Klaver adrian.klaver@aklaver.com