Working with postgres server