Re: making a copy of a table within the same database

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: making a copy of a table within the same database
Дата
Msg-id 4045F765.707@mascari.com
обсуждение исходный текст
Ответ на making a copy of a table within the same database  ("Sally Sally" <dedeb17@hotmail.com>)
Список pgsql-general
Sally Sally wrote:

> I wanted to dump the contents of one table to another (with a different
> name) within the same database. I am looking at pg_restore and it
> doesn't seem to have the option of specifying the name of the table we
> want to dump to, only the name we want to dump from. Does this mean I
> have to create the table and do an sql statement to copy the table? Is
> this the best way?

If you want a copy of the data and the fundamental table design, not
including constraints, triggers, indexes, foreign keys, etc.:

CREATE TABLE foo AS
SELECT * FROM bar;

...

Mike Mascari


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

Предыдущее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: making a copy of a table within the same database
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: [ANNOUNCE] PostgreSQL 7.3.6 Now Available ...