From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Pepe TD Vo <pepevo@yahoo.com>
To: cgerard999@gmail.com
Cc: Christopher Browne <cbbrowne@gmail.com>
Cc: Pgsql-admin <pgsql-admin@postgresql.org>
Cc: Pgsql-general <pgsql-general@postgresql.org>
Subject: Re: create batch script to import into postgres tables
Date: Fri, 19 Jun 2020 06:58:02 -0700
Message-ID: <3bbdbc7b-0ca8-b162-5967-5822cc2edfd3@aklaver.com> (raw)
In-Reply-To: <448905667.492834.1592574816699@mail.yahoo.com>
References: <37a9ad71-b297-96b3-9c1f-1043e75dec58@aklaver.com>
<AB7CEEE5-3BC8-4F24-83D1-C60744E9B479@gmail.com>
<939136830.464657.1592565150445@mail.yahoo.com>
<519aa822-cb75-0565-1073-180c911f40a7@aklaver.com>
<448905667.492834.1592574816699@mail.yahoo.com>
On 6/19/20 6:53 AM, Pepe TD Vo wrote:
> Thank you sir and I am sorry for the typo not having "--" on password.
> I did spelling out with --password=mypassword
Please go back and read my post again.
>
>>> echo select count(*) from tableA; | "C:\Program
> Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h
> hostname.amazonaws.com -p 5432 --password=mypassword
>
> even -W for password
>>> echo select count(*) from tableA; | "C:\Program
> Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h
> hostname.amazonaws.com -p 5432 -W=mypassword
>
> none of them work, still prompt me for password to type in. I will look
> into the pgpassfile which I know it will fail again.
>
>
> very respectfully,
>
> **
> *Bach-Nga
>
> *No one in this world is pure and perfect. If you avoid people for
> their mistakes you will be alone. So judge less, love, and forgive
> more.EmojiEmojiEmoji
> To call him a dog hardly seems to do him justice though in as much as he
> had four legs, a tail, and barked, I admit he was, to all outward
> appearances. But to those who knew him well, he was a perfect gentleman
> (Hermione Gingold)
>
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success
>
>
>
>
> On Friday, June 19, 2020, 09:19:35 AM EDT, Adrian Klaver
> <adrian.klaver@aklaver.com> wrote:
>
>
> 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.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: adrian.klaver@aklaver.com, pepevo@yahoo.com, cgerard999@gmail.com, cbbrowne@gmail.com, pgsql-general@postgresql.org
Subject: Re: create batch script to import into postgres tables
In-Reply-To: <3bbdbc7b-0ca8-b162-5967-5822cc2edfd3@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox