Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Manager - Renaming constraints and indexes fails when renaming a table #21848

Closed
qgib opened this issue Nov 13, 2015 · 8 comments
Closed

DB Manager - Renaming constraints and indexes fails when renaming a table #21848

qgib opened this issue Nov 13, 2015 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Nov 13, 2015

Author Name: Paul Kanelli (Paul Kanelli)
Original Redmine Issue: 13823
Affected QGIS version: master
Redmine category:db_manager


When creating a table named 'lakes' in the DB Manager a constraint 'lakes_pkey' and the index 'sidx_lakes_geom' is created. But when renaming the table the constraint and the index don't get new names. So it's not possible to create a table named 'lakes' after renaming the original 'lakes' table.

@error: Relation „sidx_lakes_geom“ already exists@


Related issue(s): #15946 (relates)
Redmine related issue(s): 6798


@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2016

Author Name: Paul Kanelli (Paul Kanelli)


  • fixed_version_id was configured as Version 2.14

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2016

Author Name: Paul Kanelli (Paul Kanelli)


Also renaming the sequence of a serial column fails:

CREATE TABLE lakes
(
gid SERIAL NOT NULL,
geom geometry(polygon, SRID),
CONSTRAINT lakes_pkey PRIMARY KEY (gid)
);

Default value for column 'gid' is 'nextval('lakes_gid_seq'::regclass)'. It's not renamed after renaming table 'lakes'.

@qgib
Copy link
Contributor Author

qgib commented Feb 20, 2016

Author Name: Paul Kanelli (Paul Kanelli)


See also http://gis.stackexchange.com/questions/181532/renaming-a-table-in-the-qgis-db-manager

@qgib
Copy link
Contributor Author

qgib commented Feb 20, 2016

Author Name: Sebastian Dietrich (Sebastian Dietrich)


The workaround is to delete the constraints and recreate them. They are recreated with the correct name according to DB-Manager's naming scheme.

Note the linked ticket #22110 regarding the sequence issue.

@qgib
Copy link
Contributor Author

qgib commented Feb 20, 2016

Author Name: Sebastian Dietrich (Sebastian Dietrich)


  • os_version was changed from 7 to
  • version was changed from 2.12.0 to master
  • operating_system was changed from Windows to

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • regression was configured as 0
  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Oct 17, 2017

Author Name: Jürgen Fischer (@jef-n)


  • description was changed from When creating a table named 'lakes' in the DB Manger a constraint 'lakes_pkey' and the index 'sidx_lakes_geom' is created. But when renaming the table the constraint and the index don't get new names. So it's not possible to create a table named 'lakes' after renaming the original 'lakes' table.

@error: Relation „sidx_lakes_geom“ already exists@ to When creating a table named 'lakes' in the DB Manager a constraint 'lakes_pkey' and the index 'sidx_lakes_geom' is created. But when renaming the table the constraint and the index don't get new names. So it's not possible to create a table named 'lakes' after renaming the original 'lakes' table.

@error: Relation „sidx_lakes_geom“ already exists@

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2019

Author Name: Giovanni Manghi (@gioman)


End of life notice: QGIS 2.18 LTR

Source:
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/


  • status_id was changed from Open to Closed
  • resolution was changed from to end of life

@qgib qgib closed this as completed Mar 9, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin labels May 25, 2019
@qgib qgib added this to the Version 2.14 milestone May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin
Projects
None yet
Development

No branches or pull requests

1 participant