[Qgis-user] Problems with date fields from Postgis + QGIS

Alexandre Neto senhor.neto at gmail.com
Mon Jun 9 09:12:52 PDT 2014


Sorry hit the send button before finishing the text...

I'm having problems using fields of the type "date" from Postgis in QGIS.

CREATE TABLE my_table (
gid serial primary key,
date_field date,
geom geometry(MultiPolygon,3763)
);

The field don't have any NOT NULL constraint, but when I try to update a
row leaving that field empty, I got and error saying:

Could not commit changes to layer may_table
> Errors: ERROR: 1 attribute value change(s) not applied.
> Provider errors:
> PostGIS error while changing attributes: ERROR: invalid input syntax for
> type date: ""
> LINE 1: ...my_table" SET "date_field"='' WHERE "...



It seams that QGIS tries to insert a empty string inside the field instead
of a NULL value.

This happens both in QGIS 2.2 and master

Can anyone confirm this?

Alexandre Neto


On Mon, Jun 9, 2014 at 4:58 PM, Alexandre Neto <senhor.neto at gmail.com>
wrote:

> I'm having problems using fields of the type "date" from Postgis in QGIS.
>
> CREATE TABLE my_table
>
>
> The field don't have any NOT NULL constraint, but when I try to update a
> row leaving that filed empty, I got and error saying:
>
>
>
>
>  that I cannot row, n
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140609/7d8a80e4/attachment.html>


More information about the Qgis-user mailing list