From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: copy table
Date: Fri, 14 Oct 2005 11:39:47 +0200
Message-ID: <20051014093947.GJ10299@webserv.wug-glas.de> (raw)
In-Reply-To: <004801c5d09b$747fad80$1102a8c0@dream>
References: <004801c5d09b$747fad80$1102a8c0@dream>
am 14.10.2005, um 10:44:13 +0200 mailte Shavonne Marietta Wijesinghe folgendes:
> Hello
>
> How can i copy a table from one schema to another..
create table as select * from table
>
> Example..
Yeah!
test=# create schema foo;
CREATE SCHEMA
test=# create schema bar;
CREATE SCHEMA
test=# create table foo.test (id int);
CREATE TABLE
test=# insert into foo.test values (1);
INSERT 3381544 1
test=# create table bar.test as select * from foo.test;
SELECT
test=# select * from foo.test;
id
----
1
(1 row)
test=# select * from bar.test;
id
----
1
(1 row)
> I use pgadmin 3 to make my database in postgresql
You shold better use psql to learn sql.
Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
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: andreas.kretschmer@schollglas.com
Subject: Re: copy table
In-Reply-To: <20051014093947.GJ10299@webserv.wug-glas.de>
* 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