Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-22 Thread Thomas Kellerer
Adrian Klaver schrieb am 22.07.2020 um 16:42: Or is this a copy/paste issue? That.

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-22 Thread Adrian Klaver
On 7/21/20 10:36 PM, Thomas Kellerer wrote: Adrian Klaver schrieb am 21.07.2020 um 17:07: No, as mentioned, those are varchar(20) columns. The values are generated by the application (no default value defined for the column) Aah I see my mistake I was going off your follow up question not the

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-22 Thread Thomas Kellerer
Thomas Kellerer schrieb am 13.07.2020 um 11:52: > If I create the publication with all needed tables (about 50) at > once, I get "duplicate key value violates unique constraint xxx_pkey" > errors during the initial replication (when creating the > subscription). Turns out the problem was - once ag

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-21 Thread Thomas Kellerer
Adrian Klaver schrieb am 21.07.2020 um 17:07: >> No, as mentioned, those are varchar(20) columns. >> The values are generated by the application (no default value defined for >> the column) > > Aah I see my mistake I was going off your follow up question not the > original post. In that original p

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-21 Thread Adrian Klaver
On 7/20/20 10:42 PM, Thomas Kellerer wrote: Adrian Klaver schrieb am 20.07.2020 um 16:45: On 7/20/20 7:22 AM, Thomas Kellerer wrote: I have a strange error when using logical replication between a 11.2 Where is "xxx_pkey" coming from, e.g. sequence? No, as mentioned, those are varchar(2

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-21 Thread Thomas Kellerer
Tom Lane schrieb am 21.07.2020 um 09:39: > In any case, we do offer as standard advice that you should reproduce > a problem on the latest minor release before filing a bug report. I know ;) I already told the "powers to be" and it's being addressed (I also went through the 11.x release notes, bu

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-21 Thread Tom Lane
Thomas Kellerer writes: > Tom Lane schrieb am 20.07.2020 um 20:04: >> Yeah, duplicate keys does seem odd here. Can you provide a self >> contained example? > I'll try, but this is a production system. > Extracting the necessary anonymous data will be tricky. If this is a PG bug, it should be po

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Thomas Kellerer
John Ashmead schrieb am 20.07.2020 um 20:11: > I have had this problem with logical replication on PG 10 repeatedly. > In a clean build no problem. > > But if I am restarting replication because of some problem I’ve seen > problems with rows already present. > > My own fix, which has worked in my s

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Thomas Kellerer
Tom Lane schrieb am 20.07.2020 um 20:04: > Adrian Klaver writes: >> I'm probably missing something, but would that not result in a 'key not >> found' type of error. The OP is seeing "duplicate key value violates >> unique constraint xxx_pkey". To me that indicates a doubling up of at >> least some

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Thomas Kellerer
Adrian Klaver schrieb am 20.07.2020 um 16:45: > On 7/20/20 7:22 AM, Thomas Kellerer wrote: >>> I have a strange error when using logical replication between a 11.2 >>> source database and a 12.3 target. >>> >>> If I create the publication with all needed tables (about 50) at >>> once, I get "duplic

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread John Ashmead
I have had this problem with logical replication on PG 10 repeatedly. In a clean build no problem. But if I am restarting replication because of some problem I’ve seen problems with rows already present. My own fix, which has worked in my shop, is to add replica triggers to check for the row b

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Tom Lane
Adrian Klaver writes: > I'm probably missing something, but would that not result in a 'key not > found' type of error. The OP is seeing "duplicate key value violates > unique constraint xxx_pkey". To me that indicates a doubling up of at > least some of the data replication. [ squint... ] So

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Adrian Klaver
On 7/20/20 10:47 AM, Tom Lane wrote: Thomas Kellerer writes: I have a strange error when using logical replication between a 11.2 source database and a 12.3 target. If I create the publication with all needed tables (about 50) at once, I get "duplicate key value violates unique constraint xxx_

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Tom Lane
Thomas Kellerer writes: >> I have a strange error when using logical replication between a 11.2 >> source database and a 12.3 target. >> >> If I create the publication with all needed tables (about 50) at >> once, I get "duplicate key value violates unique constraint xxx_pkey" >> errors during th

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Adrian Klaver
On 7/20/20 7:22 AM, Thomas Kellerer wrote: I have a strange error when using logical replication between a 11.2 source database and a 12.3 target. If I create the publication with all needed tables (about 50) at once, I get "duplicate key value violates unique constraint xxx_pkey" errors during

Re: Logical replication from 11.x to 12.x and "unique key violations"

2020-07-20 Thread Thomas Kellerer
> I have a strange error when using logical replication between a 11.2 > source database and a 12.3 target. > > If I create the publication with all needed tables (about 50) at > once, I get "duplicate key value violates unique constraint xxx_pkey" > errors during the initial replication (when crea

Logical replication from 11.x to 12.x and "unique key violations"

2020-07-13 Thread Thomas Kellerer
Hello, I have a strange error when using logical replication between a 11.2 (I know!) source database and a 12.3 target. If I create the publication with all needed tables (about 50) at once, I get "duplicate key value violates unique constraint xxx_pkey" errors during the initial replication