[postgis-users] Invalid endian flag value encountered on Postgis 2.0.1, Postgres 9.x, Windows XP

Mike Toews mwtoews at gmail.com
Sun Oct 21 16:06:27 PDT 2012


Oh, I just realized that your example would have worked fine with
escape strings prefixed with E:

select st_astext(ST_GeomFromEWKB(E'\\001\\001\\000\\000
\\263\\216\\001\\000\\000\\000\\000\\000\\252\\326''\\301\\000\\000\\000\\000X\\025.\\301'::bytea))

(note the above has a space character in the string sequence, not a
return character).

-Mike

On 20 October 2012 01:46, Václav Řehák <rehakv01 at gmail.com> wrote:
> Hi,
>
> I upgraded my development machine to Postgres 9.2 with Postgis 2.0.1
> installed by the stack builder on Windows XP 32bit. My Django
> application started to fail on a particular query which I nailed down
> to the following problem:
>
> select ST_GeomFromEWKB('\\001\\001\\000\\000
> \\263\\216\\001\\000\\000\\000\\000\\000\\252\\326''\\301\\000\\000\\000\\000X\\025.\\301'::bytea);
>
> ERROR: Invalid endian flag value encountered.
> SQL state: XX000
>
> The upgrade was performed by creating new db in PgAdmin using
> template_postgis_20 and restoring from a backup with
> postgis_restore.pl
>
> I kept my previous Postgis 1.5.3 in Postgres 8.4 running on a
> different port so I can test that the same WKB works there:
>
> select st_astext(ST_GeomFromEWKB('\\001\\001\\000\\000
> \\263\\216\\001\\000\\000\\000\\000\\000\\252\\326''\\301\\000\\000\\000\\000X\\025.\\301'::bytea))
>
> "POINT(-781141 -985772)"
>
> which is correct (in S-JTSK projection, SRID 102067).
>
> I also tried Postgres 9.1 with both Postgis 1.5.5 and 2.0.1 but I
> still get the endian error so I'm suspicious it has something to do
> with Postgres version rather than Postgis.
>
> Do you know how to check if the EWKB is correct? And what to check in
> my Postgres setup?
>
> Thanks.
>
> Vaclav
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list