Ticket #171 (closed defect: fixed)

Opened 11 months ago

Last modified 5 months ago

Fdo Postgis Autogenated identity property is mandatory

Reported by: bscott Assigned to: mloskot
Priority: major Milestone: 3.4.0
Component: PostGIS Provider Version: 3.2.0
Severity: 3 Keywords:
Cc: External ID:

Description (Last modified by jbirch)

With FDO it is possible to create a column with Primary = true and autogenerate = false. I think the PostGis provider should not do that assumption and let the user manage the primary key if the autogenerate flag is set to false.

Actually it is mandatory there is the piece of code where you can find the limitation:


void SchemaDescription::DescribeSchema(Connection* conn, FdoString* schemaName) 
{ 
  ... 
        ////////////////// SET AUTO-GENERATED TO SINGLE COLUMN PK OF 
 INTEGRAL TYPE ////////////////// 
  
// TODO: It is possible, that user connects to a datastore that was not created 
// with FDO, using ApplySchema command, so single column PRIMARY  KEY 
// of integral type, may not have associated sequence named according scheme: 
// <tablename>_<columnname>_seq 
// The PostGIS provider uses such scheme to bind a sequence to PK column. 
   
// TODO: In future, it would be a good idea to automatically 
// replace PK of integral type with serial data type, in ApplySchema command. 
     FdoPtr<FdoDataPropertyDefinitionCollection> propsIdentity;   
     propsIdentity = featClass->GetIdentityProperties();  
     if (1 == propsIdentity->GetCount()) 
     { 
       FdoPtr<FdoDataPropertyDefinition> propId = propsIdentity->GetItem(0);  
       assert(NULL != propId); 
   
       if (FdoDataType_Int16 == propId->GetDataType()   
        || FdoDataType_Int32 == propId->GetDataType() 
        || FdoDataType_Int64 == propId->GetDataType()) 
       { 
         propId->SetIsAutoGenerated(true); 
       } 
     } 


Change History

03/03/08 10:46:07 changed by gregboone

  • milestone changed from 3.3.0 to 3.3.1.

04/19/08 06:31:43 changed by mloskot

Patch submitted for review as #318

04/20/08 04:30:58 changed by jbirch

  • description changed.

Just fixing up the ticket description...

04/21/08 13:43:31 changed by mloskot

  • status changed from new to assigned.

04/21/08 13:44:08 changed by mloskot

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in trunk (r3904) with patch from Bruno Scott. I'm closing it as fixed. Please, reopen if something is still not working well.