Re: create batch script to import into postgres tables

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Pepe TD Vo <pepevo(at)yahoo(dot)com>, cgerard999(at)gmail(dot)com
Cc: Christopher Browne <cbbrowne(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)postgresql(dot)org>, Pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: create batch script to import into postgres tables
Date: 2020-06-19 13:19:14
Message-ID: 519aa822-cb75-0565-1073-180c911f40a7@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On 6/19/20 4:12 AM, Pepe TD Vo wrote:
> thank you,   I tried that too, remove the quote around the echo and it
> prompt for password, as I mentioned no matter I put -P mypassword no
> matter what I spell out password=mypassword still argument error

Once again -P has nothing to do with password. Also --password does not
take an argument, it is meant to be used as is. The purpose is to force
a password prompt. This is all spelled out here:

https://www.postgresql.org/docs/12/app-psql.html

Also spelled out in above is:

" It is also convenient to have a ~/.pgpass file to avoid regularly
having to type in passwords. See Section 33.15 for more information."

And Section 33.15:

https://www.postgresql.org/docs/12/libpq-pgpass.html

"The file .pgpass in a user's home directory can contain passwords to be
used if the connection requires a password (and no password has been
specified otherwise). ..."

Read more at link for how to do that.

>
> >>echo select count(*) from tableA; | "C:\Program
> Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h
> hostname.amazonaws.com -p 5432
>
> >> echo select count(*) from tableA; | "C:\Program
> Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h
> hostname.amazonaws.com -p 5432 password=mypassword
>
> all usernames are same password.
>
> thank you so much for all input.
>
> v/r,
>
> **
> *Bach-Nga

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Pepe TD Vo 2020-06-19 13:53:36 Re: create batch script to import into postgres tables
Previous Message Hotmail 2020-06-19 12:59:03 Re: Any optimizations using oracle_fdw with oracle tables that have clob columns?

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-06-19 13:43:40 Re: HASH partitioning not working properly
Previous Message Srinivasa T N 2020-06-19 13:09:59 Re: HASH partitioning not working properly