From 9cfb7066f73db0f804ffe4079ac496f4b307619e Mon Sep 17 00:00:00 2001 From: lijingeng <33362111+lijingeng@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:30:29 +0800 Subject: [PATCH] Create pgsql.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一个库中不同模式下有相同表名的表,获取表描述的时候,所有字段都会列出来。要加上模式过滤,仅显示当前模式的表结构。 --- sql/engines/pgsql.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/engines/pgsql.py b/sql/engines/pgsql.py index 79270bbb20..27ef8272e8 100644 --- a/sql/engines/pgsql.py +++ b/sql/engines/pgsql.py @@ -119,6 +119,7 @@ def describe_table(self, db_name, tb_name, **kwargs): col.table_name::regclass = des.objoid and col.ordinal_position = des.objsubid where table_name = '{tb_name}' + and col.table_schema = '{schema_name}' order by ordinal_position;""" result = self.query(db_name=db_name, schema_name=schema_name, sql=sql) return result