-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realtime: randomly receiving payload with missing column #223
Comments
Thansk for the detailed bug report! I'll move this one over to the realtime server |
@xylish7 Thanks for writing this up! This isn't a bug but a limitation. Postgres uses the TOAST technique to store large values. As a result, Postgres replication doesn't include those columns with large values when they have not been updated which means Realtime RLS is unable to pass them on to the client. The easiest solution is to set the ALTER TABLE events REPLICA IDENTITY FULL; |
@xylish7 and just to clarify by enabling the You can always go with your solution:
|
Thank you for your fast response and sorry for taking me so long to answer back. Did not knew about that TOAST technique. However is still weird that even if I update that pending array for fast consecutive updates there are times when the pending column is missing in the payload. I will give it a try with |
Bug report
Describe the bug
I've enabled realtime on one of my tables and randomly I get payloads which are missing one column. In my case, the column which sometimes is not present in the payload is the pending one, which is of type jsonb. The bug also appears only when the pending column has a lot of data in it. Another thing is that the bug popped up when I've sent a lot of requests one after another.
In this case the pending column was in the payload:
After quick updates in the database, at one moment, I've received the payload without the pending column:
The way I'm updating the row is using a rpc function:
I've seen that running the function without modifying the pending column will result always in a payload which does not have the pending column in it, so this is the reason I've added/modified line 12, 37, 47 and 54. Updating the pending column like this seems to reduce the chance of truncated payload.
To Reproduce
Expected behavior
The payload should always have all columns present in it.
System information
The text was updated successfully, but these errors were encountered: