Re: create batch script to import into postgres tables

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Pepe TD Vo <pepevo(at)yahoo(dot)com>
Cc: cgerard999(at)gmail(dot)com, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Christopher Browne <cbbrowne(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: create batch script to import into postgres tables
Date: 2020-06-19 19:37:28
Message-ID: EA7A2905-B9C3-4C5E-859E-E9B6D4692162@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

> On Jun 19, 2020, at 1:26 PM, Pepe TD Vo <pepevo(at)yahoo(dot)com> wrote:
>
> thank you for all the information but I have no problem connecting to the database using pgAdmin and/or directly psql from the postgres database.
>
> I need to set up a batch/cron job to run in Linux/AWS to ingest the data. Therefore pgadmin GUI is not an option. I used pgAdmin to create tables, triggers, function triggers and manual importing/exporting. You can't schedule a time to run importing from csv file(s) using pgAdmin as same OEM.
>
> The select table in this question is just an example for me to create scripting to see it connect or not. No one at work to manually run the script and enter the password. Need to bypass it like Oracle scripting. Since this is not an option to put the password to connect to the database and run the script(s), we will find another way to do.
>
> I am thankful for all the input.
>
> v/r,

And it has been explained upstream that one “way to do” is to use a .pgpass file for the cronjob user. And that file must be read-only to user, no access to group or other (chmod 400 $CRONUSER/.pgpass). Another is a “trust” entry for the user in pg_hba.conf. I suggest you revisit those messages.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Adrian Klaver 2020-06-19 19:37:55 Re: create batch script to import into postgres tables
Previous Message Pepe TD Vo 2020-06-19 19:26:05 Re: create batch script to import into postgres tables

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-06-19 19:37:55 Re: create batch script to import into postgres tables
Previous Message Pepe TD Vo 2020-06-19 19:26:05 Re: create batch script to import into postgres tables