[postgis-users] postgis support for 7.4 betas
David Blasby
dblasby at refractions.net
Mon Sep 29 10:07:28 PDT 2003
> Just to follow up, I did some digging around & ended up changing the
> function definition for "asbinary(geometry, text)" to return type
> "bytea" instead of "wkb" & that seemed to solve the problem, although I
> don't know if it's going to break anything as a result. I'm guessing
> that the bytea(wkb) function was there for just this case & was being
> used in 7.3 but isn't being used for some reason with 7.4. I know next
> to nothing about the typecasting, though, so it's just a guess.
I looked a little deeper. It looks like they changed how binary is
created/sent around in 7.4. There's not much documentation on it, but
if you look at the 7.4 description of CREATE TYPE:::
"...
Similarly, the optional send_function converts from the internal
representation to the external binary representation. If this function
is not supplied, the type cannot participate in binary output. The send
function may be declared as taking one argument of the new data type, or
as taking two arguments of which the second is type oid. The second
argument is again the array element type for array types. The send
function must return type bytea.
"
So, it looks like we need to change the CREATE TYPE of WKB to (see 'SEND='):
CREATE TYPE wkb (
internallength = variable,
input = wkb_in,
output = wkb_out,
storage = extended,
SEND = WKBtoBYTEA
);
I havent tried this at all, but I think it should work.
dave
More information about the postgis-users
mailing list