Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tyn6P-0002XT-La for pgsql-docs@arkaria.postgresql.org; Fri, 25 Jan 2013 17:30:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tyn6P-0001XI-5W for pgsql-docs@arkaria.postgresql.org; Fri, 25 Jan 2013 17:30:09 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tyn6O-0001XB-MU for pgsql-docs@postgresql.org; Fri, 25 Jan 2013 17:30:08 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tyn6H-000323-N7 for pgsql-docs@postgresql.org; Fri, 25 Jan 2013 17:30:08 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1Tyn6F-0000xP-SV; Fri, 25 Jan 2013 12:29:59 -0500 Date: Fri, 25 Jan 2013 12:29:59 -0500 From: Bruce Momjian To: Tom Lane Cc: Alan B , pgsql-docs@postgresql.org Subject: Re: Add clarification example to EXEC SQL CONNECT with password Message-ID: <20130125172959.GB6848@momjian.us> References: <20130125161942.GA6848@momjian.us> <14376.1359134732@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14376.1359134732@sss.pgh.pa.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On Fri, Jan 25, 2013 at 12:25:32PM -0500, Tom Lane wrote: > Bruce Momjian 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@sql.mydomain.com"; > > const char *user = "john"; > > EXEC SQL END DECLARE SECTION; > > ... > > ! EXEC SQL CONNECT TO :target USER :user; > > > > 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@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; > > ! > > ! 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 > > 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 http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs