Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- conn = psycopg2.connect(
- host = "127.0.1.1",
- port = 26257,
- database="a",
- user="root",
- password="password")
- cur = conn.cursor()
- cur.execute("create table test (x int, y int)")
- cur.execute("INSERT INTO test (x, y) VALUES (100, 101)")
- cur.execute("SELECT * FROM test;")
- cur.fetchone()
- conn.commit()
- cur.close()
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement