Re: Corruption with duplicate primary key

2020-01-15 Thread Alex Adriaanse
On Thu., December 12, 2019 at 5:25 PM, Tomas Vondra wrote: >On Wed, Dec 11, 2019 at 11:46:40PM +, Alex Adriaanse wrote: >>On Thu., December 5, 2019 at 5:45 PM, Tomas Vondra wrote: >>> At first I thought maybe this might be due to collations changing and >>> breaking the index silently. What col

Re: Corruption with duplicate primary key

2019-12-12 Thread Tomas Vondra
On Wed, Dec 11, 2019 at 11:46:40PM +, Alex Adriaanse wrote: On Thu., December 5, 2019 at 5:45 PM, Tomas Vondra wrote: At first I thought maybe this might be due to collations changing and breaking the index silently. What collation are you using? We're using en_US.utf8. We did not make any

Re: Corruption with duplicate primary key

2019-12-11 Thread Alex Adriaanse
On Mon, December 9, 2019 at 11:05 AM Finnerty, Jim wrote: > If you have BEFORE triggers, and a BEFORE trigger signaled failure with > RETURN NULL, then this is one known (and documented) issue that I think could > cause the behavior you're reporting: >     > https://www.postgresql-archive.org/BE

Re: Corruption with duplicate primary key

2019-12-11 Thread Alex Adriaanse
On Thu., December 5, 2019 at 5:45 PM, Tomas Vondra wrote: > At first I thought maybe this might be due to collations > changing and breaking the index silently. What collation are you using? We're using en_US.utf8. We did not make any collation changes to my knowledge. > 1) When you do the querie

Re: Corruption with duplicate primary key

2019-12-11 Thread Alex Adriaanse
On Thu, December 5, 2019 at 5:34 PM Peter Geoghegan wrote: > > We have a Postgres 10 database that we recently upgraded to Postgres 12 > > using pg_upgrade. We recently discovered that there are rows in one of the > > tables that have duplicate primary keys: > > What's the timeline here? In othe

Re: Corruption with duplicate primary key

2019-12-09 Thread Finnerty, Jim
Re: " It appears that the second row was in place originally, then got updated by a trigger (and even deleted later on, although it doesn't appear that the delete transaction got committed), and then the first row was inserted within the same transaction that updated the second row." If you hav

Re: Corruption with duplicate primary key

2019-12-05 Thread Tomas Vondra
On Thu, Dec 05, 2019 at 09:14:12PM +, Alex Adriaanse wrote: We have a Postgres 10 database that we recently upgraded to Postgres 12 using pg_upgrade. We recently discovered that there are rows in one of the tables that have duplicate primary keys: record_loader=# \d loader.sync

Re: Corruption with duplicate primary key

2019-12-05 Thread Peter Geoghegan
On Thu, Dec 5, 2019 at 1:14 PM Alex Adriaanse wrote: > We have a Postgres 10 database that we recently upgraded to Postgres 12 using > pg_upgrade. We recently discovered that there are rows in one of the tables > that have duplicate primary keys: What's the timeline here? In other words, does i

Corruption with duplicate primary key

2019-12-05 Thread Alex Adriaanse
We have a Postgres 10 database that we recently upgraded to Postgres 12 using pg_upgrade. We recently discovered that there are rows in one of the tables that have duplicate primary keys: record_loader=# \d loader.sync Table "loader.sync" Column |