can anyone point me to a good source regarding Python scripting using Vertica connection?


  • Python scripting in Vertica goes through PyODBC. (Though there are a variety of user-developed packages out there that connect it with other tools.) If you're new to PyODBC, you can look through our documentation, specifically the Python section of the Programmer's Guide:'s%20Guide.pdf If you're already familiar with PyODBC, the best short quick-start guide I've found is actually on Vertica's unofficial user forums (hi vertica-forums!): One performance tip: As you may know, Vertica is really optimized for serving a smallish number of connections running a small number of large, expensive queries. Python tools ported directly from other databases sometimes open lots and lots of short-lived connections to run zillions of short queries by default. This will work, but if you can modify or configure them to do bigger single queries and to re-use connections, you'll find that they work much better.
  • Thank you very much, Adam! These are indeed very helpful and I'll read them. I'm almost new to both, Python and Vertica. I've managed to successfully run a very short script on my local Mac but when I run it on a Linux machine, I get the following error. Everything on both machines (odbc.ini, Python version, Python libraries, etc.) seems identical and I don't understand why I'm getting the error. I tested the odbc on the Linux machine via isql and I was able to connect. Any thoughts? File "", line 12, in cnxn = get_connection(DSN) File "build/bdist.linux-x86_64/egg/pyvertica/", line 37, in get_connection TypeError: no connection information was passed
  • Hm... It looks like you're using PyVertica, which is a third-party library that wraps PyODBC (and does a few things on top of it). Could you try connecting using PyODBC directly, per the docs above? That will help narrow things down.
  • good call... ok, I'll use just PyODBC. will get back here to update :)
  • good call... ok, I'll use just PyODBC. will get back here to update :)
  • seems to be working, thank you :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file