[postgis] minor workaround to postgreSQL's user defined VARIABLE length datatype default value bug

Dave Blasby dblasby at refractions.net
Tue Sep 4 13:04:17 PDT 2001


There's a bug in postgresql for variable length user defined types (like
GEOMETRY and WKB).  It sets an invalid default value for the type. 

The recommended work around is to modify postgreSQL's pg_type table and
explicitly tell it use NULL as the default value.

I've added these two lines to the bottom of the postgis.sql.in file in
the CVS version:

update pg_type set typdefault = NULL where  typname = 'wkb';
update pg_type set typdefault = NULL where  typname = 'geometry';

Most people will not be affected by this bug so you can ignore this
message, but I thought I'd mention why those two lines are in the file.

dave
ps.  This is how to reproduce the bug;

create table t (i integer,g geometry);
insert into t values (1);
select * from t;
<server crashes>

The server crashes because it actually put an invalid value in the
GEOMETRY column during the insert (its an '-'::text) and postgis doesnt
know what do with it.

Want more info?  Check out the postgresql hacker's mailing list.

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Secure your servers with 128-bit SSL encryption! Grab your copy of VeriSign's FREE Guide: "Securing Your Web Site for Business." Get it Now!
http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list