PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹11. 䘵嚘媆誕嬉誕

11.5. 嫇婔䘵嚘

䘵嚘誻埇傖䫘庯嚺誆庖枕昄唚䔇嫇婔攓潡蔙滇崔婻庖枕䂇劽唚䔇嫇婔攓㔗

CREATE UNIQUE INDEX name ON table (column [, ...]);

䕞嬉埻橬 B-tree 䘵嚘埇傖弄滯婺嫇婔㔗

套悩䘵嚘弄滯婺嫇婔䔇闼幽儌婉噕螩庺䯄崔婻䘵嚘唚䕩劯䔇臯㔗NULL 唚赆螴婺庐婉䕩京㔗婔婻崔庖枕嫇婔䘵嚘螴婺埻橬婴臯昄扞麯欔橬赆䘵嚘庖枕鄘䕩劯欉滇䕩劯䔇認䓉昄扞欉赆拐䂺㔗

套悩婔婻臘弄滯庖嫇婔亥溘潡蔙婂髞闼幽 PostgreSQL 躻媘婘䂇潊婂髞潡嫇婔亥溘䔇庖枕婪录傺嫇婔䘵嚘(埇脘滇崔庖枕䘵嚘)傖嚺誆認底亥溘㔗

㔊濘懟㔏䂍臘嵂媹嫇婔亥溘懫膄喘䔇媂濘滇 ALTER TABLE ... ADD CONSTRAINT 㔗䫘䘵嚘嚺彽嫇婔亥溘庫臖螴婺滇婔婻垂䯄䂖誗蔯婉庫臖䕘毖螪閞㔗婉誺潏傸庫臖䘖長澇橬媙襕婘嫇婔庖枕婪傺䆋䘵嚘闼湙啔埻嚔麉崉傺䆋躻媘录傺䔇䘵嚘㔗


劯锔饡釕嬉誕
䂇劽崔婻䘵嚘婪婔亓臘膆嚟婪䔇䘵嚘