diff --git a/defog/generate_schema.py b/defog/generate_schema.py index b540c07..eacec8d 100644 --- a/defog/generate_schema.py +++ b/defog/generate_schema.py @@ -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,