Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmHSl-0002Do-Ib for pgsql-general@arkaria.postgresql.org; Fri, 19 Jun 2020 13:53:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jmHSk-00043J-FC for pgsql-general@arkaria.postgresql.org; Fri, 19 Jun 2020 13:53:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmHSj-000436-N9 for pgsql-general@lists.postgresql.org; Fri, 19 Jun 2020 13:53:46 +0000 Received: from sonic317-26.consmr.mail.bf2.yahoo.com ([74.6.129.81]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jmHSf-0004jx-T0 for pgsql-general@postgresql.org; Fri, 19 Jun 2020 13:53:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1592574819; bh=/ReFPklQRwo8Ic+TrtO2fReE4FPp+9lhkjMUg7VdKy4=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=paPbbGdjbUHvXe6l+ggLIB3q9YD/8GcvLKCQAKWQZmwETC+iF4xy03vwjmlweJvS1j8h3n6YXg1aaBsFzXrHXcbutTRf7qSC6Ay0Xm7RTa6VTMvJlxoQNb58B/eZ41eQUrFQyE1s2WMYgk5Gn0Ek0Pmsrm7qA5B8JJwRLcIUiVCO+Ss/5H7gV+kG2+nMSo0xTZ5yiTaGdGuzb2X8baBGzrcx8Py8iVT0q5smQDPPnf812BahZWw/DGB3iux2MDyEaY5An3EmEpaRFS3y6iXjxWx/yZ9Wfd5zp5P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ae5eyFwlWQWU4wzVS4l1vklb.yBKU8vutRhA5RiNwdbLYnLH8G6gV6Cl36D4jyR kWujmM47zlCZSfknqw5.HwN_ua4rGZEr04L.c3my4y571c7QYCzMoN9142WYyE4vkapW.gzpZ.iP gH2pBlgX615ImMO_rISyq1Kdb.vJbkenchEw8ShBHhxkrVBl1D_2En6Cfj.15FfWI_5A7H40SlvZ WD4FNwLaFhX2_ihxr0KRV2c2MqZGYaxiJJl7pss_qgzzYzuRMJiFuao4CF.9._HrVI8nREnNVLwA ieYvJY2oEP_lmxsNOPShA3SMDLkXDM8PrE49D1o2ePWJdXF1wjLA35lAWcicaOKipehhLttlIP0w 5JXZHoFY5F15AE_cEy6sXDz8J56h6IiYfDxaxHNF6cVWUc5gCPC_03a159cHLsLHDmrtaRnOVfjg guMben0PzuAmabPkbtEEwdbP5wbEhllQv Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Fri, 19 Jun 2020 13:53:39 +0000 Date: Fri, 19 Jun 2020 13:53:36 +0000 (UTC) From: Pepe TD Vo Reply-To: Pepe TD Vo To: cgerard999@gmail.com, Adrian Klaver Cc: Christopher Browne , Pgsql-admin , Pgsql-general Message-ID: <448905667.492834.1592574816699@mail.yahoo.com> In-Reply-To: <519aa822-cb75-0565-1073-180c911f40a7@aklaver.com> References: <37a9ad71-b297-96b3-9c1f-1043e75dec58@aklaver.com> <939136830.464657.1592565150445@mail.yahoo.com> <519aa822-cb75-0565-1073-180c911f40a7@aklaver.com> Subject: Re: create batch script to import into postgres tables MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_492833_1620337505.1592574816697" X-Mailer: WebService/1.1.16138 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36 Content-Length: 12338 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_492833_1620337505.1592574816697 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you sir and I am sorry for the typo not having "--" on password.=C2= =A0 I did spelling out with --password=3Dmypassword >>=C2=A0echo=C2=A0select count(*) from tableA; |=C2=A0"C:\Program Files\Pos= tgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h hostname.amazonaws.com -p= 5432 --password=3Dmypassword even -W for password>>=C2=A0echo=C2=A0select count(*) from tableA; |=C2=A0"= C:\Program Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h hostn= ame.amazonaws.com -p 5432 -W=3Dmypassword none of them work, still prompt me for password to type in.=C2=A0 I will lo= ok into the pgpassfile which I know it will fail again. very respectfully, Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir mistakes you will be alone. So judge less, love, and forgive more.To cal= l 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 =20 On Friday, June 19, 2020, 09:19:35 AM EDT, Adrian Klaver wrote: =20 =20 On 6/19/20 4:12 AM, Pepe TD Vo wrote: > thank you,=C2=A0 =C2=A0I tried that too, remove the quote around the echo= and it=20 > prompt for password, as I mentioned no matter I put -P mypassword no=20 > matter what I spell out password=3Dmypassword still argument error Once again -P has nothing to do with password. Also --password does not=20 take an argument, it is meant to be used as is. The purpose is to force=20 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=20 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=20 used if the connection requires a password (and no password has been=20 specified otherwise).=C2=A0 ..." Read more at link for how to do that. >=20 >=C2=A0 >>echo select count(*) from tableA; | "C:\Program=20 > Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h=20 > hostname.amazonaws.com -p 5432 >=20 >=C2=A0 >> echo select count(*) from tableA; | "C:\Program=20 > Files\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h=20 > hostname.amazonaws.com -p 5432 password=3Dmypassword >=20 > all usernames are same password. >=20 > thank you so much for all input. >=20 > v/r, >=20 > ** > *Bach-Nga --=20 Adrian Klaver adrian.klaver@aklaver.com =20 ------=_Part_492833_1620337505.1592574816697 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you sir and I am sorry for the typo not having "--" on passwo= rd.  I did spelling out with --password=3Dmypassword

>> echo selec= t count(*) from tableA; | "C:\Program Files\PostgreSQL\11\bin\psql" -U= PSmasteruser -d PSCIDR -h hostname.amazonaws.com -p 5432 --password=3Dmypa= ssword
=
even -W for pas= sword
>>=  echo select count(*) fro= m tableA; | "C:\Program Files\PostgreSQL\11\bin\psql" -U PSmasteruser = -d PSCIDR -h hostname.amazonaws.com -p 5432 -W=3Dmypassword

none of them work, still prompt me for password to type in.  I will l= ook 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 a= void people for their mistakes you will be alone. So judge less, love, and = forgive more.3D"Emoji"3D"Emoji"
<= /font>
To call him a dog hardly seems to do him justice thoug= h in as much as he had four legs, a tail, and barked, I admit he was, to al= l outward appearances. But to those who knew him well, he was a perfect gen= tleman (Hermione Gingold)

**Live simply **Love generously **Care deeply **Speak kindl= y.
*** Genuinely rich *** Faithful talent *= ** Sharing success


=


=20
=20
On Friday, June 19, 2020, 09:19:35 AM EDT, Adrian Klave= r <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
> mat= ter what I spell out password=3Dmypassword still argument error

Once again -P has nothing to do with password. Al= so --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 av= oid regularly
having to type in passwords. See Section 3= 3.15 for more information."

And Sectio= n 33.15:

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

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

Read more at link for how to do that.=


>
>  >>echo select count(*) f= rom tableA; | "C:\Program
> Files\PostgreSQL\11\bin\p= sql" -U PSmasteruser -d PSCIDR -h
> hostname.amazonaw= s.com -p 5432
>
>  >>= echo select count(*) from tableA; | "C:\Program
> Fi= les\PostgreSQL\11\bin\psql" -U PSmasteruser -d PSCIDR -h
> hostname.amazonaws.com -p 5432 password=3Dmypassword
>
> all usernames are same password.
>
> thank you so much for all input.
>
> v/r,
>
> **
> *Bach-Nga
--
Adrian Klaver
adrian.klaver@aklaver.com

------=_Part_492833_1620337505.1592574816697--