I get the same invalid endian flag value encountered error with your example on PostGIS 2.0. However, if I remove the escapes and use dollar quoting instead, it works:
SELECT ST_AsEWKT(ST_GeomFromEWKB($$\001\001\000\000 \263\216\001\000\000\000\000\000\252\326'\301\000\000\000\000X\025.\301$$::bytea)) SRID=102067;POINT(-781141 -985772) -Mike On 20 October 2012 01:46, Václav Řehák <rehak...@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@postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users