[postgis-devel] Path from constrained to typmod'ed definitions

Sandro Santilli strk at keybit.net
Tue Dec 13 00:57:26 PST 2011


With my dump/restore tests I end up with half tables
using constraints and half tables using typmod.

Example:

 sqlmm_topology.edge_data.geom  is of type geometry and has:
    "enforce_dims_geom" CHECK (st_ndims(geom) = 2)
    "enforce_geotype_geom" CHECK (geometrytype(geom) = 'LINESTRING'::text
                                  OR geom IS NULL)
    "enforce_srid_geom" CHECK (st_srid(geom) = 0)

 small_sample_topo.edge_data.geom is of type geometry(LineString)
    and has no constraints

I wouldn't try to mess with those definitions at restore time, to reduce
the risk of broken restores, but I would probaby want to convert all
structures to the new format, dropping the constraints and converting
to typmod. Is there any such function or script already ?

--strk; 

  ,------o-. 
  |   __/  |    Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |    http://www.pledgebank.com/postgistopology
  `-o------'




More information about the postgis-devel mailing list