Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1db85y-0007mE-H2 for pgsql-general@arkaria.postgresql.org; Fri, 28 Jul 2017 16:26:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1db85y-0006Xl-3g for pgsql-general@arkaria.postgresql.org; Fri, 28 Jul 2017 16:26:34 +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 1db6Lq-0006JV-9b for pgsql-general@postgresql.org; Fri, 28 Jul 2017 14:34:50 +0000 Received: from forward2o.cmail.yandex.net ([37.9.109.243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1db6Lm-0001aW-9D for pgsql-general@postgresql.org; Fri, 28 Jul 2017 14:34:49 +0000 Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward2o.cmail.yandex.net (Yandex) with ESMTP id 2617020E7C; Fri, 28 Jul 2017 17:34:44 +0300 (MSK) Received: from web21j.yandex.ru (web21j.yandex.ru [5.45.198.62]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id KfBo1ACYvh-YhReq5JD; Fri, 28 Jul 2017 17:34:43 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1501252483; bh=Ma+uisxup8KJrguLA5x2xcIO2vh8KoAnOriH1TqiFtY=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date; b=euq+PGqYdGbAkh49vEBPwRE0alvw+InED86fY+8I369Uq0ilfEJJ+IZpDWQ2zVIc2 J93jSiApl7c0EVGOG/MvGDECTMozNU6hY28i/ZWoX+aNNngckifVgYcKq4mHqbnVg1 OBpIQGDROHsfkoJLGZaDnW5kDKDZ7LFzVC1VJYtQ= Authentication-Results: mxback11j.mail.yandex.net; dkim=pass header.i=@yandex.com Received: by web21j.yandex.ru with HTTP; Fri, 28 Jul 2017 17:34:43 +0300 From: Timokhin Maxim Envelope-From: ncx2@yandex.ru To: "pgsql-general@postgresql.org" Cc: Melvin Davidson , Adrian Klaver , "stevenchang1213@gmail.com" In-Reply-To: <3188141498833222@web8j.yandex.ru> References: <2150831498728539@web17j.yandex.ru> <2597491498823912@web6g.yandex.ru> <3188141498833222@web8j.yandex.ru> Subject: Re: duplicate key value violates unique constraint and duplicated records MIME-Version: 1.0 Message-Id: <4535691501252483@web21j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 28 Jul 2017 17:34:43 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 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 Hello, everybody. I solved the problem. The index has been corrupted after replication despite it was appeared as not corrupted. It was solved by recreating the index. Thank you for the help. -- Пожалуйста! Используйте кнопку "ответить всем". Не удаляйте историю переписки. Спасибо. С уважением, Timokhin 'maf' Maxim 30.06.2017, 17:33, "Timokhin Maxim" : > 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 > > after that server starts normally. > > -- > Timokhin 'maf' Maxim > > 30.06.2017, 16:07, "Adrian Klaver" : >>  On 06/30/2017 04:58 AM, Timokhin Maxim wrote: >>>   BTW, we are moving using: >>> >>>   pg_basebackup -h servername -R -P -D /data/upgrade/94 -U pgsql -v —xlog-method=stream —checkpoint=fast >> >>  Going from 9.4 to 9.6 is a major version upgrade and you cannot use >>  pg_basebackup for that. Besides I can't see how you even got the 9.6.3 >>  server to start: >> >>  /usr/local/pgsql94/bin/pg_basebackup -D /home/aklaver/pgback_test94 -U >>  postgres -p 5412 -v --xlog-method=stream >> >>  /usr/local/pgsql96/bin/pg_ctl -D /home/aklaver/pgback_test94/ start >>  server starting >>  FATAL: database files are incompatible with server >>  DETAIL: The data directory was initialized by PostgreSQL version 9.4, >>  which is not compatible with this version 9.6.3 >> >>>   After that we are upping version to 9.6.3. >> >>  Given the above how did you actually get 9.6.3 to start? >> >>>   I've looked through the documentation https://postgrespro.ru/docs/postgrespro/9.6/app-pgbasebackup and didn't find details about how pg_basebackup works with b-tree indexes. >>>   Is it possible that pg_basebackup just copies indexes as is and that is cause of corruption. Or it pass indexes as instruction that says "after upping db make indexes" ? >>> >>>   Thank you. >>> >>>   -- >>>   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