- 通过pg_typeof
//基础示例
SELECT pg_typeof(id) FROM t_basic_config LIMIT 1;//多表join
SELECT pg_typeof(a.id),pg_typeof(b.user_password) FROM t_basic_config a
left join t_basic_admin b
on a.id=b.id LIMIT 1;
- 通过explain解析查询的所有字段和表,然后再去字段表里查询对应的定义
//解析select
EXPLAIN (VERBOSE, FORMAT JSON)
SELECT *
FROM t_basic_config a
left join t_basic_admin b
on a.id=b.id//查询字段类型SELECTcolumn_name,data_type
FROMinformation_schema.columns
WHEREtable_name = 't_basic_config';