You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on which is used, the behavior can be different when used inside a transaction, which might be unexpected. I ran into this while testing something and it surprised me until I looked at the code.
Here is an example showing what I'm talking about:
Inside a transaction, send a message to the queue. You can't pop the message, but you can read it.
I don't think there's a reason that they are different other than the project starter using now() and we changed some of the functions as we were updating the codebase. We should be able to update pop() and set_vt() too.
Most of the time, pgmq uses
clock_timestamp()
when setting or comparingvt
. This is the case for the following functions:But these functions use
now()
:Is there a reason for the difference?
Depending on which is used, the behavior can be different when used inside a transaction, which might be unexpected. I ran into this while testing something and it surprised me until I looked at the code.
Here is an example showing what I'm talking about:
Inside a transaction, send a message to the queue. You can't pop the message, but you can read it.
If there isn't a reason for them to be different, I think pop and set_vt should use
clock_timestamp()
, to be consistent with the other functions.The text was updated successfully, but these errors were encountered: