用过才敢说 一键生成论文工具 千笔 VS Checkjie 更贴合MBA需求

核心内容摘要

YDFID-1:纺织品缺陷检测的高精度图像数据集解决方案
摆脱论文困扰!断层领先的AI论文平台 —— 千笔AI

AI人脸隐私卫士简单使用:WebUI界面,三步完成人脸保护

文章目录环境文档用途详细信息环境系统平台Linux x

Red Hat Enterprise Linux 7版本

4.

2文档用途使用事件触发器审计表的alter table操作详细信息如果你要记录表被用户执行DDL修改定义, 设置默认值, 等等alter table可以完成的工作时的记录, 可以使用事件触发器来达到这个目的.例子如下 :# create or replace function ef_alter() returns event_trigger as $$declarerec hstore;beginselecthstore(pg_stat_activity.*)intorecfrompg_stat_activitywherepidpg_backend_pid();insertintoaud_alter(ctx)values(rec);end;$$languageplpgsql strict;CREATEFUNCTIONtestdb# create event trigger e_alter on ddl_command_end when tag in (ALTER TABLE) execute procedure ef_alter();CREATEEVENTTRIGGERtestdb# create table aud_alter(id serial primary key, crt_time timestamp default now(), ctx hstore);CREATETABLEtestdb# create table test(id int);CREATETABLEtestdb# alter table test alter column id type int8;ALTERTABLEtestdb# select * from aud_alter;-[RECORD1]------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------id|1crt_time|

:44:

1

309983ctx|pid9408,datid16384,queryalter table test alter column id type int8;,stateactive,datnametestdb,usenamepostgres,waitingf,usesysid10,xact_start

13:44:

1

30998308,backend_xid8367,client_addrNULL,client_port-1,query_start

13:44:

1

30998308,backend_xmin8367,state_change

13:44:

1

30998508,backend_start

13:40:

1

056108,client_hostnameNULL,application_namepsqltestdb# select each(ctx) from aud_alter where id1;each-------------------------------------------------------(pid,

(datid,

(query,alter table test alter column id type int8;)(state,active)(datname,testdb)(usename,postgres)(waiting,f)(usesysid,

(xact_start,

13:44:

12.

(backend_xid,

(client_addr,)(client_port,-

(query_start,

13:44:

12.

(backend_xmin,

(state_change,

13:44:

12.

(backend_start,

13:40:

15.

(client_hostname,)(application_name,psql)(18rows)query即当时的ALTER TABLE SQL.其他辅助的还有用户当时的IP, PORT, 用户, 链接的数据库等信息。

如果只想跟踪表的字段被修改的前后类型, 更严格的做法应该是从parsetree中取出被修改的字段, 类型。

六间房免费安装-六间房免费安装应用

百度百家号客服电话人工服务

123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123