Skip to main content
10 events
when toggle format what by license comment
May 13, 2014 at 23:49 comment added Alexey Naumov Additional Npgsql supports binary protocol, but only for prepared statements.
May 11, 2014 at 13:49 comment added Craig Ringer Looks like nPgSQL may not support the PostgreSQL binary protocol, so even if you use bytea functions like ST_AsEWKB it'll still do I/O via the bytea_output format, which is hex in newer PostgreSQL versions.
May 11, 2014 at 13:29 vote accept Alexey Naumov
May 11, 2014 at 13:27 comment added Alexey Naumov @CraigRinger, ST_AsEWKB equals to plain geometry. ST_AsBinary is WKB (OGC format). Both of them is not pure binary, because they are hex strings [bytea in pgsql terms]. It's a large overhead to convert hex string to byte array evertime when you works with millions of records.
May 11, 2014 at 13:18 answer added Craig Ringer timeline score: 7
May 11, 2014 at 13:17 comment added Craig Ringer It's the normal behaviour, but you're really not expected to use that representation directly. Use ST_AsBinary or ST_AsEWKB if you want the binary form.
May 11, 2014 at 12:33 comment added Alexey Naumov @CraigRinger, nope. Read only (Windows, C#, Npsql driver), I want to understand why PostgreSQL/PostGIS returns geometry as hex string, not as byte array. It's really strange, is it usual? Or it is a driver problem. May be I can change this behavior.
May 11, 2014 at 12:25 comment added Craig Ringer So you want to exchange PostGIS data in binary with the server? You can do that if you're using libpq, just use the binary options to PQexecParams.
May 11, 2014 at 11:46 review First posts
May 11, 2014 at 12:00
May 11, 2014 at 11:30 history asked Alexey Naumov CC BY-SA 3.0