Search
 
SCRIPT & CODE EXAMPLE
 

SQL

psql list rules

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 ;
Comment

psql list view rules

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 
Comment

PREVIOUS NEXT
Code Example
Sql :: bulk kill mysql processlist 
Sql :: how to get non distinct values in sql 
Sql :: install mysqldump ubuntu 
Sql :: import database in phpmyadmin command line 
Sql :: postgres extract number from string 
Sql :: sql server find all foreign keys that reference a column 
Sql :: mysql count newlines in field 
Sql :: mysql get yesterday 
Sql :: drop column if exists sql server 
Sql :: oracle next run dates 
Sql :: oracle delete last row 
Sql :: oracle list invalid password ORA-01017 
Sql :: sqlite show columns in table 
Sql :: mysql date between two dates 
Sql :: create a table with an id in mysql 
Sql :: mysql where in array 
Sql :: Mysql Workbench takes very long time to execute the first query 
Sql :: oracle get trigger ddl 
Sql :: set password mysql 
Sql :: mysql column start with string 
Sql :: postgres show current role 
Sql :: xampp mysql database server is not starting mac m1 
Sql :: install mysql 8 ubuntu 18.04 
Sql :: create another table from existing table sql oracle 
Sql :: sql last week 
Sql :: drop table sql 
Sql :: psql import backup file for windows 
Sql :: postgres format date in select 
Sql :: sql drop database statement 
Sql :: postgres first_value in gropby 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =