Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||
|---|---|---|---|---|---|---|---|---|---|---|
| event_id | bigserial | 19 | √ | nextval('lizsync.logged_actions_event_id_seq'::regclass) | 
                                         | 
                                    
                                         | 
                                    Unique identifier for each auditable event  | 
                                |||
| schema_name | text | 2147483647 | null | 
                                         | 
                                    
                                         | 
                                    Database schema audited table for this event is in  | 
                                ||||
| table_name | text | 2147483647 | null | 
                                         | 
                                    
                                         | 
                                    Non-schema-qualified table name of table event occured in  | 
                                ||||
| relid | oid | 10 | null | 
                                         | 
                                    
                                         | 
                                    Table OID. Changes with drop/create. Get with ‘tablename’::regclass  | 
                                ||||
| session_user_name | text | 2147483647 | √ | null | 
                                         | 
                                    
                                         | 
                                    Login / session user whose statement caused the audited event  | 
                                |||
| action_tstamp_tx | timestamptz | 35,6 | null | 
                                         | 
                                    
                                         | 
                                    Transaction start timestamp for tx in which audited event occurred  | 
                                ||||
| action_tstamp_stm | timestamptz | 35,6 | null | 
                                         | 
                                    
                                         | 
                                    Statement start timestamp for tx in which audited event occurred  | 
                                ||||
| action_tstamp_clk | timestamptz | 35,6 | null | 
                                         | 
                                    
                                         | 
                                    Wall clock time at which audited event’s trigger call occurred  | 
                                ||||
| transaction_id | int8 | 19 | √ | null | 
                                         | 
                                    
                                        
  | 
                                    Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx.  | 
                                |||
| application_name | text | 2147483647 | √ | null | 
                                         | 
                                    
                                         | 
                                    Application name set when this audit event occurred. Can be changed in-session by client.  | 
                                |||
| client_addr | inet | 2147483647 | √ | null | 
                                         | 
                                    
                                         | 
                                    IP address of client that issued query. Null for unix domain socket.  | 
                                |||
| client_port | int4 | 10 | √ | null | 
                                         | 
                                    
                                         | 
                                    Remote peer IP port address of client that issued query. Undefined for unix socket.  | 
                                |||
| client_query | text | 2147483647 | null | 
                                         | 
                                    
                                         | 
                                    Top-level query that caused this auditable event. May be more than one statement.  | 
                                ||||
| action | text | 2147483647 | null | 
                                         | 
                                    
                                         | 
                                    Action type; I = insert, D = delete, U = update, T = truncate  | 
                                ||||
| row_data | hstore | 2147483647 | √ | null | 
                                         | 
                                    
                                         | 
                                    Record value. Null for statement-level trigger. For INSERT this is the new tuple. For DELETE and UPDATE it is the old tuple.  | 
                                |||
| changed_fields | hstore | 2147483647 | √ | null | 
                                         | 
                                    
                                         | 
                                    New values of fields changed by UPDATE. Null except for row-level UPDATE events.  | 
                                |||
| statement_only | bool | 1 | null | 
                                         | 
                                    
                                         | 
                                    ‘t’ if audit event is from an FOR EACH STATEMENT trigger, ‘f’ for FOR EACH ROW  | 
                                ||||
| sync_data | jsonb | 2147483647 | null | 
                                         | 
                                    
                                         | 
                                    Data used by the sync tool. origin = db name of the change, replayed_by = list of db name where the audit item has already been replayed, sync_id=id of the synchronisation item  | 
                                
Indexes
| Constraint Name | Type | Sort | Column(s) | 
|---|---|---|---|
| logged_actions_pkey | Primary key | Asc | event_id | 
| logged_actions_action_idx | Performance | Asc | action | 
| logged_actions_action_tstamp_tx_stm_idx | Performance | Asc | action_tstamp_stm | 
| logged_actions_relid_idx | Performance | Asc | relid | 
Check Constraints
| Constraint Name | Constraint | 
|---|---|
| logged_actions_action_check | ((action = ANY (ARRAY['I'::text, 'D'::text, 'U'::text, 'T'::text]))) | 

