public
Description: PostgreSQL interfaces library. Driver, protocol tools, and command interfaces for Python 3
Home | Edit | New

Why Should I Care?

With the proliferation of PostgreSQL DB-API driver implementations, the question “Why?” comes up.
Here’s why you should care:

  • Prepared statements.
  • Composite type support and arrays of composite types.
  • Real string objects from character data(unicode in 2.x).
  • Transparent bytea support(just use bytes objects with parameterized statements).
  • Extended exception information including the query that ultimately caused the database error and on what connection.
  • Fast, structured, data loading interface. (clocked at ~7000 tuples/sec on a laptop; chances are, indexes will bottleneck it).
  • Natural COPY support. Works like regular cursors.
  • Transaction management/Savepoint Management interfaces (think “with db.xact(): …”).
  • Settings interface (db.settings[“search_path”] = ‘path1,path2’).
  • Scrollable cursor support. Backwards fetches via read(i<0) and a seek() interface.
  • On-demand data streaming. postgresql.driver will never fetch the entire result set unless you explicitly request it.
  • Cluster management tools and unittest support for building a full test suite for your application.
  • DB-API 2.0 for those that want it.
  • Numerous test cases for validating existing functionality.
  • Significant amounts of documentation accessible on the web and within an installation.
  • pg_python quick console gives you quick access to a connection object for testing or even for simple scripts. ( $ pg_python -h localhost -U myuser and you have a Python console with a connection on the “db” object.).
  • Row objects supporting a mapping and a sequence interface. No need for “dictfetch”. Ever. And yes, composite types are “Row objects” as well, so you get the same benefit there.
  • BSD Licensed code that uses relative imports everywhere so you can simply include it in your package and it will “just work”.

Certainly, “why you should care” comes down to the features and the available support. py-postgresql is dedicated to providing high-level features that all users will want to take advantage of.

Last edited by jwp, Wed Sep 09 18:00:06 -0700 2009
Home | Edit | New
Versions: