"man psql" \set documentation error

From: Derrell(dot)Lipman(at)UnwiredUniverse(dot)com
To: pgsql-docs(at)postgresql(dot)org
Subject: "man psql" \set documentation error
Date: 2002-02-11 15:50:47
Message-ID: eljs6mqw.fsf@random.localnet.UnwiredUniverse.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Roberto Mello 2002-02-14 16:56:08 Re: Translation of the documentation
Previous Message Vince Vielhaber 2002-02-07 20:36:49 Re: PDF docs