[postgis-devel] RE: [postgis-users] Problem with PostGIS 1.0.0 RC1
strk at refractions.net
strk at refractions.net
Tue Jan 25 03:26:14 PST 2005
Ok, I've made all of TypeFromText take "text".
Before a dump/reload, you might want to try this for
a live upgrade:
-- GeomFromText taking text
update pg_proc set proargtypes = '25'
where proname like '%fromtext' and pronargs = 1;
update pg_proc set proargtypes = '25 23'
where proname like '%fromtext' and pronargs = 2;
-- GeomFromWKB taking bytea
update pg_proc set proargtypes = '17'
where proname like '%fromwkb' and pronargs = 1;
update pg_proc set proargtypes = '17 23'
where proname like '%fromwkb' and pronargs = 2;
17 should be oid of 'bytea'
25 of 'text'
23 of 'integer'
At this point, to finish with consistency, we might want to
change geoemtry::text cast to return EWKT instead of HEXWKB.
So you could do:
GeomFromWKB(geometry); <-- autocast to bytea
GeomFromText(geometry); <-- autocast to text (needs (E)WKT to work)
Not that I consider this much important... anyway,
see this thread for discussion:
On Tue, Jan 25, 2005 at 09:59:40AM -0000, Mark Cave-Ayland wrote:
> Hi strk,
> > -----Original Message-----
> > From: strk at refractions.net [mailto:strk at refractions.net]
> > Sent: 25 January 2005 09:46
> > To: Mark Cave-Ayland
> > Cc: postgis-devel at postgis.refractions.net; 'PostGIS Users
> > Discussion'; 'Markus Schaber'
> > Subject: Re: [postgis-devel] RE: [postgis-users] Problem with
> > PostGIS 1.0.0 RC1
> > > Great, I think that having the consistency can only be a
> > good thing :)
> > We also have all of GeomFromText() which is currently taking
> > a 'geometry' instead of 'text'. This allows users to use
> > non-standard OGC functions, and I think should be changed.
> > Note that current behaviour makes this possible (as side-effects):
> > SELECT GeomFromText('00..FF');
> > SELECT GeomFromText('\\000\\001...'::bytea);
> > .. which I think should be forbidden.
> > What do you think ?
> Good catch. I would say definitely make it forbidden; I can't see a rational
> case for letting binary inputs into a *FromText() function at all(!).
> Markus, do you agree?
> Kind regards,
> WebBased Ltd
> South West Technology Centre
> Tamar Science Park
> PL6 8BT
> T: +44 (0)1752 791021
> F: +44 (0)1752 791023
> W: http://www.webbased.co.uk
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
More information about the postgis-devel