Python/PostgreSQL Interface Architecture

If you are writing a Python application that interfaces with PostgreSQL you can choose from a number of different APIs, most of which are compatible with the Python DB-API specification. DB-API is a three-layer interface that lets you build Python applications that can, at least in theory, interact with many different databases. The top layer (the layer that your application deals with) is a database-neutral interface that hides all of the nasty details of writing database-dependent code. The middle layer is an interface that converts requests and responses between DB-API form and the form required by the database. The bottom layer is the database itself (in this case, PostgreSQL). The three most commonly ...

Get PostgreSQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.