PostgreSQL is an actively developed and mature open source database. Using the
psycopg2 module, we can execute queries on the database.
Installation using pip
pip install psycopg2
Lets assume we have a table
my_table in the database
my_database defined as follows.
We can use the
psycopg2 module to run queries on the database in the following fashion.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0