Ensure django database wrappers always have a connection before creating a cursor
Compare changes
@@ -51,7 +51,13 @@ def run_pg_query(query, source_db):
Only used during ocrpus export. The .using()
calls work properly.
I guess the low-level code expect that DB to be used at least once before calling the .cursor()