Re: [GENERAL] Broken primary key after backup restore.

2015-10-02 Thread Kevin Grittner
Michael Chau wrote: > For some reason, there were some bad wal log files in pg_xlog. I > believe that they got generated during the backup last Monday, > but I don't know why. I speculate that may be the > wal_keep_segments was not set high enough as I have changed it > recently. > > Luckily, I h

Re: [GENERAL] Broken primary key after backup restore.

2015-09-21 Thread Michael Chau
Hi, Just want to let everybody knows So, I found out this morning what went wrong. For some reason, there were some bad wal log files in pg_xlog. I believe that they got generated during the backup last Monday, but I don't know why. I speculate that may be the wal_keep_segments was not set high

Re: [GENERAL] Broken primary key after backup restore.

2015-09-18 Thread David Steele
On 9/18/15 3:44 PM, Michael Chau wrote: Hi Jeff, Only if you are very lucky. If your tar command tars up the pg_xlog directory as the last thing it does, then you are probably going to be OK. Otherwise, it is a crap shoot. May be that's it. I have another similar set up, but the pg_xlog i

Re: [GENERAL] Broken primary key after backup restore.

2015-09-18 Thread Michael Chau
Hi Jeff, >Only if you are very lucky. If your tar command tars up the pg_xlog directory as the last thing it does, then you are probably going to be OK. Otherwise, it is a crap shoot. May be that's it. I have another similar set up, but the pg_xlog is a soft link to another directory, and I use

Re: [GENERAL] Broken primary key after backup restore.

2015-09-18 Thread Jeff Janes
On Fri, Sep 18, 2015 at 6:16 AM, Adrian Klaver wrote: > On 09/17/2015 11:15 PM, Guillaume Lelarge wrote: > >> Le 18 sept. 2015 5:23 AM, "Adrian Klaver" > > a écrit : >> > >> > On 09/17/2015 05:37 PM, Michael Chau wrote: >> >> >> >> To restore on test server:

Re: [GENERAL] Broken primary key after backup restore.

2015-09-18 Thread Adrian Klaver
On 09/17/2015 11:15 PM, Guillaume Lelarge wrote: Le 18 sept. 2015 5:23 AM, "Adrian Klaver" mailto:adrian.kla...@aklaver.com>> a écrit : > > On 09/17/2015 05:37 PM, Michael Chau wrote: >> >> 1) >> >> In Production, I have a DB2 which is replicated partially using Londiste >> from DB

Re: [GENERAL] Broken primary key after backup restore.

2015-09-17 Thread Guillaume Lelarge
Le 18 sept. 2015 5:23 AM, "Adrian Klaver" a écrit : > > On 09/17/2015 05:37 PM, Michael Chau wrote: >> >> 1) >> >> In Production, I have a DB2 which is replicated partially using Londiste >> from DB1. >> >> >> Well I think the above needs more explanation to help understand how the >> DB2

Re: [GENERAL] Broken primary key after backup restore.

2015-09-17 Thread Adrian Klaver
On 09/17/2015 05:37 PM, Michael Chau wrote: 1) In Production, I have a DB2 which is replicated partially using Londiste from DB1. Well I think the above needs more explanation to help understand how the DB2 backup got into this state and possibly prevent it in the future. A: So, the D

Re: [GENERAL] Broken primary key after backup restore.

2015-09-17 Thread Michael Chau
1) > > In Production, I have a DB2 which is replicated partially using Londiste > from DB1. > Well I think the above needs more explanation to help understand how the DB2 backup got into this state and possibly prevent it in the future. A: So, the DB1 has several schemas in the database. We use L

Re: [GENERAL] Broken primary key after backup restore.

2015-09-17 Thread Adrian Klaver
On 09/17/2015 04:31 PM, Michael Chau wrote: Hi, In Production, I have a DB2 which is replicated partially using Londiste from DB1. Well I think the above needs more explanation to help understand how the DB2 backup got into this state and possibly prevent it in the future. I make file-syst

[GENERAL] Broken primary key after backup restore.

2015-09-17 Thread Michael Chau
Hi, In Production, I have a DB2 which is replicated partially using Londiste from DB1. I make file-system backups nightly on both DBs. Last Monday, when I restored the backup made from DB2 to a test server, Postgres(9.3.5) started up fine. But, I found out that the primary key of one of the table