Python操作postgres数据库
程序员文章站
2022-03-07 22:40:19
...
import psycopg2
conn = psycopg2.connect(database="postgres", user="postgres", password="123456", host="1.1.1.1",
port="5432")
cur = conn.cursor()
sql = "CREATE TABLE table_name_2020_08_24 () inherits (table_name)"
cur.execute(sql)
# 提交数据
conn.commit()
# #关闭数据库
cur.close()
上一篇: 使用Jquery动态切换select选项(解决切换失效问题)
下一篇: ipset黑白名单设置