Datagrip - PostgreSQL connection to Heroku not showing tables

Viewed 1841

I connected to my Heroku PostgreSQL database with Jetbrains Datagrip. Authentication was successful, I didn't need to specify advantage properties when connecting, when I filled host, db, username and password, Test connection was successful.

When I write query to console, everything works, for example:

SELECT * FROM users

find all users in my database.

I have problem, when I want to see tables in my database structure. They don't appear. In project tree, I can see only Database_name -> schemas -> public -> key_id_seq (image: Project tree structure). When I click on synchronize button, I get an error:

[42703] org.postgresql.util.PSQLException: ERROR: column t.relhasoids does not exist
  Position: .
Error encountered when performing Introspect database *db_name* schema public (details): ERROR: column t.relhasoids does not exist
  Position: .
ERROR: column t.relhasoids does not exist
  Position: 

Am I doing something wrong? Thank you.

3 Answers

Datagrip updated to version DataGrip 2019.3.3, Build #DB-193.6494.42, built on February 12, 2020, Now working :)

Try using "Introspect using JDBC metadata". This fixed it for me when (I think) I had a version mismatch between postgresql server and DataGrip client.

Under your connection settings -> Options tab -> check Introspect using JDBC metadata

According to https://www.jetbrains.com/help/datagrip/data-sources-and-drivers-dialog.html#optionsTab :

Switch to the JDBC-based introspector.

To retrieve information about database objects (DB metadata), DataGrip uses the following introspectors:

  1. A native introspector (might be unavailable for certain DBMS). The native introspector uses DBMS-specific tables and views as a source of metadata. It can retrieve DBMS-specific details and produce a more precise picture of database objects.

  2. A JDBC-based introspector (available for all the DBMS). The JDBC-based introspector uses the metadata provided by the JDBC driver. It can retrieve only standard information about database objects and their properties.

Consider using the JDBC-based intorspector when the native introspector fails or is not available.

The native introspector can fail, when your database server version is older than the minimum version supported by DataGrip.

You can try to switch to the JDBC-based introspector to fix problems with retrieving the database structure information from your database. For example, when the schemas that exist in your database or database objects below the schema level are not shown in the Database tool window.

My case was different here. But I was getting the similar error:

An error has occurred:

01:15:21 PM: Error: ERROR:  column rel.relhasoids does not exist
LINE 1: ...t_userbyid(rel.relowner) AS relowner, rel.relacl, rel.relhas...

I was using pgadmin 3 to connect to Heroku hosted Postgresql. Then I configure pgadmin 4. The error didn't show on it. For installing pgadmin 4, I used docker approach.

docker pull dpage/pgadmin4
docker run -p 5050:80 -e "PGADMIN_DEFAULT_EMAIL=XXXX@Xmail.com" -e "PGADMIN_DEFAULT_PASSWORD=thirumal" -d dpage/pgadmin4

Now, open the browser and navigate http://localhost:5050/.

Related