minor pg db bugs