Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEjRI-0004Jt-A2 for pgsql-docs@postgresql.org; Thu, 20 Sep 2012 16:17:20 +0000 Received: from mail-ee0-f46.google.com ([74.125.83.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEjRE-0003AC-D4 for pgsql-docs@postgresql.org; Thu, 20 Sep 2012 16:17:19 +0000 Received: by eekc1 with SMTP id c1so1028973eek.19 for ; Thu, 20 Sep 2012 09:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=XQ6Y+vaoR4yLDnpNA5qYSboNXbb75uQcpKtaIp//shw=; b=0nTsZUhvWSySHo8ycSHRRN9XIcvKKQKrLaLVZrKUFC+mX5Hrf54vEy6z3pMpYMEPnx lB5AFrnz6KIYTUlC9kLXVPBAkWwXagujWi3SXtklzOrnnHZ2w6bPDc1QID4Pi+hO5UyB 4W7imt66KEAMmrDetbKKgu21IH9df/Gjlq3aUphUotJoWwim06VbXdYrgu4FDWk+LW21 YerGlLGjarZk+uPvi1pHVheq/w+Y7Ffk7hyqJat1bRrMN87DTYQbBjbs8aFlYNd2Zdf2 VUNNCp1c/fc7EPaQ7vyUYQHnEpcI0/l2SwccVV8in4mULVSLFzootBvi7r406oXC7FUi vK7w== MIME-Version: 1.0 Received: by 10.14.181.132 with SMTP id l4mr2927890eem.17.1348157835435; Thu, 20 Sep 2012 09:17:15 -0700 (PDT) Received: by 10.14.199.130 with HTTP; Thu, 20 Sep 2012 09:17:15 -0700 (PDT) Date: Thu, 20 Sep 2012 18:17:15 +0200 Message-ID: Subject: Add clarification example to EXEC SQL CONNECT with password From: Alan B To: pgsql-docs@postgresql.org Content-Type: multipart/alternative; boundary=047d7b343db6e1deee04ca24748a X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201209/20 X-Sequence-Number: 7472 --047d7b343db6e1deee04ca24748a Content-Type: text/plain; charset=ISO-8859-1 Hi list, Hope this is the right place to suggest that change in the docs, otherwise is there a ticket management system for this stuff somewhere? Paying attention to the documentation at http://www.postgresql.org/docs/8.4/static/ecpg-connect.html and subsequent versions of the page (I am using 8.4), there is the option to specify "user-name" in various ways. However this may be confused as a single parameter to the connect string while it is a combination of 1 or 2 parameters that cannot go into a single string. To avoid confusion I suggest providing a complete example in "Here are some examples of CONNECT statements:" as follows: EXEC SQL CONNECT TO mydb@sql.mydomain.com; EXEC SQL CONNECT TO unix:postgresql://sql.mydomain.com/mydb AS myconnection USER john; 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 USING :passwd; or EXEC SQL CONNECT TO :target USER :user/:passwd; To make the distinction of parameters and string variables evident. Alan --047d7b343db6e1deee04ca24748a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi list,
Hope this is the right place to suggest that change in the docs= , otherwise is there a ticket management system for this stuff somewhere?
Paying attention to the documentation at http://www.postgresql.org/docs/= 8.4/static/ecpg-connect.html and subsequent versions of the page (I am = using 8.4), there is the option to specify "user-name" in various= ways. However this may be confused as a single parameter to the connect st= ring while it is a combination of 1 or 2 parameters that cannot go into a s= ingle string.

To avoid confusion I suggest providing a complete example in "Here= are some examples of CONNECT statements:" as follows:

EXEC S=
QL CONNECT TO mydb@sql.mydomain.co=
m;

EXEC SQL CONNECT TO unix:postgresql://sql.mydomain.com/mydb AS myconnection USER john;

EXEC SQL BEGIN DECLARE SECTION;
const char *target =3D "mydb@=
sql.mydomain.com";
const char *user =3D "john";
const char *passwd =3D "secret";
EXEC SQL END DECLARE SECTION;
 ...

EXEC SQL CONNECT TO :target USER :user USING :passwd;
or
EXEC SQ= L CONNECT TO :target USER :user/:passwd;
To make the distinction o= f parameters and string variables evident.

Alan

--047d7b343db6e1deee04ca24748a--