Bug report #13504

columns added to Spatialite layers with DB Manager are not visible in QGIS

Added by Giovanni Manghi about 4 years ago. Updated 10 months ago.

Status:Closed
Priority:Normal
Assignee:Julien Cabieces
Category:Data Provider/SpatiaLite
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21548

Description

Any new column added by DB Manager's "edit table" function is then not visible in QGIS layers properties (but is visible in DB Manager).

try adding other columns using QGIS vector properties will result in errors like

ERROR: field with index 2 is not the same!

This used to work as expected in past QGIS releases.

Associated revisions

Revision 49cb397f
Added by Julien Cabieces 10 months ago

Update layer statistics when adding column to table in order to be displayed by QGIS

fixes #13504

Revision 6f9d5443
Added by Julien Cabieces 10 months ago

Update layer statistics when adding column to table in order to be displayed by QGIS

fixes #13504

(cherry picked from commit 49cb397f89511535bc772abd69a767e84024690a)

History

#1 Updated by Giuseppe Sucameli about 4 years ago

Does it happen with SL layers only?
Could you try with a PostGIS layer and report here the result, please?

#2 Updated by Giovanni Manghi about 4 years ago

Giuseppe Sucameli wrote:

Does it happen with SL layers only?
Could you try with a PostGIS layer and report here the result, please?

as far as I can see, only SL.

and I just noticed this #13508

that applies to both SL and PostGIS tables.

#3 Updated by Salvatore Larosa about 4 years ago

confirmed here and I can confirm it is occurring also in QGIS LTR.

#4 Updated by Giovanni Manghi about 4 years ago

Salvatore Larosa wrote:

confirmed here and I can confirm it is occurring also in QGIS LTR.

you have to go back a while to see it working, but this is anyway a regression ;)

#5 Updated by Matthias Kuhn about 4 years ago

  • Status changed from Open to Feedback

Maybe it is related to issue #8923. Can you run the proposed workaround there to check if it is the same issue #8923-5

#6 Updated by Giovanni Manghi about 4 years ago

Matthias Kuhn wrote:

Maybe it is related to issue #8923. Can you run the proposed workaround there to check if it is the same issue #8923-5

no, it doesn't solve.

Please note that there is another regression in DB Manager and SL layers: drag and drop from DB manager to QGIS main Window will return an error (is ok for PostGIS layers), but worked ok in past QGIS releases. As the double click on table names in DB Manager do not add them to the project (an inconsistency compared to how the QGIS browser behave), the only option to add SL layers is to right click them an choose "add to canvas", and for who works routinely with SL is less than optimal.

#7 Updated by Saber Razmjooei about 4 years ago

  • Status changed from Feedback to Open

Gio,
Better to probably add that as a new ticket.

#8 Updated by Giuseppe Sucameli about 4 years ago

What if you add a new column from a different database tool (e.g. spatialite-gui) instead of DBManager?

I suppose this is not a DBManager issue, it's something related to cached attributes not properly updated.

#9 Updated by Giuseppe Sucameli about 4 years ago

Giovanni Manghi wrote:

drag and drop from DB manager to QGIS main Window will return an error

Hi Gio, I'm unable to reproduce it here... Could you please file a new ticket and give more info? Thanks.

As the double click on table names in DB Manager do not add them to the project (an inconsistency compared to how the QGIS browser behave), the only option to add SL layers is to right click them an choose "add to canvas", and for who works routinely with SL is less than optimal.

Now double-clicking on a table adds it as layer to canvas (9f67f4cde0) ;)

#10 Updated by Giovanni Manghi about 4 years ago

Giuseppe Sucameli wrote:

What if you add a new column from a different database tool (e.g. spatialite-gui) instead of DBManager?

I suppose this is not a DBManager issue, it's something related to cached attributes not properly updated.

If I add the column with "ALTER TABLE..." (in SL GUI or else) then the column is visible in DB Manager but not in QGIS.

#11 Updated by Giovanni Manghi about 4 years ago

Giuseppe Sucameli wrote:

Giovanni Manghi wrote:

drag and drop from DB manager to QGIS main Window will return an error

Hi Gio, I'm unable to reproduce it here... Could you please file a new ticket and give more info? Thanks.

is ok on latest master!

As the double click on table names in DB Manager do not add them to the project (an inconsistency compared to how the QGIS browser behave), the only option to add SL layers is to right click them an choose "add to canvas", and for who works routinely with SL is less than optimal.

Now double-clicking on a table adds it as layer to canvas (9f67f4cde0) ;)

HUGE usability improvement, thanks!

#12 Updated by Nyall Dawson about 4 years ago

  • Priority changed from Severe/Regression to High

Not a blocker - if it's been this way since 2.8, it won't block future releases either ;)

#13 Updated by Giovanni Manghi over 3 years ago

  • Priority changed from High to Normal

#14 Updated by Giovanni Manghi over 2 years ago

  • Regression? set to No
  • Easy fix? set to No

#15 Updated by Julien Cabieces 10 months ago

  • Description updated (diff)
  • Assignee set to Julien Cabieces

#16 Updated by Julien Cabieces 10 months ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF