I recently ran into this error message while executing a query that called one of my PL/pgSQL functions:
ERROR: cannot assign XIDs during a parallel operation
CONTEXT: SQL statement [redacted]
PL/pgSQL function [redacted]
The function is marked PARALLEL SAFE
, and I assume this error is telling me that it should actually be marked PARALLEL RESTRICTED
or PARALLEL UNSAFE
. Given that I don't understand what in the code is parallel unsafe, does the above error give me any hint about what I'm doing wrong and what level of safety it requires?