Re: [GENERAL] creating a table from another table

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [GENERAL] creating a table from another table
Дата
Msg-id 199903081755.MAA06123@candle.pha.pa.us
обсуждение исходный текст
Ответ на creating a table from another table  ("David O'Farrell" <dave.ofarrell@aersoft.ie>)
Ответы Re: [GENERAL] creating a table from another table  (Karl Auer <auer@kom.id.ethz.ch>)
Список pgsql-general
>
> -- is there any smart way to duplicate a table definition (NOT the
> data in the table).I want to create table(s) from a predefined template
> and drop them when they are empty .
>

SELECT * INTO newone FROM table WHERE 1=0;

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

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

Предыдущее
От: "David O'Farrell"
Дата:
Сообщение: creating a table from another table
Следующее
От: Simon Drabble
Дата:
Сообщение: Foreign Keys