[fdo-users] Fdo Postgis Autogenated identity property
Bruno Scott
bscott at geomapgis.com
Mon Nov 19 10:55:22 EST 2007
No problem Mateusz
i will do it right away
Bruno
Mateusz Loskot wrote:
>
> Bruno,
>
> Thanks for the good catch.
> Would you mind to report it as a ticket to the FDO Trac system?
>
> http://trac.osgeo.org/fdo
>
> And I will take care of it.
> -- Mat
>
> Bruno Scott wrote:
>> 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);
>> }
>> }
>>
>>
>> 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.
>>
>>
>> Bruno
>>
>>
>>
>>
>>
>>
>> christophe_geomap wrote:
>>> When i have only 1 identity property (int32), postgis provider set the
>>> property autogenerate.
>>> Is there a way to have 1 identity property (int32) without using a
>>> sequence or is there a ticket about this ?
>>>
>>> Thanks
>>>
>>> Christophe
>>>
>>
>
>
> --
> Mateusz Loskot
> http://mateusz.loskot.net
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
>
--
View this message in context: http://www.nabble.com/Fdo-Postgis-Autogenated-identity-property-tf4803647s18162.html#a13838677
Sent from the fdo-users mailing list archive at Nabble.com.
More information about the fdo-users
mailing list