CREATE TABLE table2 AS SELECT * FROM table1 WHERE 1=2;
(This creates the structure only -- no data will be transferred because
1 will never equal 2). :)
Louise
-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Anshuman Kanwar
Sent: Saturday, October 04, 2003 1:22 PM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Copy table structure
Hi all,
How do I copy only the table structure from one tabe to another.
Table A has some data but I just want to copy the number of columns and
the
column names from this table and create a table B. What is the best way
of
doing this ?
Thanks in advance,
-ansh
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org