Drop sequence and cascade

前端 未结 4 1442
粉色の甜心
粉色の甜心 2021-02-05 05:43

I would like to drop the sequence used in table and the table itself in one statement using CASCADE, but I\'m getting NOTICE and table is not dropped. For example:



        
4条回答
  •  抹茶落季
    2021-02-05 06:09

    I don't know why are you creating a sequence manually - maybe you have justification, or maybe it's due to habits working with another DBMS.

    But if you don't have a special need for it, use the SERIAL pseudo-type and when you drop the table the sequence(s) behind the SERIAL column(s) will be dropped too.

提交回复
热议问题