Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Dec 9, 2024
1 parent 815b8d5 commit eba77e9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions defog/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,18 @@ def generate_postgres_schema(
else:
schema = "public"
cur.execute(
"""SELECT
CAST(column_name AS TEXT),
CAST(data_type AS TEXT),
col_descripton(format('%s.%s', table_schema, table_name)::regclass::oid, ordinal_position) AS column_description
FROM information_schema.columns WHERE table_name::text = %s AND table_schema = %s;""",
"""
SELECT
CAST(column_name AS TEXT),
CAST(data_type AS TEXT),
col_description(
FORMAT('%%s.%%s', table_schema, table_name)::regclass::oid,
ordinal_position
) AS column_description
FROM information_schema.columns
WHERE table_name::text = %s
AND table_schema = %s;
""",
(
table_name,
schema,
Expand Down

0 comments on commit eba77e9

Please sign in to comment.