[fdo-trac] #106: PostGIS provider cannot delete a feature class

FDO trac_fdo at osgeo.org
Mon Aug 27 16:27:20 EDT 2007


#106: PostGIS provider cannot delete a feature class
--------------------------------+-------------------------------------------
   Reporter:  cwilbur           |       Owner:  mloskot
       Type:  defect            |      Status:  new    
   Priority:  major             |   Milestone:  3.3.0  
  Component:  PostGIS Provider  |     Version:  3.2.0  
   Severity:  3                 |    Keywords:         
External_id:                    |  
--------------------------------+-------------------------------------------
 Using an {{{FdoFeatureSchema pSchema}}} from the connection's schema
 collection, the following code should drop the feature class table (and
 the associated feature id sequence, if any):

 {{{
 // remove the class from the schema
 FdoPtr<FdoClassCollection> pClassColl = pSchema->GetClasses();
 FdoPtr<FdoClassDefinition> pClass =
         pClassColl->FindItem(strFullClassName);
 if ( pClass )
 {
         pClass->Delete();

         // Create the ApplySchema command
         FdoPtr<FdoIApplySchema> pApplySchemaCmd =
 dynamic_cast<FdoIApplySchema*>(
                 m_connection->CreateCommand(FdoCommandType_ApplySchema) );

         // Set the schema and execute the apply schema command
         pApplySchemaCmd->SetFeatureSchema(pSchema);
         pApplySchemaCmd->Execute();
 }
 }}}

 Whether the table needs to be empty seems to be under some debate
 currently. Regardless, the PostGIS provider does not possess this
 functionality at all.

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/106>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list