From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Steven Chang <stevenchang1213@gmail.com>
Cc: Timokhin Maxim <ncx2@yandex.com>
Cc: Melvin Davidson <melvin6925@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: duplicate key value violates unique constraint and duplicated records
Date: Sat, 1 Jul 2017 07:05:57 -0700
Message-ID: <e5672fa0-4b46-6a02-3831-d5ff5be1de9a@aklaver.com> (raw)
In-Reply-To: <CAEJt7k3a2h806pjngLtifSfPgaJEjkMRvtC0irFYaz1JQ1BFJw@mail.gmail.com>
References: <2150831498728539@web17j.yandex.ru>
<CANu8FixqiMCwF6s7Qp8_3KwJEhS3yz+6QLtfXRR=jTPRfbNcqQ@mail.gmail.com>
<2597491498823912@web6g.yandex.ru>
<f413d42a-018d-4adb-68d6-845ab5a711f1@aklaver.com>
<3188141498833222@web8j.yandex.ru>
<43d3cc17-676f-59a6-8cbe-a46b2b3f2cc3@aklaver.com>
<CAEJt7k3a2h806pjngLtifSfPgaJEjkMRvtC0irFYaz1JQ1BFJw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>
On 06/30/2017 09:42 PM, Steven Chang wrote:
> Uh...we also met duplicate rows with primary key column through
> restoring database by pg_basebackup.
> HAAAA.........................
> I don't think its an issue with primary key index corruption.
That is interesting, more information would be helpful though:
Postgres version?
OS and version?
The pg_basebackup command line invocation?
Why you don't think it is index corruption?
>
>
>
> 2017-07-01 7:30 GMT+08:00 Adrian Klaver <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>>:
>
> 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
> <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 <mailto:adrian.klaver@aklaver.com>
>
>
--
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
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: adrian.klaver@aklaver.com, stevenchang1213@gmail.com, ncx2@yandex.com, melvin6925@gmail.com
Subject: Re: duplicate key value violates unique constraint and duplicated records
In-Reply-To: <e5672fa0-4b46-6a02-3831-d5ff5be1de9a@aklaver.com>
References: <2150831498728539@web17j.yandex.ru> <CANu8FixqiMCwF6s7Qp8_3KwJEhS3yz+6QLtfXRR=jTPRfbNcqQ@mail.gmail.com> <2597491498823912@web6g.yandex.ru> <f413d42a-018d-4adb-68d6-845ab5a711f1@aklaver.com> <3188141498833222@web8j.yandex.ru> <43d3cc17-676f-59a6-8cbe-a46b2b3f2cc3@aklaver.com> <CAEJt7k3a2h806pjngLtifSfPgaJEjkMRvtC0irFYaz1JQ1BFJw@mail.gmail.com> <e5672fa0-4b46-6a02-3831-d5ff5be1de9a@aklaver.com>
* 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