I’m trying to import a climate dataset (contains geometry) to my local cockroachdb (postgis extension is installed) through the sqlalchemy-cockroachdb adapter (v1.4.3). I have a file server running using:
python -m http.server 3003 -d /path/to/file
and I’m using the following engine:
engine = create_engine(f"{DIALECT}://{USER}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}")
print(engine.__repr__())
'Engine(cockroachdb://postgres:***@localhost:26257/climate)'
user postgres has admin rights on the climate database. I then run the following snippet:
with Session(engine) as e:
job = e.execute("import pgdump('http://localhost:3003/climate.sql') with ignore_unsupported_statements, DETACHED")
job_id = job.fetchone()[0]
print(job_id)
job_status = e.execute(f"with jobs as (show jobs) select job_id, status from jobs where job_id = {job_id};")
print(job_status.fetchall())
sleep(1)
print(job_status.fetchall())
790071968723927041
[(790071968723927041, 'running')]
[]
While in the first query to the db after creating the job it returns a status for my job, after the program sleeps for one second, there seems to be no trace of the job. It does not fail nor finish. No errors are thrown.
Executing the import statement from the command line using
cockroach sql -e "import pgdump('http://localhost:3003/climate.sql') with ignore_unsupported_statements, DETACHED" -d climate --user postgres --insecure
does actually work and successfully imports the data to my local db.
Does anyone have any idea whats going on? why is the import job initially created but disappears after only one second w/o throwing errors. thanks