Tyler
Tyler

Reputation: 674

Table is ready-only. Unresolved table reference in PyCharm

Encountered this issues when trying edit data with mac version of pyCharm pro 2019.3 console table

  1. Tried run simple query like select * from schema.table but all result data return same unresolved reference error
  2. No issues under Dbeaver with same data source

Unresolved

Data source is not read only

Any idea why isn't working before i migrate all my datasource to Dbeaver.

Switch between mariaDB and mySQL driver still the same

Upvotes: 3

Views: 1794

Answers (3)

Chris Bornhoft
Chris Bornhoft

Reputation: 4301

Only recently coming across this question, the official answer from JetBrains is this occurs when either of the cases below is true, as of the date of this answer:

Query is complex, e.g contains JOIN, static values, functions, and other modifications. Such results cannot be edited as columns belonging cannot be 100% identified

OR

Table is not writable by DataGrip

The answer applies to all database solutions built into their IDEs, not just DataGrip.

In other words, there could be a multitude of reasons why a seemingly simple select query will not allow updating. The only solution provided is to either update using your own query or use the table UI.

See their official support article for more.

Upvotes: 1

Philipos D.
Philipos D.

Reputation: 2310

In the situation where you have multiple databases with the same structure, in your query, you will have to specify which database, in order to be able to change it from the Services tab.

For example:

  • good: SELECT * FROM development.settings ...
  • wrong:SELECT * FROM settings ...

Upvotes: 0

Lance
Lance

Reputation: 654

For anyone that finds this issue in their searches, this problem also shows up if you use column aliases in the query projection in DataGrip.

Example

SELECT column_a AS 'c_a', column_b, column_x FROM table;

That query's results in DataGrip will not support cell-contents manipulation because of the alias. You'll receive the error "Table is ready-only. Unresolved table reference" when trying to make direct changes to shown content.

Remove the alias (AS 'c_a') and rerun the query to be able to make the modifications to displayed results.

Upvotes: 0

Related Questions