Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dR5PQ-0003Ad-2C for pgsql-general@arkaria.postgresql.org; Fri, 30 Jun 2017 23:33:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dR5PO-0006Ov-UU for pgsql-general@arkaria.postgresql.org; Fri, 30 Jun 2017 23:33:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dR5N1-00023L-52 for pgsql-general@postgresql.org; Fri, 30 Jun 2017 23:30:39 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dR5Mx-0000in-EI for pgsql-general@postgresql.org; Fri, 30 Jun 2017 23:30:38 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F162121A22; Fri, 30 Jun 2017 19:30:33 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Fri, 30 Jun 2017 19:30:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=jRyXJYY2/dTipV7koO xHrX/Q/kVLSuwQy86A4FTlNm4=; b=sxQm9WR6AK5kb5QPUQf6RlcIAcptG2TdXf rvKpvBmPf5HhecyJ0BYxW4GJFwb2Dm9eEOxnhCMAGK77BKiqd1Z64CYNL1Xmz35m +as8LWN3Jb5HMh5UYx9mpbrNl9cp+uj/tiTlP0zKvOfjdpE7nW2PSkpgWCwzCAe7 URZRwRocr/1/RzDot+GM+g6JM2KSIgtuwM1hwNMwAOlUdzavW5Ok8KtR5ns+Nro4 r4CbJ2aRvk1EX+jV6+5avXoQO+pkD5ajEpOPl9oFmj4jIcivtpPNWuOqiw5A53Dx uzqwsOvhg98CcBBr4ioxvgE9xAKNtgvmcw7n36msSa2ZMYY2odJw== 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-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=jRyXJYY2/dTipV7koOxHrX/Q/kVLSuwQy86A4FTlNm4=; b=VDKyHGrg YCZIi/eW5pzZJv+VyQUm9EnG4mQvv/HHHZddkUNqShfshV28GsirsVVlKnU6Cu0j lICVXjAquBanDmtHVrdYnEG2mlx1R2TJh3EaJabvKsLr/pliVZ2XkTYpIBn2/SYo rJZ9XqSbhVLC4pXVL9CEoISqPnwxFLeA5Log/LqsZHPl+NYftK5dPDXjreUnLUR9 NE4Hgj+4Ecs4x4Iz8MHiMc849L7VBUsV0Bi0u4oD0+wW8wRItjJ29hcT2cg+Tn10 6eEAwwQrHLMnuvAJtGVDpPnkky2Vnsuv4MoxIvlTJKucfOcwTdZp4iiX1S9KZLcB qUFEcb9TwoRtVw== X-ME-Sender: X-Sasl-enc: ejIlPBV9MV8WCYvQF1LIob4NGtQIMs7UyQ4azkXKv+UT 1498865433 Received: from [192.168.1.2] (75-165-115-124.tukw.qwest.net [75.165.115.124]) by mail.messagingengine.com (Postfix) with ESMTPA id 46CD724785; Fri, 30 Jun 2017 19:30:33 -0400 (EDT) Subject: Re: duplicate key value violates unique constraint and duplicated records To: Timokhin Maxim , Melvin Davidson , "stevenchang1213@gmail.com" Cc: "pgsql-general@postgresql.org" References: <2150831498728539@web17j.yandex.ru> <2597491498823912@web6g.yandex.ru> <3188141498833222@web8j.yandex.ru> From: Adrian Klaver Message-ID: <43d3cc17-676f-59a6-8cbe-a46b2b3f2cc3@aklaver.com> Date: Fri, 30 Jun 2017 16:30:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <3188141498833222@web8j.yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 06/30/2017 07:33 AM, Timokhin Maxim wrote: > Sure, here it is. > > pg_basebackup -h servername -R -P -D /data/upgrade/94 -U pgsql -v —xlog-method=stream —checkpoint=fast > > /usr/pgsql-9.5/bin/initdb -D /data/upgrade/95/ —encoding=utf8 —locale=ru_RU.utf8 —lc-collate=ru_RU.utf8 —lc-ctype=ru_RU.utf8 —lc-messages=en_US.utf8 > > Then updating: > /usr/pgsql-9.5/bin/pg_upgrade -b /usr/pgsql-9.4/bin/ -d /data/upgrade/94 -B /usr/pgsql-9.5/bin/ -D /data/upgrade/95 -k > > and so on to 9.6 The original 9.4 database has the same encoding setup? FYI, you can use pg_upgrade to go straight from 9.4 to 9.6. https://www.postgresql.org/docs/9.6/static/pgupgrade.html "pg_upgrade supports upgrades from 8.4.X and later to the current major release of PostgreSQL, including snapshot and alpha releases." > > after that server starts normally. > > > -- > Timokhin 'maf' Maxim > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general