pglogrepl
pglogrepl copied to clipboard
OldTuple in UpdateMessage is nil !
i copy and run logical exampe code , but after update , OldTuple print nil
case *pglogrepl.UpdateMessage:
log.Printf("%+v \n", logicalMsg.OldTuple)
print :
{baseMessage:{msgType:85} RelationID:33230 OldTupleType:0 OldTuple:<nil> NewTuple:0xc0000650e0}
works as intended.
@seyedmo30, You need to configure REPLICA IDENTITY for a table, to instruct PostgreSQL sending this data.
By default in OldTuple you will receive only primary key(s) and only if it was changed during update. Otherwise nil.
check this short explanation (promoting my project) and official docs.
if needed, example with index based replica identity.
@ubombi thanks a lot , it working