duplicating tables (accross databases)

Поиск
Список
Период
Сортировка
От Jim Martinez
Тема duplicating tables (accross databases)
Дата
Msg-id Pine.LNX.4.33.0201101544210.907-100000@unagi.e-techservices.com
обсуждение исходный текст
Ответ на Re: duplicating table  ("Campano, Troy" <Troy.Campano@LibertyMutual.com>)
Список pgsql-general
> I know this will seem silly, but I'm trying to
> make a copy of a table with a few modifications.

A variation on the above:

Suppose I create and populate a table called people in the test database
and I want to move it to another database called production.  How can a
query across the schema?  And schema may not be the correct word.

For simplicity, suppose people is created (in both test and
production) using:

create table people (fname varchar(20), lname varchar(20));

I want to do something like
insert into production.people
  select fname, lname from test.people;

Actually I'd be connected to the production instance so I really want to
try:

insert into people
  select fname, lname from test.people;

An archive search yielded nothing, though maybe I searched with not the
best keyword (schema).

Any points, comments welcome.

Thanks in advance,
Jim Martinez


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: index and seq scan
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Insert Performance with WAL and Fsync