fixed postgres catalog queries