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: | |
---|---|---|---|
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)
Change History (6)
comment:1 by , 16 years ago
Cc: | added |
---|
comment:3 by , 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.
comment:4 by , 16 years ago
Test case attached to this ticket, which reproduces the error (see README)
comment:5 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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);
cc'ing Paul for comments.