| pgq.logutriga() RETURNS TRIGGER AS |
Trigger function that puts row data in urlencoded form into queue.
Purpose
Used as producer for several PgQ standard consumers (cube_dispatcher, queue_mover, table_dispatcher). Basically for cases where the consumer wants to parse the event and look at the actual column values.
Trigger parameters
| arg1 | queue name |
| argX | any number of optional arg, in any order |
Optinal arguments
| SKIP | The actual operation should be skipped |
| ignore=col1[,col2] | don’t look at the specified arguments |
| pkey=col1[,col2] | Set pkey fields for the table, autodetection will be skipped |
Queue event fields
| ev_type | I/U/D ‘:’ pkey_column_list |
| ev_data | column values urlencoded |
| ev_extra1 | table name |
Regular listen trigger example
CREATE TRIGGER triga_nimi AFTER INSERT OR UPDATE ON customer
FOR EACH ROW EXECUTE PROCEDURE pgq.logutriga('qname');
Redirect trigger example
CREATE TRIGGER triga_nimi BEFORE INSERT OR UPDATE ON customer
FOR EACH ROW EXECUTE PROCEDURE pgq.logutriga('qname', 'SKIP');