Python and PostgreSQL
examples/python/postgresql_connect.py
with psycopg2.connect( host = host, user = user, password = pw, dbname = dbname, ) as conn: cursor = conn.cursor() sql_all = """ SELECT * FROM people """ cursor.execute(sql_all) for d in cursor.fetchall(): pass
Published on 2018-12-18
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post