https://www.psycopg.org/docs/usage.html#thread-and-process-safety