数据库 数据校验写入等逻辑更新。
This commit is contained in:
17
tmp/list_all_tables.py
Normal file
17
tmp/list_all_tables.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import psycopg2
|
||||
|
||||
dsn = 'postgresql://local-Python:Neo-local-1991125@100.64.0.4:5432/LLZQ-test'
|
||||
conn = psycopg2.connect(dsn)
|
||||
cur = conn.cursor()
|
||||
cur.execute("""
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'billiards_dwd'
|
||||
ORDER BY table_name
|
||||
""")
|
||||
tables = [row[0] for row in cur.fetchall()]
|
||||
print('Tables in billiards_dwd:')
|
||||
for t in tables:
|
||||
print(t)
|
||||
print(f'\nTotal: {len(tables)} tables')
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user