Re: How to "COPY schema1.table TO schema2.table" ?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: How to "COPY schema1.table TO schema2.table" ?
Дата
Msg-id 20050203011204.GA32100@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: How to "COPY schema1.table TO schema2.table" ?  (Tim Goodaire <tgoodaire@linux.ca>)
Список pgsql-novice
On Wed, Feb 02, 2005 at 02:58:35PM -0500, Tim Goodaire wrote:

> You can copy a table from one schema to another by doing something like
> this:
>
> SET search_path TO schema1,schema2;

This isn't necessary for the CREATE TABLE statement below since
you're already using schema-qualified table names.  There might be
other reasons for doing so, however.

> CREATE TABLE schema2.mytable AS SELECT * FROM schema1.mytable;

Note that this copies only data -- you won't get constraints, default
values, indexes, triggers, rules, etc.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: Andrew Hammond
Дата:
Сообщение: Re: grant all the database object automatically
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Calling psql from a bat file on windows?