Answer the question
In order to leave comments, you need to log in
What is the mistake of protso I want to display the content?
psycopg2.errors.UndefinedTable: ERROR: relation "orders" does not exist
LINE 1: SELECT * FROM Orders WHERE id = 1
table Orders is
here code just want to display content
import psycopg2
con = psycopg2.connect(
host='localhost',
database='Drive_in',
user='postgres',
password='42661902',
port=5432
)
cur = con.cursor()
cur.execute("SELECT * FROM Orders WHERE id = 1")
rows = cur.fetchall()
for i in rows:
print(f"id{i[0]}name{i[1]}")
cur.close()
con.close()
Answer the question
In order to leave comments, you need to log in
ERROR: relation "orders" does not exist
LINE 1: SELECT * FROM Orders WHERE id = 1
table Orders exists
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question