Ticket #106 (closed defect: fixed)

Opened 1 year ago

Last modified 5 months ago

PostGIS provider cannot delete a feature class

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

Description

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.

Attachments

DropTableDraft.patch (11.5 kB) - added by cwilbur on 08/27/07 16:28:08.
Draft attempt at fix

Change History

08/27/07 16:28:08 changed by cwilbur

  • attachment DropTableDraft.patch added.

Draft attempt at fix

08/27/07 16:32:16 changed by cwilbur

The DropTableDraft? patch is only to provoke discussion - it is definitely not ready to be submitted. I may be pulled away from work on the provider shortly and I wanted to make sure the work I had done so far was captured in case anyone else wanted to tackle this one before I get back to it.

09/11/07 04:16:01 changed by jbirch

  • cc set to jbirch.

03/03/08 10:49:41 changed by gregboone

  • milestone changed from 3.3.0 to 3.3.1.

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

See also big patch submitted for review as #318

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

Patch has been applied to the trunk (r3904). I'm closing it as fixed. Please, reopen if something is still not working well.

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

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