Re: Copy table structure

Поиск
Список
Период
Сортировка
От Louise Cofield
Тема Re: Copy table structure
Дата
Msg-id 003101c38d05$e9c1c910$7801a8c0@Louise
обсуждение исходный текст
Ответ на Copy table structure  (Anshuman Kanwar <ansh@expertcity.com>)
Список pgsql-novice
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


В списке pgsql-novice по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Full Outer Join with dates as index?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Serial Column Tweaking