On 2021-Jul-30, Amit Kapila wrote: > I was thinking of using toast pointer but that won't work because it > can be different on the subscriber-side. I don't see any better ideas > to fix this issue. This problem seems to be from the time Logical > Replication has been introduced, so adding others (who are generally > involved in this area) to see what they think about this bug? I think > people might not be using toasted columns for Replica Identity due to > which this problem has been reported yet but I feel this is quite a > fundamental issue and we should do something about this.
In the evening before going offline a week ago I was looking at this and my conclusion was that this was a legitimate problem: the original implementation is faulty in that the full detoasted value is required to be transmitted in order for downstream to be able to read the value. I am not sure if at the level of logical decoding it is a problem theoretically, but at least for logical replication it is clearly a practical problem. Reading Dilip's last posted patch that day, I had some reservations about the API of ExtractReplicaIdentity. The new argument makes for a very strange to explain behavior "return the key values if they are unchanged, *or* if they are toasted" ... ??? I tried to make sense of that, and tried to find a concept that would make sense to the whole, but couldn't find any obvious angle in the short time I looked at it. I haven't looked at it again. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte" (Ijon Tichy en Viajes, Stanislaw Lem)