在准备环境前提交次全部更改。

This commit is contained in:
Neo
2026-02-19 08:35:13 +08:00
parent ded6dfb9d8
commit 4eac07da47
1387 changed files with 6107191 additions and 33002 deletions

View File

@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
"""验证四个数据库的状态表数量、schema 分布"""
import psycopg2
CONN = dict(host="100.64.0.4", port=5432, user="local-Python", password="Neo-local-1991125")
DBS = ["etl_feiqiu", "test_etl_feiqiu", "zqyy_app", "test_zqyy_app"]
for db in DBS:
try:
c = psycopg2.connect(**CONN, dbname=db)
cur = c.cursor()
cur.execute(
"SELECT schemaname, count(*) FROM pg_tables "
"WHERE schemaname NOT IN ('pg_catalog','information_schema') "
"GROUP BY schemaname ORDER BY schemaname"
)
rows = cur.fetchall()
total = sum(r[1] for r in rows)
schemas = ", ".join(f"{r[0]}({r[1]})" for r in rows)
print(f"[OK] {db}: {total} tables | {schemas}")
# 物化视图数量
cur.execute(
"SELECT count(*) FROM pg_matviews "
"WHERE schemaname NOT IN ('pg_catalog','information_schema')"
)
mv_count = cur.fetchone()[0]
if mv_count:
print(f" matviews: {mv_count}")
c.close()
except Exception as e:
print(f"[FAIL] {db}: {e}")
print("\n--- 配置文件指向 ---")
print("ETL .env PG_DSN -> test_etl_feiqiu (已确认)")
print("根 .env -> PG_NAME=test_etl_feiqiu, APP_DB_NAME=test_zqyy_app")
print("后端 .env.local -> APP_DB_NAME=test_zqyy_app, ETL_DB_NAME=test_etl_feiqiu")
print("后端 config.py 默认值 -> test_zqyy_app / test_etl_feiqiu")
print("FDW 生产 -> setup_fdw.sql (etl_feiqiu)")
print("FDW 测试 -> setup_fdw_test.sql (test_etl_feiqiu)")