Skip to content

Commit

Permalink
fixed issue with extracting columns for tables with schema names pre-…
Browse files Browse the repository at this point in the history
…prended
  • Loading branch information
rishsriv committed May 9, 2024
1 parent 491a7ca commit 11206c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defog/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def generate_postgres_schema(
# get the columns for each table
for schema in schemas:
for table_name in tables:
if "." in table_name:
_, table_name = table_name.split(".", 1)
cur.execute(
"SELECT CAST(column_name AS TEXT), CAST(data_type AS TEXT) FROM information_schema.columns WHERE table_name::text = %s AND table_schema = %s;",
(
Expand Down

0 comments on commit 11206c5

Please sign in to comment.