Re: new table with a select

From: Julien Cigar <jcigar(at)ulb(dot)ac(dot)be>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: new table with a select
Date: 2011-08-25 09:48:26
Message-ID: 4E561A6A.60807@ulb.ac.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

create table foo as select * from bar;

just add "where 1=2" if you just want the schema

On 08/25/2011 11:44, ppdcc(at)sapo(dot)pt wrote:
>
>
> Hello to all,
>
>
> Can anybody tell me the sql instruction to create a new table with a
> select of other table?
>
> I need to create a new table based on paralell of a table of lines. Can
> anybody post to me a example?
>
> Can?t be a buffer, must be lines.
>
> Thanks
>
>
>
>
>
>
>

--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

Attachment Content-Type Size
jcigar.vcf text/x-vcard 292 bytes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Florian Weimer 2011-08-25 10:44:16 Re: new table with a select
Previous Message ppdcc 2011-08-25 09:44:35 new table with a select