Opened 17 years ago

Closed 16 years ago

#2333 closed defect (wontfix)

error when using table with column of type bytea

Reported by: tomkralidis Owned by: mapserver-bugs@…
Priority: normal Milestone: 5.2.1 release
Component: PostGIS Interface Version: svn-trunk (development)
Severity: normal Keywords:
Cc: jderrac@…, pramsey

Description

(from mapserver-users)

In WFS server mode, when invoking a GetFeature, accessing a PostGIS table containing a column of type bytea, an empty result set is returned. When dropping the offending type bytea column, the same GetFeature response returns (with data) as expected.

Attachments (1)

mstrac-2333.zip (1.4 KB ) - added by tomkralidis 16 years ago.
test case to reproduce this issue

Download all attachments as: .zip

Change History (6)

comment:1 by tomkralidis, 16 years ago

Cc: pramsey added

cc'ing Paul for comments.

comment:2 by tomkralidis, 16 years ago

Any thoughts on this one?

comment:3 by pramsey, 16 years ago

No thoughts. Bytea casts to ::text just fine, and that was my only SWAG. Attach a table dump, a corresponding map file and a WFS request URL, to make life easy for any potential debugger.

by tomkralidis, 16 years ago

Attachment: mstrac-2333.zip added

test case to reproduce this issue

comment:4 by tomkralidis, 16 years ago

Test case attached to this ticket, which reproduces the error (see README)

comment:5 by pramsey, 16 years ago

Resolution: wontfix
Status: newclosed

OK, I was wrong, it's not generally possible to case bytea to text, except in PostgreSQL 8.3. In 8.2, I get this:

ERROR: cannot cast type bytea to text

Which is too bad, since Mapserver requires everything cast to text in order to return it.

So, two fixes, neither of them at the Mapserver end: upgrade to 8.3 or add a CAST to your current installation to take bytea to text.

create or replace function bytea2text ( bytea )returns text language sql as 'select encode( $1 , hex )'; create cast (bytea as text) with function bytea2text(bytea);

Note: See TracTickets for help on using tickets.