Bug report #21425
DB Manager rename PostGIS column error
|Affected QGIS version:||3.6.0||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29242|
With DB Manager in QGIS 3.6 when I try to rename a column through the DB Manager GUI (Table --> Edit table --> Edit column), it seems that DB Manager is also trying to add a comment (I had the comment field empty) but with the old name:
So e.g. I tried to rename column field_2 to long in table foo.bar
Here's the query that it tries to run:
COMMENT ON COLUMN foo.bar.field_2 is ''
This is the error that it throws:
column "field_2" of relation "fool.bar" does not exist
So I guess a fix for this would be not to try to add a comment if the comment field is empty and also make the commented field to be the new one.
[db_manager] apply comment to the correct column when altering table
column (fix #21425)