Schema is not updating

Answered

Using Datagrip 2017.3.7

Using Oracle, and I have Auto Sync on.

Working on a small schema, with about 15 tables and 15 views.

I sync manually, but the schema is not synced. Views that have been deleted still show up under View folder. If I do a ctrl+Q I will still get up the  DDL for the view.

I view the same schema in TOAD, and there are none of the views that have been deleted.

Please fix this, as this is potentially dangerous.

32 comments
Comment actions Permalink

Hello. How do you attempt to sync the schema? 

What version of Oracle server do you use?

0
Comment actions Permalink

See below:

I've also tried reconnecting. Restarting. Nothing works. 

 

Version: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

 

Now this is also for PLSQL code, and it's not updating.This renders my development tool literally useless.

0
Comment actions Permalink

@ Oddbjørn Lona
Could you try to invoke "Forget cached schemas" to ensure there are no invalid objects?

3
Comment actions Permalink

@Oddbjørn Lona

I had a similar issue, it turned out the issue is not with the refresh, but with, which schemata are selected to be visible and to be loaded into the cache.

Four selections above the 'Synchronize' on your screenshot, there is Database Tools -> Manage Shown Schemas... then check if the schemata you would like loaded are selected in the respective databases. If not then update, Forget Cached Schemas and then Synchronize.

It took a bit of time to get in sync in my case, I might have even restarted, but at the end, it worked out for me.

3
Comment actions Permalink

@Oddbjørn

Try to "forget schemas" (alt+Enter (on MacOS) on the schema name in the Database View tree, then select in the "Forget cached schemas") and sync again.

0
Comment actions Permalink

I'm having this same problem with 2019.1 EAP. The only way I can get it to syncronize after a change is to remove the database using the tool window and re-add it. This is a postgres db running in a docker container. 

4
Comment actions Permalink

I'm having the same problem with Datagrip 2019.1 and Database tool plugin in PhpStorm 2018.3. I work with postgres in docker container.

0
Comment actions Permalink

I have this problem with Postgres 11 and 2019.1. The schema introspection takes place (I can see the message/bar in the bottom of the window) but certain objects can get into a state where schema introspection does not show them. It's a bit hard to explain but it has happened more than once.

The schema object exists, we have the correct permissions, but Datagrip refuses to show it in the sidebar. It seems to happen when dropping and recreating objects, but I don't know how to repro. Once this occurs, you're kinda screwed, even quitting the application and restarting doesn't fix it.

There must be some kind of cache of schema objects somewhere that gets into a bad state. I'd love to know how to delete that cache.

0
Comment actions Permalink

@ Matthew James Briggs 
Could you specify missing objects?

 

0
Comment actions Permalink

In the most recent case, it was a function which refused to be listed in the Routines tree (in the database object viewer). One possible theory is that, since I am running a Postgres development database in a Docker container, the database may go down and come back up with an altered schema. Maybe this messes of Datagrip's schema caching mechanism.

0
Comment actions Permalink

@ Matthew James Briggs 

Did you try to invoke Synchronize action to update schema?

 

---

 

To reset caches you need to invoke "Forget cached schemas" action

Also, it would be handy to enable `Warn when editing an outdated DDL` option

 

0
Comment actions Permalink

I've experienced the same problem with Oracle and SQL Server.  The issue is almost always with routines.   Synchronizing  or 'Forget Cached Schemas' does not work.  The only resolution I've found is to remove and add the data source.

1
Comment actions Permalink

I was having this problem that schema wasn't updating properly when changing the schema from outside of DataGrip. Postgres 9.6 in docker container and DG 2018.3.4.

It seemed to fix it for me to change configuration: DataSource Properties -> (select datasource in question) -> Tab 'Options' -> Check 'Introspect using JDBC metadata'

Hope this helps someone else too.

