2011年8月16日 星期二

找出Postgresql 中Primary key的欄位

select c.* 
from information_schema.constraint_column_usage as c, information_schema.table_constraints as t 
where c.constraint_name = t.constraint_name and t.constraint_type = 'PRIMARY KEY';