Initial commit - Stand 26.04.2026
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
import psycopg2
|
||||
|
||||
conn = psycopg2.connect(
|
||||
host="localhost",
|
||||
port=5432,
|
||||
database="buchhaltung",
|
||||
user="postgres",
|
||||
password="postgres"
|
||||
)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Pruefe Schema
|
||||
cursor.execute("SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'kredit_zahlungen'")
|
||||
columns = cursor.fetchall()
|
||||
print("Spalten in kredit_zahlungen:")
|
||||
for col in columns:
|
||||
print(f" {col[0]}: {col[1]}")
|
||||
|
||||
# Zeige einen Beispiel-Datensatz
|
||||
cursor.execute("SELECT * FROM kredit_zahlungen LIMIT 1")
|
||||
row = cursor.fetchone()
|
||||
print(f"\nBeispiel-Datensatz:")
|
||||
for i, col in enumerate(columns):
|
||||
if i < len(row):
|
||||
print(f" [{i}] {col[0]} = {row[i]} (Typ: {type(row[i])})")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user