Ticket #2333 (closed defect: wontfix)

Opened 6 years ago

Last modified 5 years ago

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

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

Change History

Changed 5 years ago by tomkralidis

  • cc pramsey added

cc'ing Paul for comments.

Changed 5 years ago by tomkralidis

Any thoughts on this one?

Changed 5 years ago by pramsey

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.

Changed 5 years ago by tomkralidis

test case to reproduce this issue

Changed 5 years ago by tomkralidis

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

Changed 5 years ago by pramsey

  • status changed from new to closed
  • resolution set to wontfix

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.