[postgis-users] Can I add geometry column without use AddGeometryColumn?

strk strk at keybit.net
Fri Jul 16 02:00:53 PDT 2010

On Fri, Jul 16, 2010 at 10:28:50AM +0700, nguyen thuy ai vy wrote:
> Hello everybody,
>  Is there any problem if I add a geometry by this way?
> Firstly, I created table has a column with geometry type. Then, I added
> check constraints for this geometry column like this:
>  CONSTRAINT con_poi_point_enforce_dims_chk CHECK (ndims(poi_point) = 2),
>  CONSTRAINT con_poi_point_enforce_geotype_chk CHECK (geometrytype(poi_point)
> = ''POINT''::text OR poi_point IS NULL),
>  CONSTRAINT con_poi_point_enforce_srid_chk CHECK (srid(poi_point) = 4326)

*some* clients need an entry in geometry_columns to use your spatial data.
If your client doesn't, there's no problem.
As for the constraint, some management stored procedures use their name
and definition to figure out the record to put in geometry_columns for
you. But other don't.

So, short story: you are completely fine within postgis to add a column
manually (at CREATE TABLE or ALTER TABLE or SELECT INTO time). 


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the postgis-users mailing list