initial postgres backend implementation. very slow