[postgis-users] create tables smarter

Chris Hermansen chris.hermansen at timberline.ca
Wed Jun 4 08:04:32 PDT 2008


There was a discussion awhile ago on this list about the ability to do 
something like:

CREATE TABLE foo AS
SELECT * EXCEPT X,Y,Z
FROM bar;

I don't recall if someone had a real solution (other than extending 
PostgreSQL :-)) but you might troll the archives a bit for 2007.

Andreas Laggner wrote:
> Hello list,
>
> i am searching for a solution for creating tables with less typing. I do
> not want to type every column i want to have in my new table, especially
> if column names will not change! I cannot use the postgresql "create
> table tablename as select * from" because of the geometry column (with
> this command i will insert all data the_geom included, but i will not
> have the entries, that addgeometrycolumn does). Would be fine to create
> the columns only first, then delete column the_geom, than execute
> addgeometrycolumn and than execute the insert......but i do not know how
> to create only the columns with *.
> I am also happy about other approaches to solve the problem  ;-)
>
> cheers      Andreas
>
>
>
>   


-- 
Regards,

Chris Hermansen         mailto:chris.hermansen at timberline.ca
tel+1.604.714.2878 · fax+1.604.733.0631 · mob+1.778.232.0644
Timberline Natural Resource Group · http://www.timberline.ca
401 · 958 West 8th Avenue  · Vancouver BC · Canada · V5Z 1E5




More information about the postgis-users mailing list