pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Cigar <jcigar@ulb.ac.be>
To: pgsql-sql@postgresql.org
Subject: Re: new table with a select
Date: Thu, 25 Aug 2011 11:48:26 +0200
Message-ID: <4E561A6A.60807@ulb.ac.be> (raw)
In-Reply-To: <20110825104435.68556k0yyck63vr7@mail.sapo.pt>
References: <20110825104435.68556k0yyck63vr7@mail.sapo.pt>

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@sapo.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.

Attachments:

  [text/x-vcard] jcigar.vcf (290B, ../4E561A6A.60807@ulb.ac.be/2-jcigar.vcf)
  download | inline:
begin:vcard
fn:Julien Cigar
n:Cigar;Julien
org;quoted-printable:Belgian Biodiversity Platform;ULB (Universit=C3=A9 Libre de Bruxelles)
adr:;;;Brussels;;;Belgium
email;internet:jcigar@ulb.ac.be
tel;work:+32(0)26505752
x-mozilla-html:FALSE
url:http://www.biodiversity.be
version:2.1
end:vcard

view thread (5+ messages)  latest in thread

Message-ID: <4E561A6A.60807@ulb.ac.be>
Permalink:  ../4E561A6A.60807@ulb.ac.be/
Also on:    postgresql.org/message-id/4E561A6A.60807@ulb.ac.be

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jcigar@ulb.ac.be
  Subject: Re: new table with a select
  In-Reply-To: <4E561A6A.60807@ulb.ac.be>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox