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

Paul Ramsey pramsey at opengeo.org
Tue Dec 13 10:00:53 PST 2011


I agree that the migration should prefer typmod to constraints. Not
sure if anyone has built a converter already (my money is on "no").

P.

On Tue, Dec 13, 2011 at 12:57 AM, Sandro Santilli <strk at keybit.net> wrote:
> 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------'
>
> _______________________________________________
> 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