[postgis-users] How to dump a postgis table from one database to another

Carl Anderson carl.anderson at vadose.org
Thu Jun 3 17:54:46 PDT 2004


On 06/03/2004 12:27:18 PM, Paul Ramsey wrote:
> You'll have to hand-enter the appropriate geometry_columns entry for  
> your newly transferred table. Failing that, pgsql2shp, shp2pgsql will  
> also work, though potentially with some mangling due to the  
> limitations of shape format.
>

Paul,
That REALLY scares me, users directly editing geometry_columns.

how about a function
   register_geometry_column (schema,table,column)

That does the insert (detecting the existing SRID and dimension and  
geometry type from teh existing table) followed by a call to  
update_geometry_stats(schema,table,column).

You already provide fix_geometry_column(), and update_geometry_stats()
which cleanup bogus entries.

addgeometrycolumn(), and dropgeometrycolumn() which effect a single  
table

this way users could be steered away from editing the table directly.
personally I am nervous about people setting geometry_type correctly.



> On Thursday, June 3, 2004, at 06:22 AM, Marcel Koopman wrote:
> 
>> Hello,
>> 
>> I have this postgis table in a testdb database.
>> 
>> I want to transfer it into my geodb database.
>> 
>> I tried pg_dump but this doesnt work. It seems that the table pc4 is  
>> not entered in the geometrycolumns table.
>> 
>> So.. how do i tranfer the table?
>> 
>> Thanks for you help.
>> 
>> Marcel
>> 
>> 
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>      Paul Ramsey
>      Refractions Research
>      Email: pramsey at refractions.net
>      Phone: (250) 885-0632
> 
> _______________________________________________
> 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