conn = psycopg2.connect(database="ewt_cache", user="postgres", password="Bd22earth", options="-c search_path=dbo,public", host='localhost', port="5432") print('open successful') cur = conn.cursor() cur.execute('''CREATE TABLE testt(80c INT);''') conn.commit()请把这段代码改为创建一个名叫esn_80c的表,表中只有一个列名叫80c存储integer类型的数据
时间: 2024-04-26 16:21:29 浏览: 153
psycopg2-2.8.2.tar_psycopg2_python_
conn = psycopg2.connect(database="ewt_cache", user="postgres", password="Bd22earth", options="-c search_path=dbo,public", host='localhost', port="5432")
print('open successful')
cur = conn.cursor()
cur.execute('''CREATE TABLE esn_80c(80c INTEGER);''')
conn.commit()
这样就创建了一个名叫esn_80c的表,表中只有一个列名叫80c存储integer类型的数据。
阅读全文