PS. it is bothersome if this has to be done all the time (fortunately I don't have a high number of schemas to deal with at the moment).

1
Comment actions Permalink

I'm still experiencing this in 2019.2.2. I have a Postgres database in docker that won't display any schemas under `public`. Code completion for table and column names works fine despite this (incl. accounting for schema modifications made after the last time this worked). The only thing that appears to make tables/schema details visible in the Database tool window is deleting and recreating the connection--disconnecting and reconnecting doesn't cut it.

1
Comment actions Permalink

There are some issues in IDE when you make changes outside the IDE, especially when DB is recreated in container.

Use `Force refresh` action for sync

3
Comment actions Permalink

This seems to happen almost all DB's that I've tried (happens in both windows and mac),  It's very frustrating and makes it very difficult to use the product (running 2020.2.3).  Incredibly slow updating the sync as well (when comparing against other db clients)

0
Comment actions Permalink

Matt Garrett,

Could you provide more details? What db engines did you try to sync/update?

0
Comment actions Permalink

Same thing here.

I've tried:

* refresh button on the Database view
* refresh button on the DDL view
* Database Tools > Forget Cached Views
* Database Tools > Force Refresh
* Enabling 'Introspect using JDBC metadata' and refresh

nothing worked.

The console view shows new columns that were added via migrations (external to DataGrip), but the DDL view is still showing the old schema without the new columns.

DataGrip 2020.3.1
Build #DB-203.6682.134, built on December 24, 2020

Runtime version: 11.0.9.1+11-b1145.63 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
Non-Bundled Plugins: bundled-datagrip-help

Postgres 10.3 running locally (not in Docker)

0
Comment actions Permalink

André Pinto

Could you file an issue in DataGrip YouTrack and  attach IDE and SQL logs?

Also, invoke `Prepare introspector diagnostic` and attach output.

P.S.: It's a bad idea to enable `JDBC metadata` for supported DBMS

0
Comment actions Permalink

vasily chernov, I was having the same issue on IntelliJ. Forcing it to forget the cached schemas and refreshing afterwards worked for me

0
Comment actions Permalink

Having same problem with DataGrip 2021.2.1 running on macOS 11.5.2.

First I had DataGrip connected to Oracle 19c Docker container. Then I have given a user some privileges like RESOURCE in a terminal. In the terminal, the user could create tables as i expected.

But in the DataGrip, the user couldn't create a table. Even though i reconnected to database with the user, it seems that the permission changes were not applied. After i removed the data source and created it again, the user could create a table eventually.

Force Refresh, Forget Cached Schemas didn't work to me. I had to remove data source to reflect privilege changes.

0
Comment actions Permalink

rosshjb,

Am I correct, that you created a user without any permissions firstly (only for connection) ant then granted him create privilege?

0
Comment actions Permalink

vasily chernov Yes, it is. But I granted a user RESOURCE role. I think that which privileges or roles i gave to a user doesn't matter, though.

1
Comment actions Permalink

It seems I have the same issue in the latest version of Datagrip, 2021.2. Data grip is showing old schema and it made me confused.

0
Comment actions Permalink

Jongsun Park,

Could you describe your issue in details?

0
Comment actions Permalink

rosshjb,

Could you file and issue to DataGrip YouTrack with steps to reproduce?

0
Comment actions Permalink

vasily chernov,
Hi. Nice to meet you.

*My environment
pc: MacBook Pro (16-inch, 2019)
datagrip: 2021.2 (licensed)
intellij: 2021.2 ultimate edition (licensed)

I'm not sure below steps reproduce the issue but this is what I experienced.

0. make liquibase files for db tables in intellij
1. launch intellij application so that liquibase make the tables.
2. drop some tables and delete related rows in databasechangelog via datagrip.
3. modify liquibase file for schema-changed tables.
4. re-launch intellij application to let liquibase make schema-changed tables.
5. The schema-changed tables are created but datagrip is showing old schema(DDL).

It seems restarting datagrip resolve the issue but I'm not sure.
Thanks.


0
Comment actions Permalink

Hi

I am having same issue. I am running pycharm 2021.1.1 (prof edition)

Here are the steps I have taken

1. I have modified the data in the SQL table and checking it to make sure its the updated table.

My sql

DROP TABLE ##Table1
SELECT * INTO ##Table1
FROM table2

2. I can see the updated table through console in pycharm.

3. Then I run my python program.

4. I have tried 'forget cache schema' and follow by 'forced refresh'. Does not work. The old data is still there.

5. I have to close pycharm and reopen it. Then it will work

6. If I run under pycharm' debug console, it will work. But if I run normally using 'shift F10', it will not work

 

Please advise

Thank you

L

 

0
Comment actions Permalink

Lchu,

Are you working with temp tables?

0
Comment actions Permalink

vasily chernov

Yes. Working with global Temp tables in SQL

0

Please sign in to leave a comment.