在一个存储过程,参数传入表名,然后把表的每一行数据,各字段拼成一个字符串,再计算它的md5值;
不想在存储过程中把各字段写死,有没有办法根据表名,得到各字段名;这样可以传入任意表

postgresql 中如何确定表的各字段?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- oyljerry 2016-09-02 08:21关注
SELECT column_name ,data_type ,character_maximum_length ,numeric_precision ,numeric_scale FROM information_schema.columns WHERE table_schema = 'public' and table_name='USERS' GROUP BY column_name ,data_type ,character_maximum_length ,numeric_precision ,numeric_scale
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报