📜  psql 列表规则 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:35.131000             🧑  作者: Mango

代码示例1
select n.nspname as rule_schema, 
       c.relname as rule_table, 
       case r.ev_type  
         when '1' then 'SELECT' 
         when '2' then 'UPDATE' 
         when '3' then 'INSERT' 
         when '4' then 'DELETE' 
         else 'UNKNOWN' 
       end as rule_event
from pg_rewrite r  
  join pg_class c on r.ev_class = c.oid 
  left join pg_namespace n on n.oid = c.relnamespace 
  left join pg_description d on r.oid = d.objoid ;