471,873 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

After period of time records are not being picked from postgres table

This query expected to update 1 row at a time and after processing we move the same row to next queue and query picks and update next row in infinite loop.

Update queue_table set lock_flag = 150 Where row (entity, sub_entity, side) = (select entity, sub_entity, side from queue_table where lock_flag = 0 and entity = 'Abc' limit 1 for update skip locked ) and entity = 'Abc' and lock_flag = 0;

This happens perfectly for some time and issues happens after couple of hours, not sure whether due to row lock, caching, connection leakage etc.
Jul 1 '21 #1
0 1725

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Bill | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.