Databases
python code for interacting with db
Recipes
psycopg2
Installation
pip install psycopg2
Establishing connection
import psycopg2 try: connection = psycopg2.connect(DATABASE_URL) cursor = connection.cursor()
except (Exception, psycopg2.Error) as error : print ("Error while connecting to PostgreSQL", error) finally:
​```
```
Last updated