From shavonne.marietta@studioform.it Fri Oct 14 08:44:21 2005 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3A6CED7693 for ; Fri, 14 Oct 2005 05:44:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13089-02 for ; Fri, 14 Oct 2005 08:44:17 +0000 (GMT) Received: from smtpout13.attiva.biz (smtpout13.attiva.biz [85.37.16.15]) by svr1.postgresql.org (Postfix) with ESMTP id 3EA15D70B9 for ; Fri, 14 Oct 2005 05:44:18 -0300 (ADT) Received: from FBCMFE02B06.fbc.local ([192.168.30.94]) by smtpout13.attiva.biz with Microsoft SMTPSVC(6.0.3790.211); Fri, 14 Oct 2005 10:45:03 +0200 Received: from dream ([81.74.60.30]) by FBCMFE02B06.fbc.local with Microsoft SMTPSVC(6.0.3790.211); Fri, 14 Oct 2005 10:45:02 +0200 Message-ID: <004801c5d09b$747fad80$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: Subject: copy table Date: Fri, 14 Oct 2005 10:44:13 +0200 Organization: Studio FORM MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0045_01C5D0AC.37B9E850" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-OriginalArrivalTime: 14 Oct 2005 08:45:02.0118 (UTC) FILETIME=[9100BC60:01C5D09B] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.435 required=5 tests=[AWL=0.434, HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200510/154 X-Sequence-Number: 23007 This is a multi-part message in MIME format. ------=_NextPart_000_0045_01C5D0AC.37B9E850 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello How can i copy a table from one schema to another.. Example.. * I have a database "mydatabase" * then i have 2 schemas "myschema1" and "myschema2" * in "myschema1" i have inserted a new line and i want to copy that to = "myschema2" so they both will be same..=20 How can i do it with SQL ??=20 I use pgadmin 3 to make my database in postgresql thank u ------=_NextPart_000_0045_01C5D0AC.37B9E850 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello
 
How can i copy a table from one schema = to=20 another..
 
Example..
 
* I have a database = "mydatabase"
* then i have 2 schemas "myschema1" and = "myschema2"
* in "myschema1" i have inserted a new = line and i=20 want to copy that to "myschema2" so they both will be same.. =
 
How can i do it with SQL ?? =
 
I use pgadmin 3 to make my = database=20 in postgresql
 
thank u
------=_NextPart_000_0045_01C5D0AC.37B9E850-- From andreas.kretschmer@schollglas.com Fri Oct 14 09:39:49 2005 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DAF2AD8B49 for ; Fri, 14 Oct 2005 06:39:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30543-02 for ; Fri, 14 Oct 2005 09:39:45 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by svr1.postgresql.org (Postfix) with ESMTP id 215DED89F6 for ; Fri, 14 Oct 2005 06:39:46 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0MKwh2-1EQM2V0Mwh-0000pH; Fri, 14 Oct 2005 11:39:47 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1EQM2V-0004YT-00 for pgsql-sql@postgresql.org; Fri, 14 Oct 2005 11:39:47 +0200 Date: Fri, 14 Oct 2005 11:39:47 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: copy table Message-ID: <20051014093947.GJ10299@webserv.wug-glas.de> Mail-Followup-To: "A. Kretschmer" , pgsql-sql@postgresql.org References: <004801c5d09b$747fad80$1102a8c0@dream> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004801c5d09b$747fad80$1102a8c0@dream> X-DEST: 208 X-MSMail-Priority: High X-Message-Flag: Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org User-Agent: mutt-ng 1.5.9i (Linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.267 required=5 tests=[MISSING_MIMEOLE=0, X_MSMAIL_PRIORITY_HIGH=0.267] X-Spam-Level: X-Archive-Number: 200510/156 X-Sequence-Number: 23009 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 === From contact2muraliin@yahoo.co.in Fri Oct 14 14:48:10 2005 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 58E10D72AA for ; Fri, 14 Oct 2005 11:48:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07440-09 for ; Fri, 14 Oct 2005 14:48:02 +0000 (GMT) Received: from web8609.mail.in.yahoo.com (web8609.mail.in.yahoo.com [202.43.219.84]) by svr1.postgresql.org (Postfix) with SMTP id 4FB41D83CB for ; Fri, 14 Oct 2005 11:48:03 -0300 (ADT) Received: (qmail 57203 invoked by uid 60001); 14 Oct 2005 14:48:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=O87cs3cjiHBCr6TcM4pdsfJrPYxVj+dcKd30M9x50cbnkPfR8J+EHorkvUOMocPyidGE2spgmx75xuhGj4NJvy0lk3x4CgV/sV/WSp4ErQE8y909sWyQ5Y3zaJkhZ9XYH1D8sRfopqFX6wox1LCd05kDG/vvVNvKeavaeYj6dck= ; Message-ID: <20051014144805.57201.qmail@web8609.mail.in.yahoo.com> Received: from [12.109.150.2] by web8609.mail.in.yahoo.com via HTTP; Fri, 14 Oct 2005 15:48:05 BST Date: Fri, 14 Oct 2005 15:48:05 +0100 (BST) From: Muralidharan Ramakrishnan Subject: Re: copy table To: Shavonne Marietta Wijesinghe , pgsql-sql@postgresql.org In-Reply-To: <004801c5d09b$747fad80$1102a8c0@dream> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1711589340-1129301285=:55625" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.453 required=5 tests=[AWL=-0.325, DNS_FROM_RFC_ABUSE=0.374, DNS_FROM_RFC_POST=1.376, HTML_60_70=0.027, HTML_MESSAGE=0.001] X-Spam-Level: * X-Archive-Number: 200510/163 X-Sequence-Number: 23016 --0-1711589340-1129301285=:55625 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit INSERT INTO MYSCHEMA2.TABLENAME SELECT * FROM MYSCHEMA1.TABLENAME WHERE < CONDITION > Shavonne Marietta Wijesinghe wrote: Hello How can i copy a table from one schema to another.. Example.. * I have a database "mydatabase" * then i have 2 schemas "myschema1" and "myschema2" * in "myschema1" i have inserted a new line and i want to copy that to "myschema2" so they both will be same.. How can i do it with SQL ?? I use pgadmin 3 to make my database in postgresql thank u --------------------------------- Yahoo! India Matrimony: Find your partner now. --0-1711589340-1129301285=:55625 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
INSERT INTO MYSCHEMA2.TABLENAME
     SELECT * FROM MYSCHEMA1.TABLENAME WHERE < CONDITION >

Shavonne Marietta Wijesinghe <shavonne.marietta@studioform.it> wrote:
Hello
 
How can i copy a table from one schema to another..
 
Example..
 
* I have a database "mydatabase"
* then i have 2 schemas "myschema1" and "myschema2"
* in "myschema1" i have inserted a new line and i want to copy that to "myschema2" so they both will be same..
 
How can i do it with SQL ??
 
I use pgadmin 3 to make my database in postgresql
 
thank u


Yahoo! India Matrimony: Find your partner now. --0-1711589340-1129301285=:55625--