[fdo-internals] Defects in PostGIS provider
greg.boone at autodesk.com
Wed Aug 22 16:50:02 EDT 2007
Yes, a schema element, e.g. a property, class or schema, should be able
to be deleted as long as it contains no data. If data is present the
ApplySchema should fail. All data should be removed via a delete
From: fdo-internals-bounces at lists.osgeo.org
[mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Chuck Wilbur
Sent: Wednesday, August 22, 2007 4:45 PM
To: fdo-internals at lists.osgeo.org
Subject: Re: [fdo-internals] Defects in PostGIS provider
> The provider generates WKB stream from FDO geometry and inserts it
> directly into INSERT INTO statement.
Right, I see that in the code, and it fails for geometry. For the sample
"Blue Lake" polygon geometry from the FDO documentation, PostGIS returns
(through the provider):
NOTICE: identifier "a400000000000003240000
04d400000000000002a400000000000804d400000000000003240" will be truncated
The execution of SQL statement failed with PostgreSQL error
code: PGRES_FATAL_ERROR, ERROR: syntax error at or near
LINE 1: ...Blue
> Does it crash for every geometry or may be if you use XYZ or XYZM
The geometries I've tested with are simple XY-only. A simple geometry
point doesn't get the "identifier truncated" message, but it still fails
with the syntax error because (I think) PostGIS is trying to interpret
long binary hexadecimal number as a long decimal integer.
I would think that to fix this you would need to either get the stream
text and use GeomFromText in the statement or use fully parameterized
queries into PostGIS. The second would almost certainly be the better
solution, but I don't know the syntax or API for parameterized queries
PostGIS, especially when one of the parameters is a WKB geometry. I
have to do some research.
>> 2) ApplySchemaCommand::Execute always issues CREATE TABLE
>> cannot be used to delete a feature class.
> Hmm, I'm not sure I understand.
> ApplySchema command is not used for removing feature classes (tables).
In other providers it is. Using an FdoFeatureSchema pSchema from the
connection's schema collection:
// remove the class from the schema
FdoPtr<FdoClassCollection> pClassColl = pSchema->GetClasses();
FdoPtr<FdoClassDefinition> pClass =
if ( pClass )
// Create the ApplySchema command
FdoPtr<FdoIApplySchema> pApplySchemaCmd =
// Set the schema and execute the apply schema command
The code above is a simplified version of what I've used with other
providers to drop feature classes. This is important functionality for
unit tests to ensure that I'm starting with a clean table each run.
View this message in context:
Sent from the fdo-internals mailing list archive at Nabble.com.
fdo-internals mailing list
fdo-internals at lists.osgeo.org
More information about the fdo-internals