Re: new table with a select - Mailing list pgsql-sql

From Florian Weimer
Subject Re: new table with a select
Date
Msg-id 821uw993en.fsf@mid.bfk.de
Whole thread Raw
In response to Re: new table with a select  (Julien Cigar <jcigar@ulb.ac.be>)
List pgsql-sql
* Julien Cigar:

> create table foo as select * from bar;
>
> just add "where 1=2" if you just want the schema

There's also this:
 CREATE TABLE foo (LIKE bar);

This gives you more control over what aspects of the table are
duplicated; see the documentation for details.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


pgsql-sql by date:

Previous
From: Julien Cigar
Date:
Subject: Re: new table with a select
Next
From: gvim
Date:
Subject: Add one column to another