[URGENT / SECURITY] Postgresql fixes

/cc @thatch45 @s0undt3ch