如何在postgresql中声明异常?

时间:2016-10-19 07:50:19

标签: postgresql

Oracle

DECLARE 
  Child_rec_exception EXCEPTION; 
  PRAGMA 
   EXCEPTION_INIT (Child_rec_exception, -2292); 
BEGIN 
  Delete FROM product where product_id= 104; 
EXCEPTION 
   WHEN Child_rec_exception 
   THEN Dbms_output.put_line('Child records are present for this product_id.'); 
END;    

PostgreSQL中的等价物是什么?

0 个答案:

没有答案