[postgis-users] create tables smarter

Bruce Rindahl rindahl at lrcwe.com
Wed Jun 4 08:29:24 PDT 2008


Bruce Rindahl wrote:
> Chris Hermansen wrote:
>> 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.
> CREATE TABLE foo AS
> SELECT * FROM bar;
> ALTER TABLE DROP COLUMN X;
> ALTER TABLE DROP COLUMN Y;
> ALTER TABLE DROP COLUMN Z;
>
> Bruce
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
Correction!

CREATE TABLE foo AS
SELECT * FROM bar;
ALTER TABLE bar DROP COLUMN X;
ALTER TABLE bar DROP COLUMN Y;
ALTER TABLE bar DROP COLUMN Z;

Bruce



More information about the postgis-users mailing list