Re: SELECT * INTO TABLE is not working for me.

Lists: pgsql-sql
From: Roy Souther <roy(at)silicontao(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: SELECT * INTO TABLE is not working for me.
Date: 2001-05-30 17:02:01
Message-ID: 0105301102010Q.28903@OlympusMons
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

I am testing my SQL commands in pgaccess before I put them into my C++ code.
Trying to copy a table using...
SELECT * INTO TABLE copy_stuff FROM the_stuff

It creates the view but no table called copy_stuff exists after I run it. Why?
I can use...
CREATE TABLE copy_stuff AS SELECT * FROM the_stuff
that works and makes a new table, but it causes other problems with the
clients that this app is running from. I would like to make the SELECT * INTO
work. Any idea?

--
Roy Souther <roy(at)silicontao(dot)com>

01100010 10101110 11000110 11010110 00000100 10110010 10010110 11000110
01001110 11110110 11001110 00010110 10010110 00101110 10000100 10000100


From: "Sergey E(dot) Volkov" <sve(at)raiden(dot)bancorp(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT * INTO TABLE is not working for me.
Date: 2001-05-31 07:54:40
Message-ID: 9f4th2$2166$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

"Roy Souther" <roy(at)silicontao(dot)com> / :
news:0105301102010Q(dot)28903(at)OlympusMons(dot)(dot)(dot)
> I am testing my SQL commands in pgaccess before I put them into my C++
code.
> Trying to copy a table using...
> SELECT * INTO TABLE copy_stuff FROM the_stuff

Works only when 'copy_stuff' table is not exists for now.
If you want to populate existing table, just use ' insert into copy_stuff
select * from the_stuff';

>
> It creates the view but no table called copy_stuff exists after I run it.
Why?
> I can use...
> CREATE TABLE copy_stuff AS SELECT * FROM the_stuff
> that works and makes a new table, but it causes other problems with the
> clients that this app is running from. I would like to make the SELECT *
INTO
> work. Any idea?
>
> --
> Roy Souther <roy(at)silicontao(dot)com>
>
> 01100010 10101110 11000110 11010110 00000100 10110010 10010110 11000110
> 01001110 11110110 11001110 00010110 10010110 00101110 10000100 10000100
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Roy Souther" <roy(at)silicontao(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SELECT * INTO TABLE is not working for me.
Date: 2001-05-31 10:52:48
Message-ID: 007e01c0e9bf$d6444e80$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-sql

From: "Roy Souther" <roy(at)silicontao(dot)com>

> I am testing my SQL commands in pgaccess before I put them into my C++
code.
> Trying to copy a table using...
> SELECT * INTO TABLE copy_stuff FROM the_stuff
>
> It creates the view but no table called copy_stuff exists after I run it.
Why?
> I can use...
> CREATE TABLE copy_stuff AS SELECT * FROM the_stuff
> that works and makes a new table, but it causes other problems with the
> clients that this app is running from. I would like to make the SELECT *
INTO
> work. Any idea?

Works here - can you give version info etc?

richardh=> select * into table foo2 from foo;
SELECT
richardh=> select * from foo2;
a | b
---+----------------------------------
4 | Jack Smith
5 | Andrea Ottwick
(2 rows)

- Richard Huxton