DBI connection to multiple database - Mailing list pgsql-general

From Johnson, Shaunn
Subject DBI connection to multiple database
Date
Msg-id 73309C2FDD95D11192E60008C7B1D5BB05FED33F@snt452.corp.bcbsm.com
Whole thread Raw
Responses Re: DBI connection to multiple database  (nolan@celery.tssi.com)
Re: DBI connection to multiple database  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general

Howdy

Running PostgreSQL 7.2.1 on RedHat Linux 7.2.

I know this may be a non-Pg question, but here goes:

Is there a way to connect to one database, extract data,
(say, some select query) and then export that data
into another database without having to table the
data into a file of some sort?

For example, let's say I have two databases running on the
same machine.  I have a script that opens a connection to
Pg (at some port number) and execute a sql ... that would
give me the variable (maybe an array?) to review / test / QC.
Then, I would need to open a connection to Pg (at some new
port) and figure out how to test to see if the target table
exists and has the right amount of columns and then
export / insert / copy the previously build array into
that target table.

It sounds straight forward (at least now that I'm thinking
out loud), but I've never done it and wondered if any of
you have done some thing like that.  If so, any tips or
suggestions?

Thanks!

-X

pgsql-general by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: TIMESTAMP SUBTRACTION
Next
From: "alex b."
Date:
Subject: caching query results