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

Paragon Corporation lr at pcorp.us
Tue Dec 13 13:39:47 PST 2011


No.  

If we change restore to drop all the postgis table constraints

Then at the end run populate_geometry_columns()   it will convert all to
typmod

Though that should probably be a restore option since some tables e.g. some
ways people use inheritance it will fail if 
they try to do typmod.



> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net 
> [mailto:postgis-devel-bounces at postgis.refractions.net] On 
> Behalf Of Paul Ramsey
> Sent: Tuesday, December 13, 2011 1:01 PM
> To: PostGIS Development Discussion
> Subject: Re: [postgis-devel] Path from constrained to 
> typmod'ed definitions
> 
> 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
> _______________________________________________
> 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