Unverified Commit d8964f76 authored by javaht's avatar javaht Committed by GitHub

[Fix][metadata] Fix postgres schema error (#1751)

* fix postgres schema error * fix postgres schema
parent d61c197f
......@@ -52,13 +52,15 @@ public class PostgreSqlQuery extends AbstractDBQuery {
return "SELECT col.column_name as name\n"
+ " , col.character_maximum_length as length\n"
+ " , col.is_nullable as is_nullableis_nullable\n"
+ " , col.is_nullable as is_nullable\n"
+ " , col.numeric_precision as numeric_precision\n"
+ " , col.numeric_scale as numeric_scale\n"
+ " , col.ordinal_position as ordinal_position\n"
+ " , col.udt_name as type\n"
+ " , (CASE\n"
+ " WHEN (SELECT COUNT(*) FROM pg_constraint AS PC WHERE b.attnum = PC.conkey[1] AND PC.contype = 'p') > 0\n"
+ " WHEN (SELECT COUNT(*) FROM pg_constraint AS PC WHERE b.attnum = PC.conkey[1] AND PC.contype = 'p' and PC.conname like concat('"
+ tableName
+ "','_%')) > 0\n"
+ " THEN 'PRI'\n"
+ " ELSE '' END) AS key\n"
+ " , col_description(c.oid, col.ordinal_position) AS comment\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment