开发者

Can I get types from an arbitrary query in Postrges?

I've got a situation building a data analysis tool where my users can write SQL query (including joins, calculations, etc) and I need to be provide options to the user based on the data types of the columns in the result. I'm us开发者_如何学Going JDBC to connect to Postgres. Is there any way to get Postgres to report the data type of a computed column?


With JDBC, you should be able to call .getMetaData() in your ResultSet, and iterate through the columns and e.g. learn their types with .getColumnType()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