[postgis-users] create tables smarter

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


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



More information about the postgis-users mailing list