[postgis-users] What's the Purpose of the Geometry_Columns Table?

Paul Ramsey pramsey at refractions.net
Tue Sep 5 11:08:37 PDT 2006


Agreement with Markus.

CREATE TABLE thetable ( thegeom GEOMETRY(4326,2,'POLYGON') );

Once we can do that, then GEOMETRY_COLUMNS can become a view.

Or, if we were allowed to run triggers on pg_* tables we could also  
maintain GEOMETRY_COLUMNS ourselves, but that is also not possible.

Paul

On 5-Sep-06, at 10:24 AM, Markus Schaber wrote:

> Hi, Stephen,
>
> I'm relatively new in the business, so I'll try to speak for all of us
> without leaning to much out of the window. :-)
>
> Stephen Frost wrote:
>> Can the PostGIS devs comment on if user-defined types with multi- 
>> field
>> typemods would be sufficient to replace geometry_columns and  
>> remove the
>> need for the ugly 'AddGeometryColumn()' functions and the various  
>> CHECK
>> constraints that go along with it?  (Note: geometry_columns could  
>> remain
>> in the system, it'd just be a view though)
>
> We cannot just drop geometry_columns as well as AddGeometryColumn()  
> and
> DropGeometryColumn(). We need those to be OpenGIS compliant, as those
> are the standardized "database-independent" way for applications to
> handle geometry columns. PostGIS itself works without them just fine.
>
> But we'd be happy to replace geometry_columns with a view, and the
> functions with small SQL functions containing a simple ALTER TABLE
> ADD/DROP COLUMN statement. That's what we wanted to have from the  
> beginning.
>
> I hope this will also allow us to drop the constraints that
> AddGeometryColumn() currently adds to the table to check srid,  
> dimension
> and type.
>
> Another problem we currently have is that transferring data via
> databases by dumping single tables with "pg_dump --table" and then
> inserting those tables into another database loses the  
> geometry_columns
> information. We also hope this would automagically be solved by  
> turning
> geometry_columns into a view.
>
> It might be helpful to have the typemods nullable, to allow for
> mixed-srid / mixed-dimension / mixed-type tables, but I think that we
> could handle that with special values, too.
>
>> I'd like to present the idea of:
>> create table mydata (
>>   wkb_geometry geometry(dims,srid,type)
>> );
>
>> to the Postgres Hackers list as a real-world use-case for multi-field
>> typemods, but only if the folks around here think it'd actually be
>> used..
>
> Yes, I think it will be used and appreciated.
>
> We could cope with a single-field typemod by using a custom data  
> type or
> some bit mangling, but a multi-field typemod is much more comfortable.
>
> Thanks,
> Markus
> -- 
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf.     | Software Development GIS
>
> Fight against software patents in EU! www.ffii.org  
> www.nosoftwarepatents.org
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list