insert data over dblink from bulk select of local table

Started by Marcus Engeneabout 12 years ago2 messagesgeneral
Jump to latest
#1Marcus Engene
mengpg2@engene.se

Hi,

I have a production database with some heavy views.

I'd like to make a hourly cron (or smth) that bulk inserts new entries
into a table on RDS.

It's easy to get data down to the prod side, but is it possible to do a
bulk insert the other way around? All examples I've seen adds the data
in a litteral way.

Thanks,
Marcus

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Marcus Engene (#1)
Re: insert data over dblink from bulk select of local table

On 03/25/2014 07:22 AM, Marcus Engene wrote:

Hi,

I have a production database with some heavy views.

I'd like to make a hourly cron (or smth) that bulk inserts new entries
into a table on RDS.

It's easy to get data down to the prod side, but is it possible to do a
bulk insert the other way around? All examples I've seen adds the data
in a litteral way.

AWS restricts server access to the Postgres instance:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html

"...Amazon RDS does not provide host access to DB instances..."

so I would say COPY is out.

You can use \copy from psql as they demonstrate:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html

This could be put into a cron job.

Thanks,
Marcus

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general