Erlang integration with postgres