Ticket #3124 (closed defect: fixed)
single quote problem in postgresql validation query (PostGIS layer)
| Reported by: | christiangda | Owned by: | pramsey |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4.2 release |
| Component: | PostGIS Interface | Version: | 5.4 |
| Severity: | normal | Keywords: | |
| Cc: | pramsey, sdlime |
Description
When you use a PostGIS layer passing to it the geometry (see attachment map), the layer is drawed, but PostgreSQL log show this error:
VET-idleERROR: syntax error at or near "0105000020E610000007000000010200000002000000030000" at character 269 VET-idleSTATEMENT: select attname from pg_attribute, pg_constraint, pg_class where pg_constraint.conrelid = pg_class.oid and pg_class.oid = pg_attribute.attrelid and pg_constraint.contype = 'p' and pg_constraint.conkey[1] = pg_attribute.attnum and pg_class.relname = '(SELECT 1 as oid, '0105000020E610000007000000010200000002000000030000BFEDBA50C0190000782F072540C3A056D0EDBA50C0FDADEBCF2C072540010200000002000000C3A056D0EDBA50C0FDADEBCF2C07254061601029F2BA50C01C1D82E73307254001020000000200000061601029F2BA50C01C1D82E733072540EB17E849F6BA50C0A13009A33A072540010200000002000000EB17E849F6BA50C0A13009A33A07254083EA883EF4BA50C0046956478407254001020000000200000083EA883EF4BA50C00469564784072540396D4E91F3BA50C0806332219D072540010200000002000000396D4E91F3BA50C0806332219D072540396D4E91F3BA50C0826332219D072540010200000002000000396D4E91F3BA50C0806332219D072540020080FCF3BA50C0EEFFFFDB9D072540'::geometry AS the_geom) AS FOO' and pg_table_is_visible(pg_class.oid) and pg_constraint.conkey[2] is null
The problem are the two single quote in the argument "pg_class.relname =" see:
'(SELECT 1 as oid, '0,
if you can chage it to '(SELECT 1 as oid, 0 in runtime when you detect single quote within the string, maybe the proble was fixed.
1 Download the attachment map 2 shp2img -m sample.map -o sample.jpg 3 tail -30 your_postgresql_log_file.log

