RE: Question about password character in ECPG's connection string
Egashira, Yusuke <egashira.yusuke@jp.fujitsu.com>
From: "Egashira, Yusuke" <egashira.yusuke@jp.fujitsu.com>
To: 'Giuseppe Sacco' <giuseppe@eppesuigoccas.homedns.org>, "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Date: 2019-08-28T01:18:48Z
Lists: pgsql-general
Hi, Giuseppe,
Thanks to response to my question!
> It seems to me that ECPG documentation does not allow specifying
> username and/or password in the connection string. The correct syntax
> should be:
>
> EXEC SQL CONNECT TO "unix:postgresql://localhost/connectdb" USER
> "myuser" IDENTIFIED BY "pass&word"
Yes, I could connect to database with "USER" and "IDENTIFIED BY" phrase in CONNECT statement.
However, I could also connect to database with password in connection string when my password does not contains '&' character.
1. In database,
> CREATE ROLE myuser LOGIN PASSWORD 'password';
2. In ECPG application,
EXEC SQL CONNECT "tcp:postgresql://localhost?user=myuser&password=password";
-> The connection was succeeded.
This behavior confuse me.
If user and password cannot write in connection string, what are parameters allowed in "connection_option" ?
I hope I can get this information from the ECPG documentation.
Regards.
--
Yusuke, Egashira.
Commits
-
Doc: describe the "options" allowed in an ECPG connection target string.
- fd198a89ba89 9.6.16 landed
- bea87c02cee7 9.4.25 landed
- 942b78af81aa 9.5.20 landed
- 9230cc706df0 10.11 landed
- 756349c87b85 13.0 landed
- 5eec908c3c2e 12.0 landed
- 232f645ae20f 11.6 landed
-
Cosmetic improvements for options-handling code in ECPGconnect().
- b61a5e6a1f8d 13.0 landed