pythonpostgresql
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pythonpostgresql [2021/11/29 22:10] – z0hpvk | pythonpostgresql [2025/03/08 22:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 81: | Line 81: | ||
| import conndetails as creds | import conndetails as creds | ||
| - | conn_string = " | + | conn_string = " |
| - | +" user=" + creds.PGUSER +" password=" | + | + creds.PGUSER +" password=" |
| conn = psycopg2.connect(conn_string) | conn = psycopg2.connect(conn_string) | ||
| + | |||
| + | cur = conn.cursor() | ||
| + | query = " | ||
| + | cur.execute(query) | ||
| + | for row in cur: | ||
| + | print(row) | ||
| + | |||
| + | cur.close() | ||
| </ | </ | ||
pythonpostgresql.1638223814.txt.gz · Last modified: (external edit)
