https://github.com/gmr/pgsql-listen-exchange
https://github.com/subzerocloud/pg-amqp-bridge
In theory, these let you use postgres NOTIFY to add messages to queues (which can be done from inside triggers).