There are several Python drivers for PostgreSQL. This is the incomplete feature matrix for them; please help complete it as you see fit.
In general, Python users want to use psycopg2 unless they have a strong reason to try another driver, most of which are no longer maintained. Since DBAPI allows drivers to have different semantics, porting applications from one driver to another is non-trivial.
|Software||License||Platforms||Python versions||DB API 2.0||Native (uses libpq)||Last Release||Notes|
|Psycopg2||LGPL||Unix, Win32||2.6-3.6||yes||yes||2019||Most popular python driver, required for most Python+Postgres frameworks|
|pg8000||BSD||any (pure Python)||3.3+||yes||no||2019||Used by Web2Py. current updated official site|
|py-postgresql||BSD||any (pure Python)||3.0+||yes||no||2018||Pure Python with optional C accelerator modules,<br>extensive custom API. Python 3 only.|
|PyGreSQL||BSD||Unix, Win32||2.6 thru 3.6||yes||yes||2017||The first PostgreSQL adapter for Python. Still actively maintained.|
|bpgsql||LGPL||any (pure Python)||2.3-2.6||yes||no||2009||labeled alpha|
PostgreSQL SUBSTRING function using Column: Sample Table: employees. If we want to display the employeeid, first name and 1st 4 characters of firstname for those employees who belong to the department which departmentid is below 50 from employees table, the following SQL can be executed. Summary: in this tutorial, you will learn how to create new tables in the PostgreSQL database using PHP PDO API. Creating new tables using PHP PDO steps. To create new tables in a PostgreSQL database using PHP PDO, you use the following steps: First, connect to the database by creating a new PDO object. Second, call the exec method of the PDO object to execute the CREATE TABLE statement. PHP will return values of PostgreSQL boolean datatype as single character strings 't' and 'f', not PHP true and false. Editor's Note 't' or 'f' is valid boolean expression for PostgreSQL. All values from PostgreSQL are strings, since PostgreSQL integer, float may be much larger than PHP's native int, double can handle.
Php Postgresql Tutorial
Php Postgresql Blob
More abandoned driver projects:
- pgasync, Twisted-native driver, no updates since 2005
- PoPy, no updates since 2003 - development was merged with pygresql
- pyPgSQL, no updates since 2006
There is similar page on the Python wiki