Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- connection = psycopg2.connect(
- database="test",
- user="postgres",
- password="123",
- host="localhost",
- port=5432
- )
- try:
- cursor = connection.cursor()
- check = '''SELECT * FROM testid WHERE "Property_ID" = '54' '''
- cursor.execute(check)
- a = cursor.fetchall()
- print a
- except psycopg2.OperationalError:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement