[postgis-users] How to create table new_table as select * from old_table

Robert W. Burgholzer rburghol at vt.edu
Thu Jan 8 03:52:48 PST 2004


This might not really be a good way to do it, and I left out some

-- Create a new geometry table entry:
 insert into geometry_columns 
(f_table_catalog,f_table_schema,f_table_name,f_geometry_column,coord_dimension
,srid,type) select 
b.f_table_catalog,b.f_table_schema,'new_table',b.f_geometry_column,b.coord_dim
ension,b.srid,b.type from geometry_columns as b where f_table_name = 
'old_table';

-- Insert your data:
create table new_table as select * from old_table;

This seemed to work on my machine.

Good Luck,

Robert

>===== Original Message From Konstantin Tokar <tokar at tokar.ru>, PostGIS Users 
Discussion <postgis-users at postgis.refractions.net> =====
>Hi
>
>How to execute inquiry of type
>
>create table new_table as select * from old_table;
>
>old_table - preliminary created table, with a column geom. This column
>is copied in new_table, but the description in geometry_columns for
>new_table is not created. What it is necessary to make that it has
>appeared in geometry_columns?
>
>--
> Konstantin Tokar
>
>
>______________________________
_________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users

Robert W. Burgholzer
rburghol at veetee dot edu
History of Nutrition: "Buddha probably consumed a high-carb diet."




More information about the postgis-users mailing list