ENCODE-DCC/encoded — pull request #61 by lrowe (2013-11-28 01:51:31+00:00)
Title: Fully synchronized elasticsearch indexing #620

Requires the following SQL schema change:

```
ALTER TABLE transactions ADD COLUMN "xid" bigint;
ALTER TABLE transactions ALTER COLUMN "xid" SET DEFAULT txid_current();
CREATE OR REPLACE FUNCTION encoded_transaction_notify() RETURNS trigger AS $$
DECLARE
BEGIN
PERFORM pg_notify('encoded.transaction', NEW.xid::TEXT);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER encoded_transactions_insert AFTER INSERT ON transactions
FOR EACH ROW EXECUTE PROCEDURE encoded_transaction_notify();
```