[Geoserver-devel] [JIRA] (GEOS-9418) WFS-T Insert does not respect column default in PostGIS

Peter Smythe created an issue

GeoServer / BugGEOS-9418

WFS-T Insert does not respect column default in PostGIS

Issue Type:

BugBug

Affects Versions:

2.16.0

Assignee:

Unassigned

Created:

28/Nov/19 12:24 PM

Environment:

PostGIS

Priority:

MediumMedium

Reporter:

Peter Smythe

This issue was reported at https://github.com/planetfederal/suite/issues/255 in 2014, but apparently never in this GeoServer bug tracker.

I’ll copy smithkm’s original post in here:

When inserting a feature via WFS-T, having omitted a value for a date attribute with a default value in the PostGIS table of now() the resulting feature has a date of 1970-01-01

CREATE TABLE "dateTest"
(
fid serial NOT NULL,
date date NOT NULL DEFAULT now(),
geom geometry(Point,4326) NOT NULL,
CONSTRAINT "dateTest_pkey" PRIMARY KEY (fid)
)

Inserting this

INSERT INTO "dateTest" (geom) VALUES (ST_GeomFromEWKT('SRID=4326;POINT(-123 20)'));

Results in the date field being filled in with the current date.

Setting it up in GeoServer and inserting a new point thus

<wfs:Transaction service="WFS" version="1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:opengeo="http://opengeo.org"
xmlns:gml="http://www.opengis.net/gml">
<wfs:Insert>
<opengeo:dateTest><opengeo:geom><gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><gml:coordinates decimal="." cs="," ts=" ">22,-32</gml:coordinates></gml:Point></opengeo:geom></opengeo:dateTest>
</wfs:Insert>
</wfs:Transaction>

Results in a feature at the correct point, but with a date of 1970-01-01.

Also seems to impact Oracle.

https://opengeo.zendesk.com/tickets/2337

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100114-sha1:654add4)

Atlassian logo