duplicating tables (accross databases)

From: Jim Martinez <jjm(at)bigbigorg(dot)org>
To: <pgsql-general(at)postgresql(dot)org>
Subject: duplicating tables (accross databases)
Date: 2002-01-10 20:57:57
Message-ID: Pine.LNX.4.33.0201101544210.907-100000@unagi.e-techservices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff 2002-01-10 21:10:35 large file limitation
Previous Message Jason Earl 2002-01-10 20:14:00 Re: index and seq scan