From: Bruce Momjian Date: Fri, 25 Jan 2013 16:18:44 +0000 (-0500) Subject: docs: In ecpg, clarify how username/password colon parameters are used X-Git-Tag: REL9_3_BETA1~429 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88886c79cc4fc8d8f7c5b7304ad1f13508f5b025;p=postgresql docs: In ecpg, clarify how username/password colon parameters are used Backpatch to 9.2. Patch from Alan B --- diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml index 63aaf89b87..bf01857a4c 100644 --- a/doc/src/sgml/ecpg.sgml +++ b/doc/src/sgml/ecpg.sgml @@ -194,9 +194,12 @@ EXEC SQL CONNECT TO unix:postgresql://sql.mydomain.com/mydb AS myconnection USER EXEC SQL BEGIN DECLARE SECTION; const char *target = "mydb@sql.mydomain.com"; const char *user = "john"; +const char *passwd = "secret"; EXEC SQL END DECLARE SECTION; ... -EXEC SQL CONNECT TO :target USER :user; +EXEC SQL CONNECT TO :target USER :user USING :passwd; + +EXEC SQL CONNECT TO :target USER :user/:passwd; The last form makes use of the variant referred to above as character variable reference. You will see in later sections how C