1

I successfully created a series of queries using PostgreSQL's great extension pgRouting. Now I'm trying to set up a python script to run the whole process from python. I connected to the PostgreSQL database using sqlalchemy library. All queries are working well except pgr_nodeNetwork and pgr_createTopology which are pgRouting functions. When I run the python script, it successfully finishes and gives all messages, exactly the same as PostgreSQL does. pgr_nodeNetwork should create a new table but it's not created. Is there any different way to make these two functions work?

Update: I noted that in pgAdmin dashboard for this transaction state is "idle in transaction"

  • 2
    I solved the issue by adding the "commit;" query. Seems it isn't needed when you call it from pgAdmin but from sqlalchemy needs to be committed. – HumanoVirtual May 04 '22 at 01:52
  • 1
    GENIUS! I've almost lost all hope of automating a pipeline with the need to run pgr_createTopology for the network, but then found this answer. Thank you kindly! – seizethedata Mar 20 '23 at 18:01

0 Answers0