import psycopg2
def create_new_table(table_id):
conn = psycopg2.connect(database='Test', user='postgres', password='123456', host='127.0.0.1', port='5432')
cur = conn.cursor()
print('aaaaa')
cur.execute('''CREATE TABLE DataFile%s
(nid INT PRIMARY KEY NOT NULL,
create_time DATE NOT NULL,
message_head TEXT,
message_body_data bytea,
message_body_param TEXT);''' % table_id)
print("Table created successfully")
conn.commit()
conn.close()
手机扫一扫
移动阅读更方便
你可能感兴趣的文章