Opened 9 years ago

Closed 13 months ago

#3815 closed defect (wontfix)

[PATCH] OGR OCI Driver does not set FID column correctly at table define

Reported by: PeterHalls Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: 1.6.3
Severity: normal Keywords:
Cc:

Description

The concept of the FID column, which is also enshrined in the GDAL OGR philosophy, is that this is a 'primary key' in database terms. The OCI driver does not impose constraints on any column, nor does the API support a mechanism by which a constraint can be specified for a column.

As OGR_FID, or its alternate name, is intended to be a Primary Key it is desirable that this constraint be specified. The impact of this is to enforce unique values for this column in all tuples, such that this will provide a form of safety-net in the case of multiple simultaneous update. An equivalent level of protection would be provided by setting the UNIQUE constraint, instead of PRIMARY KEY. If this patch is adopted, the proposed patch to ogrocitablelayer to ensure that the value of iNextFIDToWrite is managed properly, or some similar strategy, is essential: it would not be possible to append to a table at all with the existing code otherwise.

The attached patch to ogrocidatasource.cpp includes this change, in addition to the author's earlier modification to support tables without geometry.

Attachments (1)

ogrocidatasource.primary_key (1.3 KB) - added by PeterHalls 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by PeterHalls

comment:1 Changed 5 years ago by Jukka Rahkonen

Summary: OGR OCI Driver does not set FID column correctly at table define[PATCH] OGR OCI Driver does not set FID column correctly at table define

comment:2 Changed 13 months ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.