如何从postgres表中获取特定字段的数据类型?
例如
我有下面的表,
student_details(
stu_id整数,
stu_name varchar(30),
joined_date时间戳
);
@H_301_11@例如
我有下面的表,
student_details(
stu_id整数,
stu_name varchar(30),
joined_date时间戳
);
在这使用字段名称/或任何其他方式,我需要获得特定字段的数据类型。有什么可能吗?
在这使用字段名称/或任何其他方式,我需要获得特定字段的数据类型。有什么可能吗?
=# select column_name,data_type from information_schema.columns -# where table_name = 'config'; column_name | data_type --------------------+----------- id | integer default_printer_id | integer master_host_enable | boolean (3 rows)