請問要如何知道某個欄位是不是primary key

16 views
Skip to first unread message

pch....@gmail.com

unread,
Jan 31, 2008, 2:19:04 AM1/31/08
to PostgreSQL 8 DBA 專業指南中文版
我用這個語法,好像得不到有關primary key的訊息,要怎樣才能知道呢?謝謝!
select * from information_schema.columns where table_name='tables'

Kuo.C...@gmail.com

unread,
Feb 1, 2008, 12:47:53 PM2/1/08
to PostgreSQL 8 DBA 專業指南中文版
您好~
請查看 information_schema 下列的二張 table 即有您要的資訊.
constraint_table_usage, constraint_column_usage
Reply all
Reply to author
Forward
0 new messages