PostGISGeometry Input

ST_WKBToSQL

What is ST_WKBToSQL?

ST_WKBToSQL is the SQL/MM spelling of the WKB-to-geometry constructor. It parses WKB and returns the geometry with SRID 0.

SQL
ST_WKBToSQL(bytea wkb)geometry

Equivalent to the one-argument form of ST_GeomFromWKB.

When would you use ST_WKBToSQL?

Use ST_WKBToSQL in SQL/MM-portable code that must run across multiple spatial databases. It is the standard function name in ISO SQL/MM; most PostgreSQL-only code uses ST_GeomFromWKB.

It is a thin alias, so there is no performance reason to prefer one over the other — the choice is purely stylistic.

FAQs

Is it the same as ST_GeomFromWKB?

Behaviourally, yes — except ST_GeomFromWKB has an overload that accepts an SRID.

What SRID does the result have?

Zero. Tag with ST_SetSRID or cast to a typed column that enforces a specific SRID.

Is it faster than ST_GeomFromText?

Yes — like all WKB parsers, it is significantly faster than WKT for bulk loads.

Why does PostGIS provide SQL/MM aliases?

To support portable SQL/MM applications that depend on ISO-standard function names.