pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Timokhin Maxim <ncx2@yandex.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: Melvin Davidson <melvin6925@gmail.com>
To: stevenchang1213@gmail.com <stevenchang1213@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: duplicate key value violates unique constraint and duplicated records
Date: Fri, 30 Jun 2017 17:33:42 +0300
Message-ID: <3188141498833222@web8j.yandex.ru> (raw)
In-Reply-To: <f413d42a-018d-4adb-68d6-845ab5a711f1@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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

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" <adrian.klaver@aklaver.com>:
> 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



view thread (42+ messages)  latest in thread

Message-ID: <3188141498833222@web8j.yandex.ru>
Permalink:  ../3188141498833222@web8j.yandex.ru/
Also on:    postgresql.org/message-id/3188141498833222@web8j.yandex.ru

 · 

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: ncx2@yandex.com, adrian.klaver@aklaver.com, melvin6925@gmail.com, stevenchang1213@gmail.com
  Subject: Re: duplicate key value violates unique constraint and duplicated records
  In-Reply-To: <3188141498833222@web8j.yandex.ru>
  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>

* 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