From 8c6d96cbd0cc45d7031189fd259578104d43f9a5 Mon Sep 17 00:00:00 2001 From: aurae Date: Mon, 2 Sep 2024 17:50:47 +0800 Subject: [PATCH] fix: postgresql read schema_info with characters truncated if too long (#1935) Co-authored-by: lingbao --- dbgpt/datasource/rdbms/conn_postgresql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbgpt/datasource/rdbms/conn_postgresql.py b/dbgpt/datasource/rdbms/conn_postgresql.py index fb68fe09e..6579038b1 100644 --- a/dbgpt/datasource/rdbms/conn_postgresql.py +++ b/dbgpt/datasource/rdbms/conn_postgresql.py @@ -192,7 +192,10 @@ def table_simple_info(self): """ cursor = self.session.execute(text(_sql)) results = cursor.fetchall() - return results + results_str = [] + for result in results: + results_str.append((str(result[0]), str(result[1]))) + return results_str def get_fields_wit_schema(self, table_name, schema_name="public"): """Get column fields about specified table."""