Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...) - Mailing list pgsql-general

From Tom Lane
Subject Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...)
Date
Msg-id 11452.1346256144@sss.pgh.pa.us
Whole thread Raw
In response to Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...)  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: [postgis-users] pg_dump -s should use add_geometrycolumn(...)  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-general
Andres Freund <andres@2ndquadrant.com> writes:
> On Wednesday, August 29, 2012 04:44:14 PM Willy-Bas Loos wrote:
>> pg_dump -s should use add_geometrycolumn(...) instead of creating a
>> column+constraints with normal DDL
>> Because, when you don't dump the data, then the record in geometry_columns
>> is lost.

> That shouldn't be a problem with postgres 2 anymore as far as I understand
> things?

The big picture here is that pg_dump doesn't, and is not likely ever to,
know about anything as extension-specific as add_geometrycolumn().
Rather, if postgis needs some info in a special table geometry_columns,
that should be handled by pg_dump dumping and restoring that table too
(since, again, there is no reason for pg_dump to treat such a table
specially).

Willy hasn't provided enough context for us to know why that approach
might not be working for him, though a first guess is that he tried to
do a selective dump excluding geometry_columns.

I believe there was some discussion awhile back about whether postgis
could dodge this problem by cramming its additional info into type
modifiers (with the geometry-type typmodin and typmodout functions
becoming responsible for accessing the special table).  I don't know
if that can fly on syntax grounds, but if it can, I think all the core
infrastructure for it is in place as of 9.1.

            regards, tom lane


pgsql-general by date:

Previous
From: Nicola Cisternino
Date:
Subject: Re: String comparision in PostgreSQL
Next
From: "Gauthier, Dave"
Date:
Subject: Re: using vars in ddl in procedure call