"man psql" \set documentation error - Mailing list pgsql-docs

From Derrell.Lipman@UnwiredUniverse.com
Subject "man psql" \set documentation error
Date
Msg-id eljs6mqw.fsf@random.localnet.UnwiredUniverse.com
Whole thread Raw
Responses Re: "man psql" \set documentation error  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-docs
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

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: 7.2 docs
Next
From: Bruce Momjian
Date:
Subject: Re: "man psql" \set documentation error