2

I have a connection to PostgreSQL created in the Windows ODBC Data Source. I'm using pyodbc to connect to the PostgreSQL database like this:

conn = pyodbc.connect('DSN=PostgreSQL35W')

I'm now using SQLAlchemy and would like to connect to the database using a Windows DSN like I do with pyodbc. Is this possible? I need to use the Windows DSN.

Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
  • Is this [Connecting postgresql with sqlalchemy](https://stackoverflow.com/q/9353822/6194097) question help you? – Kushan Gunasekera Jul 16 '19 at 17:50
  • Possible duplicate of [Connecting postgresql with sqlalchemy](https://stackoverflow.com/questions/9353822/connecting-postgresql-with-sqlalchemy) – Patrick W Jul 16 '19 at 17:53
  • Based on your results I don't think SQLAlchemy supports using pyodbc to connect to PostgreSQL which means it won't support ODBC DSNs. – Uyghur Lives Matter Jul 16 '19 at 20:47
  • Also, please delete the two answers you posted that were in response to my answer. The feedback was welcome and they've served their purpose. Unfortunately this site does not have a good way to provide feedback to answers other than through comments which are limited. Stack Overflow has strict rules that answers should exclusively be answers and not replies. – Uyghur Lives Matter Jul 16 '19 at 21:46

0 Answers0