PostgreSQL tests

I started to add tests for PostgreSQL and already fixed some issues. Though, some tests still fail. From my point of view, it is not safe to use PostgreSQL at the moment.  
not sure what I was thinking here yesterday. haha. 

>  I think LOWER() should go around email in the line above.

yep.