Bug report #21717

QGIS is assuming first column from Oracle DB is the primary key

Added by Belinda Baker over 5 years ago. Updated over 5 years ago.

Status:Open
Priority:Normal
Assignee:Jürgen Fischer
Category:Data Provider/Oracle
Affected QGIS version:3.4.0 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29532

Description

When trying to load a table into Oracle with primary key GID (1st column) with non unique IDs, an error shows "Primary key field 'GID' for view not unique." when adding a new column ID with unique IDs (based on row numbers) as new primary key (last column) and using refresh icon in Browser pane, the same error message appears despite ID becoming new primary key. Oracle provider even retains previous information about Oracle PK's or is assuming the first column is PK.

History

#1 Updated by Belinda Baker over 5 years ago

Test scenario would be create table/view with non unique IDs in first column, set last column with unique IDs as primary key and see if Oracle message log in QGIS logs any error (especially Primary key field 'xxx' for view not unique.)

Also available in: Atom PDF