Yes, I can confirm this on QGIS master on Windows 7 writing to PostgreSQL 9.2.6 with PostGIS 2.1
Seems to be passing a blank string rather than a NULL to the date field. You beat me to it - I was just about to write the same email... Ross On 9 Jun 2014, at 17:12, Alexandre Neto wrote: > 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.n...@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 > > > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user