trying to add postgres support

Hello, I was attempting to add postgres as a backend.  I tried to add it in the least obtrusive manner possible and by using the mysql plugin as a template.

I do have a few questions is the ACL check only when trying to publish?  Using mysql or the postgres the only time it checks the ACL table is when I attempt to publish to a topic it appears I can subscribe at any time.

Please let me know if there is anything else I can do.