Re: Add clarification example to EXEC SQL CONNECT with password

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alan B <alan77codebits(at)gmail(dot)com>, pgsql-docs(at)postgresql(dot)org
Subject: Re: Add clarification example to EXEC SQL CONNECT with password
Date: 2013-01-25 17:29:59
Message-ID: 20130125172959.GB6848@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, Jan 25, 2013 at 12:25:32PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > *** a/doc/src/sgml/ecpg.sgml
> > --- b/doc/src/sgml/ecpg.sgml
> > *************** EXEC SQL CONNECT TO unix:postgresql://sq
> > *** 194,202 ****
> > EXEC SQL BEGIN DECLARE SECTION;
> > const char *target = "mydb(at)sql(dot)mydomain(dot)com";
> > const char *user = "john";
> > EXEC SQL END DECLARE SECTION;
> > ...
> > ! EXEC SQL CONNECT TO :target USER :user;
> > </programlisting>
> > The last form makes use of the variant referred to above as
> > character variable reference. You will see in later sections how C
> > --- 194,205 ----
> > 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;
> > !
> > ! EXEC SQL CONNECT TO :target USER :user/:passwd;
> > </programlisting>
> > The last form makes use of the variant referred to above as
> > character variable reference. You will see in later sections how C
>
> This sure looks like it has broken the intention of the paragraph
> immediately after the example. Also, it seems like you are providing
> two alternative ways of doing the same thing, but not explaining that.
> How is a reader supposed to know that he doesn't have to do both
> commands?

Yeah, I was worried about that, so I added the blank line. If you look
at the docs, we already are providing three connection examples, so now
there are four. You can see the current docs here (the official ones
are not updated yet):

http://momjian.us/pgsql_docs/ecpg-connect.html#ECPG-CONNECTING

I am open to suggestions.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2013-01-25 17:50:12 Re: Add clarification example to EXEC SQL CONNECT with password
Previous Message Tom Lane 2013-01-25 17:25:32 Re: Add clarification example to EXEC SQL CONNECT with password