pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Derrell.Lipman@UnwiredUniverse.com
To: pgsql-docs@postgresql.org
Subject: "man psql" \set documentation error
Date: Mon, 11 Feb 2002 10:50:47 -0500
Message-ID: <eljs6mqw.fsf@random.localnet.UnwiredUniverse.com> (raw)

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`


Cheers,

Derrell



view thread (3+ messages)  latest in thread

Message-ID: <eljs6mqw.fsf@random.localnet.UnwiredUniverse.com>
Permalink:  ../eljs6mqw.fsf@random.localnet.UnwiredUniverse.com/
Also on:    postgresql.org/message-id/eljs6mqw.fsf@random.localnet.UnwiredUniverse.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: Derrell.Lipman@UnwiredUniverse.com
  Subject: Re: "man psql" \set documentation error
  In-Reply-To: <eljs6mqw.fsf@random.localnet.UnwiredUniverse.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox