Changes between Version 9 and Version 10 of rfc35_deletereorderalterfielddefn


Ignore:
Timestamp:
May 9, 2011, 12:37:59 PM (13 years ago)
Author:
Even Rouault
Comment:

link to v3 patch; mention that shapefile driver will allow converting to OFTString, mention that Memory driver will also updated to support the new API; add a section about Altering field types

Legend:

Unmodified
Added
Removed
Modified
  • rfc35_deletereorderalterfielddefn

    v9 v10  
    197197and can be used by all drivers implementing OGRLayer::ReorderFields() to validate the panMap argument.
    198198
     199== Altering field types ==
     200 
     201This RFC does not attempt to guarantee which type conversions will be possible.
     202It will depend on the capabilities of the implementing drivers.
     203For example, for database drivers, the operation will be directly done
     204on the server side (through a 'ALTER TABLE my_table ALTER COLUMN my_column TYPE new_type'
     205command for the PG driver). So some conversions might be possible, others not...
     206
     207It is however expected that converting from any type to OFTString will be supported in
     208most cases when AlterFieldDefn() is supported.
     209
     210Drivers that don't support a conversion and that were required to
     211do it (ALTER_TYPE_FLAG set and new_type != old_type) should emit an explicit error.
     212
    199213== Compatibility Issues ==
    200214
     
    206220extended with DBFReorderFields() and DBFAlterFieldDefn().
    207221
    208 Note: The implementation of AlterFieldDefn() in the Shapefile driver does not currently support altering
    209 the field type, and will not reformat numeric values of existing features if width or precision are changed.
    210 However, appropriate field truncation or expansion will occur if the width is altered.
     222Note: The implementation of AlterFieldDefn() in the Shapefile driver does not support altering
     223the field type, except when converting to OFTString. It will not reformat numeric values of existing features
     224if width or precision are changed. However, appropriate field truncation or expansion will occur if the width is altered.
    211225
    212226Other drivers, mainly database drivers (PG, MySQL, SQLite), could be easily extented to implement the new API
    213227by issuing the appropriate SQL command (ALTER TABLE foo DROP COLUMN bar, ALTER TABLE foo ALTER COLUMN bar, ...).
    214228The implementation of DeleteField() and AlterFieldDefn() in the PG driver is indeed planned,
    215 provided this RFC is adopted.
     229provided this RFC is adopted. The Memory driver will also updated to support DeleteField(), ReorderFields() and AlterFieldDefn().
    216230
    217231== SWIG bindings ==
     
    228242Implementation will be done by Even Rouault in GDAL/OGR trunk. Changes in Shapelib will need to be
    229243pushed into upstream CVS by a Shapelib committer. The proposed implementation is attached as
    230 a patch in ticket #2671 ([http://trac.osgeo.org/gdal/attachment/ticket/2671/rfc35_v2.patch rfc35_v2.patch]).
     244a patch in ticket #2671 ([http://trac.osgeo.org/gdal/attachment/ticket/2671/rfc35_v3.patch rfc35_v3.patch]).