insert from other database

Started by Esneikeralmost 17 years ago3 messagesgeneral
Jump to latest
#1Esneiker
eenriquez@cav.desoft.cu

Hello.

How can I insert data in a database from other database?

Like this: insert into name_table select from database.table?

Thanks.

Ing. Esneiker Enriquez Cabrera.

Excelencia en Software.

Desoft S.A. en Ciego de Ávila.

Joaquín de Agüero Esq. Calle 2. Ciego de Ávila. Cuba.

email: <mailto:eenriquez@cav.desoft.cu> eenriquez@cav.desoft.cu

#2Grzegorz Jaśkiewicz
gryzman@gmail.com
In reply to: Esneiker (#1)
Re: insert from other database

On Thu, Jun 4, 2009 at 3:44 PM, Esneiker <eenriquez@cav.desoft.cu> wrote:

Hello.

How can I insert data in a database from other database?

Like this: insert into name_table select from database.table?

you can't with postgresql directly.
You can use dbconnect module from contrib to do stuff like that.

--
GJ

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Grzegorz Jaśkiewicz (#2)
Re: insert from other database

=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman@gmail.com> writes:

On Thu, Jun 4, 2009 at 3:44 PM, Esneiker <eenriquez@cav.desoft.cu> wrote:

How can I insert data in a database from other database?
Like this: insert into name_table select from database.table?

you can't with postgresql directly.
You can use dbconnect module from contrib to do stuff like that.

If you expect to do this a lot, you should rethink whether you ought
to be dividing your tables up into different databases. Different
schemas in one database might be the right way instead. (What
mysql calls "databases" are a lot closer to our "schemas".)

regards, tom lane