notebookVb

This commit is contained in:
administrator
2026-05-24 06:55:47 +02:00
parent c0aa4fb684
commit d62b1a801c
12 changed files with 655 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import psycopg2
conn = psycopg2.connect(host="192.168.1.76", port=5432, user="vladimir.buzalka",
password="Vlado7309208104++", database="fotky_buzalkovi")
cur = conn.cursor()
cur.execute("SELECT table_name FROM information_schema.tables WHERE table_schema='public' ORDER BY table_name")
print("Tabulky:")
for r in cur.fetchall():
print(f" {r[0]}")
cur.execute("SELECT indexname FROM pg_indexes WHERE schemaname='public' ORDER BY indexname")
print("Indexy:")
for r in cur.fetchall():
print(f" {r[0]}")
cur.execute("""
SELECT column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_schema='public' AND table_name='zdrojove_soubory'
ORDER BY ordinal_position
""")
print("\nSloupce zdrojove_soubory:")
for r in cur.fetchall():
print(f" {r[0]:20s} {r[1]:20s} nullable={r[2]}")
conn.close()