PostgreSQL 15.3 DocumentationThis approach can be thought of as auditing changes to a table. Example 43.4 shows an example of an audit trigger function in PL/pgSQL. Example 43.4. A PL/pgSQL Trigger Function for Auditing This example that any insert, update or delete of a row in the emp table is recorded (i.e., audited) in the emp_audit table. The current time and user name are stamped into the row, together with the type of operation TABLE emp ( empname text NOT NULL, salary integer ); CREATE TABLE emp_audit( operation char(1) NOT NULL, stamp timestamp NOT NULL, userid0 魔豆 | 3063 页 | 13.45 MB | 2 年前3
PostgreSQL 9.4.26 DocumentationThis approach can be thought of as auditing changes to a table. Example 40-4 shows an example of an audit trigger procedure in PL/pgSQL. Example 40-4. A PL/pgSQL Trigger Procedure For Auditing This example that any insert, update or delete of a row in the emp table is recorded (i.e., audited) in the emp_audit table. The current time and user name are stamped into the row, together with the type of operation CREATE TABLE emp_audit( operation char(1) NOT NULL, stamp timestamp NOT NULL, userid text NOT NULL, empname text NOT NULL, salary integer ); CREATE OR REPLACE FUNCTION process_emp_audit() RETURNS TRIGGER1 魔豆 | 2452 页 | 5.99 MB | 2 年前5
共 2 条
- 1










