Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1HGPwx15904 for ; Sat, 17 Feb 2001 11:25:58 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f1HGP9903870; Sat, 17 Feb 2001 11:25:17 -0500 (EST) To: Ramiro Alba cc: pgsql-sql@postgresql.org Subject: Re: How to clone a table to an empty one In-reply-to: <3A8E90E7.4BFF6C1@labtie.mmt.upc.es> References: <3A8E90E7.4BFF6C1@labtie.mmt.upc.es> Comments: In-reply-to Ramiro Alba message dated "Sat, 17 Feb 2001 15:55:36 +0100" Date: Sat, 17 Feb 2001 11:25:09 -0500 Message-ID: <3867.982427109@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200102/297 X-Sequence-Number: 1493 Ramiro Alba writes: > I would need to create an exact reproduction of a certain table > (excluding data) converving primary key attributes and so on. Try pg_dump -s -t tablename dbname | psql dbname There is no easy way to do this directly in SQL ... regards, tom lane