Opened 4 years ago

Closed 4 years ago

#3360 closed defect (fixed)

_raster_constraint_info_scale invalid input syntax

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 2.2.1
Component: raster Version: 2.2.x
Keywords: Cc:


We may have a ticket in for this already. In trying to test out QGIS issue mentioned here:

I'm running:

PostgreSQL 9.5beta1, compiled by Visual C++ build 1800, 64-bit POSTGIS="2.2.0 r14208" GEOS="3.5.0-CAPI-1.9.0 r4090" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.0.1, released 2015/09/15" LIBXML="2.7.8" LIBJSON="0.12" RASTER

I decided to load up some rasters. I can see my picture raster with no constraints fine.

When I loaded up -


raster2pgsql -s 4326 -I -C -M prec/*.bil -F -t 256x256 ch12.prec | psql

Loaded fine, but when tried to view in QGIS 2.12.0 nothing showed up. My postgres logs show a long query which looks very similar to raster_columns view.

with error:

ERROR:  invalid input syntax for type double precision: "0.00833333333333333,10"
CONTEXT:  SQL function "_raster_constraint_info_scale" statement 1


SELECT * FROM raster_columns;

generates the same error. I think I've tried vieiwng this in 2.1 before when I wrote the book and was fine viewing in QGIS. I'll try to relaod in 2.1 to confirm it's a 2.2. issue.

Change History (3)

comment:1 Changed 4 years ago by robe

Owner: changed from Bborie Park to robe

okay the culprit I think is when we introduced change to enforce_scalex_rast, enforce_scaley_rast to use round. My constraint looks like this:

ALTER TABLE public.prec

ADD CONSTRAINT enforce_scalex_rast CHECK (round(st_scalex(rast)::numeric, 10) = round(0.00833333333333333, 10));

So I guess the info function can't parse that.

comment:2 Changed 4 years ago by robe

(In [14371]) _raster_constraint_info_scale gives invalid input syntax

references #3360 fix for PostGIS 2.3 (trunk)

comment:3 Changed 4 years ago by robe

Resolution: fixed
Status: newclosed

(In [14372]) _raster_constraint_info_scale gives invalid input syntax, NEWS update

closes #3360 fix for PostGIS 2.2 NEWS update also references #3355

Note: See TracTickets for help on using tickets.