Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1IHg6E60094 for ; Mon, 18 Feb 2002 12:42:06 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g1IHg1x02806; Mon, 18 Feb 2002 12:42:01 -0500 (EST) From: Bruce Momjian Message-Id: <200202181742.g1IHg1x02806@candle.pha.pa.us> Subject: Re: "man psql" \set documentation error In-Reply-To: To: Derrell.Lipman@UnwiredUniverse.com Date: Mon, 18 Feb 2002 12:42:01 -0500 (EST) CC: pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL96 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200202/20 X-Sequence-Number: 1249 Derrell.Lipman@UnwiredUniverse.com wrote: > Running an application and \set'ing its output in a variable requires use of > the backtick '`' operator. Under the heading "SQL INTERPOLATION", the > examples should be as follows (the difference being use of backticks instead > of single quotes around the command to be executed): > > Current (wrong): > testdb=> \set content '\'' 'cat my_file.txt' '\'' > > Correct: > testdb=> \set content '\'' `cat my_file.txt` '\'' > > > > Current (wrong): > testdb=> \set content 'sed -e "s/'/\\\\\\'/g" < my_file.txt' > > Correct: > testdb=> \set content `sed -e "s/'/\\\\\\'/g" < my_file.txt` > I just checked and it looks fine in current sources. Does it look right in your browser: http://candle.pha.pa.us/main/writings/pgsql/sgml/app-psql.html -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026