Saturday, September 11, 2010

Interesting Postgresql Feature...

I found something new today, Postgres supports asynchronous notifications between different database sessions! What does this mean?

try this in a psql window;
listen SomethingHappens;

then in another window;
notify SomethingHappens;

Now go back to the first psql session... It's like a mini pub sub system built into your favourite database!

http://www.postgresql.org/docs/8.4/static/sql-notify.html

1 comment:

Ben Sizer said...

We use this for our MMO tech. It's handy for letting zone servers get notified of someone logging in when a login server writes to the DB to store this. It beats direct communication between the servers because you know the data is going to be consistent at the time you get the notification.

Popular Posts