[Qgis-developer] PostGIS provider does not recognize Interval type

Nyall Dawson nyall.dawson at gmail.com
Fri Feb 12 12:20:01 PST 2016


On 13 February 2016 at 04:10, René-Luc Dhont <rldhont at gmail.com> wrote:
> Hi Dev,
>
> I'm testing a PostGIS table with an INTERVAL type field and this one is not
> recognize by QGIS.
>
> Did someone know why INTERVAL type is not recognized by PostGIS provider ?
> And how to add a new supported type to PostGIS provider ?

Intervals don't exist outside of expressions (at the moment). You'd need to:

1. Move QgsExpression::Interval out of QgsExpression into it's own
class (QgsInterval), updating the API and adding unit tests as
required
2. Make the new class available for use in QVariants by calling
Q_DECLARE_METATYPE( QgsInterval ) (usually placed at the end of the
header for the corresponding class)
3. Make similar changes to qgspostgresprovider.cpp:182, :348, :879, :3250
4. Add a test for pg interval types, like the changes made to
test_provider_postgres.py as part of 7dc5eac

Nyall


>
> Thanks,
>
> René-Luc D'Hont
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list