X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 07EDF30F683 for ; Mon, 23 Jun 2003 16:30:28 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 03645-05 for ; Mon, 23 Jun 2003 13:30:17 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 2936430F6A2 for ; Mon, 23 Jun 2003 13:29:11 -0300 (ADT) Received: from utrhcs.cs.utwente.nl (utrhcs.cs.utwente.nl [130.89.10.247]) by www.postgresql.com (Postfix) with ESMTP id 752C2CF7FBA for ; Mon, 23 Jun 2003 12:30:02 -0300 (ADT) Received: from zeus.cs.utwente.nl (zeus.cs.utwente.nl [130.89.10.12]) by utrhcs.cs.utwente.nl (8.12.9/8.12.9) with ESMTP id h5NFQ7Cf011902 for ; Mon, 23 Jun 2003 17:26:07 +0200 (MET DST) Received: from utip095.dynamic.cs.utwente.nl (utip095 [130.89.11.76]) by zeus.cs.utwente.nl (8.12.9/8.12.9) with ESMTP id h5NFQ5l2024091 for ; Mon, 23 Jun 2003 17:26:05 +0200 (MEST) Date: Mon, 23 Jun 2003 17:26:06 +0200 From: "L.V.Boldareva" X-Mailer: The Bat! (v1.61) Educational X-Priority: 3 (Normal) Message-ID: <98966401561.20030623172606@pierro.dds.nl> To: pgsql-sql@postgresql.org Subject: Re: CREATE table1 FROM table2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS-perl11-milter (http://amavis.org/) X-Archive-Number: 200306/263 X-Sequence-Number: 14021 Hello! many people posted their answer to this simple question. however, neither CREATE TABLE AS nor SELECT INTO do not take care about keys and triggers, etc. The commands above only copy the structure of the table, and the data. Are there any workarounds fr copying the table as a whole object? thanks, Mila > Hi, > On 17 Jun 2003, Rado Petrik wrote: >> How I create table1 from other table2 . > CREATE TABLE table1 AS SELECT * FROM table2; > will work. > Regards,