[postgis-devel] [PostGIS] #252: Text autocasting behavior of geography is breaking geometry functionality
lgomez
lgomez at itba.edu.ar
Thu Sep 24 04:02:52 PDT 2009
Que susto!. Los chicos creen que hay una sola de acceder al sitio (sin
autenticación), pero Pablo te dio como acceder por token, de hecho es lo que
hiciste la semana pasada cuando Pablo de dio mi DNI, etc.
Les mandas eso. En ese caso es donde tenemos errores. Ese que viste.
Gracias,
Leticia
-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of PostGIS
Sent: Thursday, September 24, 2009 8:00 AM
Cc: postgis-devel at postgis.refractions.net
Subject: Re: [postgis-devel] [PostGIS] #252: Text autocasting behavior of
geography is breaking geometry functionality
#252: Text autocasting behavior of geography is breaking geometry
functionality
----------------------+-----------------------------------------------------
Reporter: robe | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: postgis 1.5.0
Component: postgis | Version: trunk
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment (by robe):
It appears there is one other solution besides renaming functions and that
is to declare yet another function that in the face of unknown trumps the
other functions.
After studying the docs, it appears to me that the text/varcahr datatype
is hard-wired to rank higher as an appropriate CAST for unknown than any
other data type (or at least in 8.4).
http://www.postgresql.org/docs/8.4/interactive/typeconv-func.html (see
bullet 4 item d)
-- have to test 8.3 though docs of 8.3 suggest the same)
The below appears to solve the problem (for ST_AsBinary and I presume we
could do the same for others where we will have name clashes). I've only
tested on 8.4 (not yet on 8.3).
Alternatively we could do nothing and proclaim this is a bad habit of
people anyway and force them to change their ways by breaking their
malformed apps. It might make many people mad, but they might thank us in
the long run (or maybe not :))
{{{
CREATE OR REPLACE FUNCTION st_asbinary(text)
RETURNS bytea AS
$$ SELECT st_asbinary($1::geometry); $$
LANGUAGE 'sql' IMMUTABLE STRICT
COST 1;
}}}
Does anyone see a problem with the aforementioned solution.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/252#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS
_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel
More information about the postgis-devel
mailing list