diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-02-03 18:59:12 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-02-03 18:59:12 -0300 |
commit | beefab6540deca589c2d9a1d0f91fd98f11d303a (patch) | |
tree | 87119cad05f5b545bc4c5f88a132f7a6bcebb8b8 | |
parent | ea7857dddb54c371f70be7215ea3b72cb70265bf (diff) | |
download | postgresql-beefab6540deca589c2d9a1d0f91fd98f11d303a.tar.gz postgresql-beefab6540deca589c2d9a1d0f91fd98f11d303a.zip |
Add missing break out seqscan loop in logical replication
When replica identity is FULL (an admittedly unusual case), the loop
that searches for tuples in execReplication.c didn't stop scanning the
table when once a matching tuple was found. Add the missing 'break'.
Note slight behavior change: we now return the first matching tuple
rather than the last one. They are supposed to be indistinguishable
anyway, so this shouldn't matter.
Author: Konstantin Knizhnik
Discussion: https://postgr.es/m/379743f6-ae91-b866-f7a2-5624e6d2b0a4@postgrespro.ru
-rw-r--r-- | src/backend/executor/execReplication.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index bef40b30c9e..f18c9a82a9e 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -320,6 +320,9 @@ retry: XactLockTableWait(xwait, NULL, NULL, XLTW_None); goto retry; } + + /* Found our tuple and it's not locked */ + break; } /* Found tuple, try to lock it in the lockmode. */ |