pg and old sqlite3 compatibility

Fixes #6.