Skip site navigation (1) Skip section navigation (2)

Re: select into...

From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: select into...
Date: 2009-03-16 23:16:57
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C0378F7E7@egcrc-ex01.egcrc.org (view raw or flat)
Thread:
Lists: pgsql-admin
Many thanks, Scott.

Tena Sakai


-----Original Message-----
From: Scott Marlowe [mailto:scott(dot)marlowe(at)gmail(dot)com]
Sent: Mon 3/16/2009 4:12 PM
To: Tena Sakai
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] select into...
 
On Mon, Mar 16, 2009 at 5:08 PM, Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu> wrote:
> Hi Everybody,
>
> I want to execute a query below:
>
>   select *
>     into my_table
>     from old_table
>    where (some_condition);
>
> The trouble is that the manual page states that this would
> "SELECT INTO creates a new table and fills it with data
> computed by a query."
>
> What I want is to append my_table.  Is there any way to
> get postgres to do what I want done?

You want insert:

insert into my_table select yada from old_table;

In response to

pgsql-admin by date

Next:From: Tena SakaiDate: 2009-03-16 23:31:10
Subject: Re: select into...
Previous:From: Fernando ArancibiaDate: 2009-03-16 23:13:16
Subject: Re: select into...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group