[postgis-users] Difference between "Geometry" and "BLOB" in Postgis

Robert Burgholzer rburghol at vt.edu
Fri Oct 31 13:43:27 PDT 2014


OK cool.  So if I understand correctly, it seems that there may be no
immediate danger to the use of bytea, at the very least it is requiring an
implicit cast which may decrease performance.

Thanks for all the insight on this... will be rolling forward with an eye
towards migrating to "geometry" type in some future release.

On Fri, Oct 31, 2014 at 4:32 PM, Sandro Santilli <strk at keybit.net> wrote:

> On Fri, Oct 31, 2014 at 01:49:59PM -0400, Robert Burgholzer wrote:
> > Working at the module level in Drupal, creating queries with spatial
> > operators for Views.  Basically, Drupal's GeoField module stores geoms as
> > "bytea", which the PostGIS functions seem to handle quite nicely without
> a
> > cast.
>
> The cast is there, only it's implicit.
> When you call a function, PostgreSQL looks for candidates.
> Example: you call ST_Length(bytea), PostgreSQL finds an
> ST_Length(geometry) and see if a cast from geometry to bytea exists
> and is tagged as allowed to be implicit, it finds it and calls it.
>
> You can see this yourself by creating your own ST_Length(bytea) function,
> in which case it'll be called instead of ST_Length(geometry).
>
> In case multiple candidates exist with the same number of implicit casts
> required, PostgreSQL will raise an error.
>
> --strk;
>
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 
--
Robert W. Burgholzer
 'Making the simple complicated is commonplace; making the complicated
simple, awesomely simple, that's creativity.'  - Charles Mingus
Athletics: http://athleticalgorithm.wordpress.com/
Science: http://robertwb.wordpress.com/
Wine: http://reesvineyard.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20141031/0a83c795/attachment.html>


More information about the postgis-users mailing list