Add clarification example to EXEC SQL CONNECT with password

From: Alan B <alan77codebits(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Add clarification example to EXEC SQL CONNECT with password
Date: 2012-09-20 16:17:15
Message-ID: CAGbN=G6P1dy4Q03oKdQig_oUWj82W_x67MRMwX2J+9DrFc=cxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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(at)sql(dot)mydomain(dot)com;

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

EXEC SQL BEGIN DECLARE SECTION;
const char *target = "mydb(at)sql(dot)mydomain(dot)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

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Denis Lapshin 2012-09-25 06:37:35 Wrong startup script of PostgreSQL 9.1.2 under OpenBSD 5.1
Previous Message Shigeru HANADA 2012-09-19 11:06:28 Different wording in file_fdw document