Can I add a UNIQUE constraint to a PostgreSQL table, after it's already created?

前端 未结 4 836
Happy的楠姐
Happy的楠姐 2020-12-23 00:02

I have the following table:

 tickername | tickerbbname  | tickertype
------------+---------------+------------
 USDZAR     | USDZAR Curncy | C
 EURCZK     |          


        
4条回答
  •  礼貌的吻别
    2020-12-23 00:48

    Yes, you can add a UNIQUE constraint after the fact. However, if you have non-unique entries in your table Postgres will complain about it until you correct them.

提交回复
热议问题