摘要: 1、B-tree索引 create index idx_contacts_name on contacts(name); 2、数组索引 create index idx_contacts_phone on contacts using gin(phone); 注:phone在contacts表中是一 阅读全文
posted @ 2016-03-10 23:45 xiaofoyuan 阅读(726) 评论(0) 推荐(0) 编辑
摘要: 一、创建视图 create or replace view vw_users as select * from users; 二、通过定义规则来更新视图 create rule vw_users_upd as on update to vw_users do instead update users 阅读全文
posted @ 2016-03-10 23:15 xiaofoyuan 阅读(1863) 评论(0) 推荐(0) 编辑
摘要: 一、创建事件触发器 1、ddl_command_start - 一个DDL开始执行前被触发; 2、ddl_command_end - 一个DLL 执行完成后被触发; 3、sql_drop -- 删除一个数据库对象前被触发; create or replace function abort_any_c 阅读全文
posted @ 2016-03-10 22:33 xiaofoyuan 阅读(6148) 评论(0) 推荐(0) 编辑